Skip to content

Commit

Permalink
Update test contract, update gas cost
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Dec 2, 2019
1 parent cd6f0a3 commit d12c434
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/wasm/internal/keeper/keeper_test.go
Expand Up @@ -72,7 +72,7 @@ func TestInstantiate(t *testing.T) {

gasAfter := ctx.GasMeter().GasConsumed()
kvStoreGas := uint64(28757) // calculated by disabling contract gas reduction and running test
require.Equal(t, kvStoreGas+285, gasAfter-gasBefore)
require.Equal(t, kvStoreGas+288, gasAfter-gasBefore)
}

func TestExecute(t *testing.T) {
Expand Down Expand Up @@ -133,12 +133,12 @@ func TestExecute(t *testing.T) {
diff := time.Now().Sub(start)
require.NoError(t, err)
require.NotNil(t, res)
assert.Equal(t, uint64(81891), res.GasUsed)
assert.Equal(t, uint64(81778), res.GasUsed)

// make sure gas is properly deducted from ctx
gasAfter := ctx.GasMeter().GasConsumed()
kvStoreGas := uint64(30321) // calculated by disabling contract gas reduction and running test
require.Equal(t, kvStoreGas+815, gasAfter-gasBefore)
require.Equal(t, kvStoreGas+814, gasAfter-gasBefore)

// ensure bob now exists and got both payments released
bobAcct = accKeeper.GetAccount(ctx, bob)
Expand Down
Binary file modified x/wasm/internal/keeper/testdata/contract.wasm
Binary file not shown.

0 comments on commit d12c434

Please sign in to comment.