From 67d6f523133055a7bd9225ae634daa72ce17cda8 Mon Sep 17 00:00:00 2001 From: blockchaindevsh Date: Sun, 29 Dec 2024 16:18:32 +0800 Subject: [PATCH] make `GetBalance` return the sum of native & sgt balance --- internal/ethapi/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 7712d71273..6c90a314fd 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -688,8 +688,8 @@ func (api *BlockChainAPI) GetBalance(ctx context.Context, address common.Address if state == nil || err != nil { return nil, err } - b := state.GetBalance(address).ToBig() - return (*hexutil.Big)(b), state.Error() + nativeBalance, sgtBalance := core.GetGasBalancesInBig(state, api.b.ChainConfig(), address) + return (*hexutil.Big)(new(big.Int).Add(nativeBalance, sgtBalance)), state.Error() } // AccountResult structs for GetProof