mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
refactor: remove a pointer of Balance
This commit is contained in:
parent
40d4a0eeed
commit
f30a3cf48e
3 changed files with 6 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue