Skip to content

Commit

Permalink
chg: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcello33 committed Sep 10, 2024
1 parent 8c14f12 commit 18c7226
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/state/statedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"fmt"
"maps"
"math"
"math/big"
"math/rand"
"reflect"
"slices"
Expand Down Expand Up @@ -1217,14 +1218,14 @@ func TestMVHashMapRevertConcurrent(t *testing.T) {

// 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.
states[0].AddBalance(addr, common.Big0)
states[0].AddBalance(addr, uint256.MustFromBig(common.Big0), tracing.BalanceChangeUnspecified)
states[0].Finalise(false)
states[0].FlushMVWriteSet()

// Tx1 creates the account and add balance
snapshot1 := states[1].Snapshot()
states[1].CreateAccount(addr)
states[1].AddBalance(addr, balance)
states[1].AddBalance(addr, uint256.MustFromBig(balance), tracing.BalanceChangeUnspecified)

// Tx2 creates the account, reverts.
snapshot2 := states[2].Snapshot()
Expand All @@ -1233,7 +1234,7 @@ func TestMVHashMapRevertConcurrent(t *testing.T) {
states[2].Finalise(false)

// Tx2 adds balance
states[2].AddBalance(addr, balance)
states[2].AddBalance(addr, uint256.MustFromBig(balance), tracing.BalanceChangeUnspecified)

// Tx1 now reverts
states[1].RevertToSnapshot(snapshot1)
Expand Down

0 comments on commit 18c7226

Please sign in to comment.