diff --git a/x/wasm/keeper/handler_plugin_encoders.go b/x/wasm/keeper/handler_plugin_encoders.go index f4545fca3f..984815cdd7 100644 --- a/x/wasm/keeper/handler_plugin_encoders.go +++ b/x/wasm/keeper/handler_plugin_encoders.go @@ -145,6 +145,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, errorsmod.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 d27d6654f4..c4417f5dba 100644 --- a/x/wasm/keeper/handler_plugin_encoders_test.go +++ b/x/wasm/keeper/handler_plugin_encoders_test.go @@ -383,6 +383,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{