Skip to content

Commit

Permalink
Disable instance lru cache and update gas
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jan 17, 2020
1 parent de89907 commit ec7f996
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x/wasm/internal/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Keeper struct {

// NewKeeper creates a new contract Keeper instance
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, router sdk.Router, homeDir string) Keeper {
wasmer, err := wasm.NewWasmer(filepath.Join(homeDir, "wasm"), 3)
wasmer, err := wasm.NewWasmer(filepath.Join(homeDir, "wasm"), 0)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions x/wasm/internal/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ func TestExecute(t *testing.T) {
diff := time.Now().Sub(start)
require.NoError(t, err)
require.NotNil(t, res)
assert.Equal(t, uint64(118673), res.GasUsed)
assert.Equal(t, uint64(119513), res.GasUsed)

// make sure gas is properly deducted from ctx
gasAfter := ctx.GasMeter().GasConsumed()
require.Equal(t, uint64(31714), gasAfter-gasBefore)
require.Equal(t, uint64(31723), gasAfter-gasBefore)

// ensure bob now exists and got both payments released
bobAcct = accKeeper.GetAccount(ctx, bob)
Expand Down

0 comments on commit ec7f996

Please sign in to comment.