diff --git a/x/wasm/keeper/handler_plugin_encoders.go b/x/wasm/keeper/handler_plugin_encoders.go index d41d8f1012..4f19dd0617 100644 --- a/x/wasm/keeper/handler_plugin_encoders.go +++ b/x/wasm/keeper/handler_plugin_encoders.go @@ -143,6 +143,16 @@ func EncodeDistributionMsg(sender sdk.AccAddress, msg *wasmvmtypes.DistributionM ValidatorAddress: msg.WithdrawDelegatorReward.Validator, } return []sdk.Msg{&withdrawMsg}, nil + case msg.FundCommunityPool != nil: + amt, err := ConvertWasmCoinsToSdkCoins(msg.FundCommunityPool.Amount) + if err != nil { + return nil, err + } + fundMsg := distributiontypes.MsgFundCommunityPool{ + Depositor: sender.String(), + Amount: amt, + } + return []sdk.Msg{&fundMsg}, nil default: return nil, sdkerrors.Wrap(types.ErrUnknownMsg, "unknown variant of Distribution") } diff --git a/x/wasm/keeper/handler_plugin_encoders_test.go b/x/wasm/keeper/handler_plugin_encoders_test.go index 60b66fbc0d..e04d31d757 100644 --- a/x/wasm/keeper/handler_plugin_encoders_test.go +++ b/x/wasm/keeper/handler_plugin_encoders_test.go @@ -382,6 +382,28 @@ func TestEncoding(t *testing.T) { }, }, }, + "distribution fund community pool": { + sender: addr1, + srcMsg: wasmvmtypes.CosmosMsg{ + Distribution: &wasmvmtypes.DistributionMsg{ + FundCommunityPool: &wasmvmtypes.FundCommunityPoolMsg{ + Amount: wasmvmtypes.Coins{ + wasmvmtypes.NewCoin(200, "stones"), + wasmvmtypes.NewCoin(200, "feathers"), + }, + }, + }, + }, + output: []sdk.Msg{ + &distributiontypes.MsgFundCommunityPool{ + Depositor: addr1.String(), + Amount: sdk.NewCoins( + sdk.NewInt64Coin("stones", 200), + sdk.NewInt64Coin("feathers", 200), + ), + }, + }, + }, "stargate encoded bank msg": { sender: addr2, srcMsg: wasmvmtypes.CosmosMsg{