mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
abi.go: Use fmt.Errorf() instead of errors.New()
This commit is contained in:
parent
621aeedbd0
commit
462f4c388c
1 changed files with 2 additions and 3 deletions
5
abi.go
5
abi.go
|
|
@ -2,7 +2,6 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -31,13 +30,13 @@ func GetAbi(account eos.AccountName) (*eos.ABI, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
resp, err := eosClient.GetABI(eosClientCtx, account)
|
resp, err := eosClient.GetABI(eosClientCtx, account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New(fmt.Sprintf("api: %s", err))
|
return nil, fmt.Errorf("api: %s", err)
|
||||||
}
|
}
|
||||||
abi = &resp.ABI
|
abi = &resp.ABI
|
||||||
|
|
||||||
err = abiCache.Set(key, abi, time.Hour)
|
err = abiCache.Set(key, abi, time.Hour)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New(fmt.Sprintf("cache: %s", err))
|
return nil, fmt.Errorf("cache: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return abi, nil
|
return abi, nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue