Skip to content

Commit

Permalink
Refactor wasm message handlers and query plugin (#460)
Browse files Browse the repository at this point in the history
* Refactor wasm message handlers

* Add handler plugin tests

* Review feedback

* Add handler and query tests
  • Loading branch information
alpe committed Mar 18, 2021
1 parent 356d786 commit 8e35dc2
Show file tree
Hide file tree
Showing 29 changed files with 1,616 additions and 958 deletions.
2 changes: 0 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ func NewWasmApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest b
wasmDir,
wasmConfig,
supportedFeatures,
nil,
nil,
wasmOpts...,
)

Expand Down
2 changes: 1 addition & 1 deletion x/wasm/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ type (
Config = types.WasmConfig
ContractInfoWithAddress = types.ContractInfoWithAddress
CodeInfoResponse = types.CodeInfoResponse
MessageHandler = keeper.DefaultMessageHandler
MessageHandler = keeper.SDKMessageHandler
BankEncoder = keeper.BankEncoder
CustomEncoder = keeper.CustomEncoder
StakingEncoder = keeper.StakingEncoder
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/internal/keeper/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func BenchmarkExecution(b *testing.B) {
for name, spec := range specs {
b.Run(name, func(b *testing.B) {
wasmConfig := types.WasmConfig{MemoryCacheSize: 0}
ctx, keepers := createTestInput(b, false, SupportedFeatures, nil, nil, wasmConfig, spec.db())
ctx, keepers := createTestInput(b, false, SupportedFeatures, wasmConfig, spec.db())
example := InstantiateHackatomExampleContract(b, ctx, keepers)
if spec.pinned {
require.NoError(b, keepers.WasmKeeper.PinCode(ctx, example.CodeID))
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/internal/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) {
wasmConfig := wasmTypes.DefaultWasmConfig()
pk := paramskeeper.NewKeeper(encodingConfig.Marshaler, encodingConfig.Amino, keyParams, tkeyParams)

srcKeeper := NewKeeper(encodingConfig.Marshaler, keyWasm, pk.Subspace(wasmTypes.DefaultParamspace), authkeeper.AccountKeeper{}, nil, stakingkeeper.Keeper{}, distributionkeeper.Keeper{}, nil, nil, nil, nil, nil, tempDir, wasmConfig, SupportedFeatures, nil, nil)
srcKeeper := NewKeeper(encodingConfig.Marshaler, keyWasm, pk.Subspace(wasmTypes.DefaultParamspace), authkeeper.AccountKeeper{}, nil, stakingkeeper.Keeper{}, distributionkeeper.Keeper{}, nil, nil, nil, nil, nil, tempDir, wasmConfig, SupportedFeatures)
return &srcKeeper, ctx, []sdk.StoreKey{keyWasm, keyParams}
}

Expand Down
Loading

0 comments on commit 8e35dc2

Please sign in to comment.