chg: fix tests

This commit is contained in:
marcello33 2024-09-10 17:37:22 +02:00
parent 8c14f12d68
commit 18c7226d2e
No known key found for this signature in database
GPG key ID: 06128777E3C36B16

View file

@ -23,6 +23,7 @@ import (
"fmt" "fmt"
"maps" "maps"
"math" "math"
"math/big"
"math/rand" "math/rand"
"reflect" "reflect"
"slices" "slices"
@ -1217,14 +1218,14 @@ func TestMVHashMapRevertConcurrent(t *testing.T) {
// Tx0 touches the account. Amount doesn't matter. // Tx0 touches the account. Amount doesn't matter.
// This is to make sure that Tx1 and Tx2 will use the same state object from Tx0. // This is to make sure that Tx1 and Tx2 will use the same state object from Tx0.
states[0].AddBalance(addr, common.Big0) states[0].AddBalance(addr, uint256.MustFromBig(common.Big0), tracing.BalanceChangeUnspecified)
states[0].Finalise(false) states[0].Finalise(false)
states[0].FlushMVWriteSet() states[0].FlushMVWriteSet()
// Tx1 creates the account and add balance // Tx1 creates the account and add balance
snapshot1 := states[1].Snapshot() snapshot1 := states[1].Snapshot()
states[1].CreateAccount(addr) states[1].CreateAccount(addr)
states[1].AddBalance(addr, balance) states[1].AddBalance(addr, uint256.MustFromBig(balance), tracing.BalanceChangeUnspecified)
// Tx2 creates the account, reverts. // Tx2 creates the account, reverts.
snapshot2 := states[2].Snapshot() snapshot2 := states[2].Snapshot()
@ -1233,7 +1234,7 @@ func TestMVHashMapRevertConcurrent(t *testing.T) {
states[2].Finalise(false) states[2].Finalise(false)
// Tx2 adds balance // Tx2 adds balance
states[2].AddBalance(addr, balance) states[2].AddBalance(addr, uint256.MustFromBig(balance), tracing.BalanceChangeUnspecified)
// Tx1 now reverts // Tx1 now reverts
states[1].RevertToSnapshot(snapshot1) states[1].RevertToSnapshot(snapshot1)