Skip to content

Commit

Permalink
Merge pull request #201 from CosmWasm/polish_handler
Browse files Browse the repository at this point in the history
Polish types in message handler
  • Loading branch information
ethanfrey committed Jul 20, 2020
2 parents 02a54d3 + 437f023 commit 45ef2f3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions x/wasm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,16 @@ func NewHandler(k Keeper) sdk.Handler {
switch msg := msg.(type) {
case MsgStoreCode:
return handleStoreCode(ctx, k, &msg)
case *MsgStoreCode:
return handleStoreCode(ctx, k, msg)

case MsgInstantiateContract:
return handleInstantiate(ctx, k, &msg)
case *MsgInstantiateContract:
return handleInstantiate(ctx, k, msg)

case MsgExecuteContract:
return handleExecute(ctx, k, &msg)
case *MsgExecuteContract:
return handleExecute(ctx, k, msg)

case *MsgMigrateContract:
return handleMigration(ctx, k, msg)
case MsgMigrateContract:
return handleMigration(ctx, k, &msg)

case *MsgUpdateAdmin:
return handleUpdateContractAdmin(ctx, k, msg)
case MsgUpdateAdmin:
return handleUpdateContractAdmin(ctx, k, &msg)

case *MsgClearAdmin:
return handleClearContractAdmin(ctx, k, msg)
case MsgClearAdmin:
return handleClearContractAdmin(ctx, k, &msg)

default:
errMsg := fmt.Sprintf("unrecognized wasm message type: %T", msg)
return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func TestHandleExecuteEscrow(t *testing.T) {
Sender: creator,
WASMByteCode: testContract,
}
res, err := h(data.ctx, &msg)
res, err := h(data.ctx, msg)
require.NoError(t, err)
require.Equal(t, res.Data, []byte("1"))

Expand Down

0 comments on commit 45ef2f3

Please sign in to comment.