Skip to content

Commit

Permalink
Use Eq to compare uint256
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Oct 24, 2024
1 parent 19678f3 commit d0079a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions x/evm/keeper/statedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ func (suite *KeeperTestSuite) TestAddBalance() {
post := vmdb.GetBalance(suite.address)

if tc.isNoOp {
suite.Require().Equal(prev.String(), post.String())
suite.Require().True(prev.Eq(post))
} else {
suite.Require().Equal(new(uint256.Int).Add(prev, tc.amount).String(), post.String())
suite.Require().True(new(uint256.Int).Add(prev, tc.amount).Eq(post))
}
})
}
Expand Down Expand Up @@ -136,9 +136,9 @@ func (suite *KeeperTestSuite) TestSubBalance() {
post := vmdb.GetBalance(suite.address)

if tc.isNoOp {
suite.Require().Equal(prev.String(), post.String())
suite.Require().True(prev.Eq(post))
} else {
suite.Require().Equal(new(uint256.Int).Sub(prev, tc.amount).String(), post.String())
suite.Require().True(new(uint256.Int).Sub(prev, tc.amount).Eq(post))
}
})
}
Expand Down

0 comments on commit d0079a8

Please sign in to comment.