aboutsummaryrefslogtreecommitdiffstats
path: root/tests/state_test_util.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/state_test_util.go')
-rw-r--r--tests/state_test_util.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/state_test_util.go b/tests/state_test_util.go
index 064bf4588..81f49efa5 100644
--- a/tests/state_test_util.go
+++ b/tests/state_test_util.go
@@ -26,6 +26,7 @@ import (
"testing"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
@@ -170,11 +171,11 @@ func runStateTest(chainConfig *params.ChainConfig, test VmTest) error {
return fmt.Errorf("did not find expected post-state account: %s", addr)
}
- if balance := statedb.GetBalance(address); balance.Cmp(common.Big(account.Balance)) != 0 {
- return fmt.Errorf("(%x) balance failed. Expected: %v have: %v\n", address[:4], common.String2Big(account.Balance), balance)
+ if balance := statedb.GetBalance(address); balance.Cmp(math.MustParseBig256(account.Balance)) != 0 {
+ return fmt.Errorf("(%x) balance failed. Expected: %v have: %v\n", address[:4], math.MustParseBig256(account.Balance), balance)
}
- if nonce := statedb.GetNonce(address); nonce != common.String2Big(account.Nonce).Uint64() {
+ if nonce := statedb.GetNonce(address); nonce != math.MustParseUint64(account.Nonce) {
return fmt.Errorf("(%x) nonce failed. Expected: %v have: %v\n", address[:4], account.Nonce, nonce)
}
@@ -205,7 +206,7 @@ func runStateTest(chainConfig *params.ChainConfig, test VmTest) error {
func RunState(chainConfig *params.ChainConfig, statedb *state.StateDB, env, tx map[string]string) ([]byte, []*types.Log, *big.Int, error) {
environment, msg := NewEVMEnvironment(false, chainConfig, statedb, env, tx)
- gaspool := new(core.GasPool).AddGas(common.Big(env["currentGasLimit"]))
+ gaspool := new(core.GasPool).AddGas(math.MustParseBig256(env["currentGasLimit"]))
root, _ := statedb.Commit(false)
statedb.Reset(root)