refactor: remove a pointer of Balance

This commit is contained in:
caseylove 2024-07-03 09:49:19 +08:00
parent 40d4a0eeed
commit f30a3cf48e
3 changed files with 6 additions and 6 deletions

View file

@ -898,9 +898,9 @@ func newAccounts(n int) (accounts []Account) {
return accounts
}
func newRPCBalance(balance *big.Int) **hexutil.Big {
func newRPCBalance(balance *big.Int) *hexutil.Big {
rpcBalance := (*hexutil.Big)(balance)
return &rpcBalance
return rpcBalance
}
func newRPCBytes(bytes []byte) *hexutil.Bytes {

View file

@ -970,7 +970,7 @@ func (api *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rp
type OverrideAccount struct {
Nonce *hexutil.Uint64 `json:"nonce"`
Code *hexutil.Bytes `json:"code"`
Balance **hexutil.Big `json:"balance"`
Balance *hexutil.Big `json:"balance"`
State map[common.Hash]common.Hash `json:"state"`
StateDiff map[common.Hash]common.Hash `json:"stateDiff"`
}
@ -994,7 +994,7 @@ func (diff *StateOverride) Apply(statedb *state.StateDB) error {
}
// Override account balance.
if account.Balance != nil {
u256Balance, _ := uint256.FromBig((*big.Int)(*account.Balance))
u256Balance, _ := uint256.FromBig((*big.Int)(account.Balance))
statedb.SetBalance(addr, u256Balance, tracing.BalanceChangeUnspecified)
}
if account.State != nil && account.StateDiff != nil {

View file

@ -1308,9 +1308,9 @@ func newAccounts(n int) (accounts []account) {
return accounts
}
func newRPCBalance(balance *big.Int) **hexutil.Big {
func newRPCBalance(balance *big.Int) *hexutil.Big {
rpcBalance := (*hexutil.Big)(balance)
return &rpcBalance
return rpcBalance
}
func hex2Bytes(str string) *hexutil.Bytes {