aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2020-09-19 19:32:37 -0400
committerDeterminant <[email protected]>2020-09-19 19:32:37 -0400
commit80f76ae97372ea074ce660dbcaffd97c648ece22 (patch)
treee9029d3ff63fa84ee2089ad4b020c40772e4d768 /internal
parent4a447f41d8f03796e8581031a41976fb5ba299b4 (diff)
fully support C<->X asset transferv0.3.1-rc.1
Diffstat (limited to 'internal')
-rw-r--r--internal/ethapi/api.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index 9e50f64..825f8fc 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -25,6 +25,7 @@ import (
"strings"
"time"
+ "github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/coreth/accounts/keystore"
"github.com/ava-labs/coreth/accounts/scwallet"
@@ -558,12 +559,12 @@ func (s *PublicBlockChainAPI) GetBalance(ctx context.Context, address common.Add
// GetBalanceMultiCoin returns the amount of wei for the given address in the state of the
// given block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta
// block numbers are also allowed.
-func (s *PublicBlockChainAPI) GetBalanceMultiCoin(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash, coinID common.Hash) (*hexutil.Big, error) {
+func (s *PublicBlockChainAPI) GetAssetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash, assetID ids.ID) (*hexutil.Big, error) {
state, _, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)
if state == nil || err != nil {
return nil, err
}
- return (*hexutil.Big)(state.GetBalanceMultiCoin(address, coinID)), state.Error()
+ return (*hexutil.Big)(state.GetBalanceMultiCoin(address, assetID.Key())), state.Error()
}
// Result structs for GetProof