Skip to content

Commit 6743707

Browse files
use binint.cmp
1 parent f99591a commit 6743707

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/blockchain_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,11 +1003,11 @@ func TestEIP3651(t *testing.T) {
10031003
tx := block.Transactions()[0]
10041004
gasPrice := new(big.Int).Add(block.BaseFee(), tx.EffectiveGasTipValue(block.BaseFee()))
10051005
expected := new(big.Int).SetUint64(block.GasUsed() * gasPrice.Uint64())
1006-
require.Equal(t, expected, actual, "miner balance incorrect: expected %d, got %d", expected, actual)
1006+
require.Zero(t, actual.Cmp(expected), "miner balance incorrect: expected %d, got %d", expected, actual)
10071007

10081008
// 4: Ensure the tx sender paid for the gasUsed * (block baseFee + effectiveGasTip).
10091009
// Note this differs from go-ethereum where the miner receives the gasUsed * block baseFee,
10101010
// as our handling of the coinbase payment is different.
10111011
actual = new(big.Int).Sub(funds, state.GetBalance(addr1).ToBig())
1012-
require.Equal(t, expected, actual, "sender balance incorrect: expected %d, got %d", expected, actual)
1012+
require.Zero(t, actual.Cmp(expected), "sender balance incorrect: expected %d, got %d", expected, actual)
10131013
}

0 commit comments

Comments
 (0)