Skip to content

Commit

Permalink
test: fix gas amount
Browse files Browse the repository at this point in the history
  • Loading branch information
kroggen committed Nov 16, 2023
1 parent 55ebee4 commit 2899d84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contract/vm_dummy/vm_dummy_pub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,22 +816,22 @@ func TestContractGasLeft(t *testing.T) {
err = bc.ConnectBlock(tx)
require.NoErrorf(t, err, "failed to connect new block")
receipt := bc.GetReceipt(tx.Hash())
expected := `[{"_bignum":"0"},{"_bignum":"0"},{"_bignum":"0"}]`
expected := `[{"_bignum":"18446744073709548605"},{"_bignum":"18446744073709548172"},{"_bignum":"433"}]`
require.Equalf(t, expected, receipt.GetRet(), "contract call ret error")

tx = NewLuaTxCall("user1", "A", 0, fmt.Sprintf(`{"Name":"test2", "Args":["%s","loop",10]}`, nameToAddress("loop")))
err = bc.ConnectBlock(tx)
require.NoErrorf(t, err, "failed to connect new block")
receipt = bc.GetReceipt(tx.Hash())
expected := `[{"_bignum":"0"},{"_bignum":"0"},{"_bignum":"0"}]`
expected = `[{"_bignum":"18446744073709547285"},{"_bignum":"18446744073709543337"},{"_bignum":"3948"}]`
require.Equalf(t, expected, receipt.GetRet(), "contract call ret error")

// make an external call and a callback, like this: A -> B -> A
tx = NewLuaTxCall("user1", "A", 0, fmt.Sprintf(`{"Name":"test3", "Args":["%s"]}`, nameToAddress("B")))
err = bc.ConnectBlock(tx)
require.NoErrorf(t, err, "failed to connect new block")
receipt = bc.GetReceipt(tx.Hash())
expected := `["0","0","0","0"]`
expected = `["18446744073709548612","18446744073709543257","18446744073709536656","18446744073709535921"]`
require.Equalf(t, expected, receipt.GetRet(), "contract call ret error")

}
Expand Down

0 comments on commit 2899d84

Please sign in to comment.