Skip to content

Commit

Permalink
fix gas on unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kroggen committed Oct 25, 2023
1 parent d3ebf15 commit abf8c9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contract/vm_dummy/vm_dummy_pub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ func TestContractSendF(t *testing.T) {
require.NoErrorf(t, err, "failed to connect new block")

r := bc.GetReceipt(tx.Hash())
assert.Equalf(t, int64(105087), int64(r.GetGasUsed()), "gas used not equal")
expectedGas := map[int32]int64{3: 105087, 4: 105087}[version]
assert.Equalf(t, expectedGas, int64(r.GetGasUsed()), "gas used not equal")

state, err := bc.GetAccountState("test2")
assert.Equalf(t, int64(2), state.GetBalanceBigInt().Int64(), "balance state not equal")
Expand All @@ -55,7 +56,8 @@ func TestContractSendF(t *testing.T) {
require.NoErrorf(t, err, "failed to connect new block")

r = bc.GetReceipt(tx.Hash())
assert.Equalf(t, int64(105179), int64(r.GetGasUsed()), "gas used not equal")
expectedGas = map[int32]int64{3: 105179, 4: 105755}[version]
assert.Equalf(t, expectedGas, int64(r.GetGasUsed()), "gas used not equal")

state, err = bc.GetAccountState("test2")
assert.Equalf(t, int64(6), state.GetBalanceBigInt().Int64(), "balance state not equal")
Expand Down

0 comments on commit abf8c9c

Please sign in to comment.