github.com/cosmos/cosmos-sdk@v0.50.10/x/distribution/types/msg.go (about) 1 package types 2 3 import ( 4 sdk "github.com/cosmos/cosmos-sdk/types" 5 ) 6 7 // Verify interface at compile time 8 var ( 9 _ sdk.Msg = (*MsgSetWithdrawAddress)(nil) 10 _ sdk.Msg = (*MsgWithdrawDelegatorReward)(nil) 11 _ sdk.Msg = (*MsgWithdrawValidatorCommission)(nil) 12 _ sdk.Msg = (*MsgUpdateParams)(nil) 13 _ sdk.Msg = (*MsgCommunityPoolSpend)(nil) 14 _ sdk.Msg = (*MsgDepositValidatorRewardsPool)(nil) 15 ) 16 17 func NewMsgSetWithdrawAddress(delAddr, withdrawAddr sdk.AccAddress) *MsgSetWithdrawAddress { 18 return &MsgSetWithdrawAddress{ 19 DelegatorAddress: delAddr.String(), 20 WithdrawAddress: withdrawAddr.String(), 21 } 22 } 23 24 func NewMsgWithdrawDelegatorReward(delAddr, valAddr string) *MsgWithdrawDelegatorReward { 25 return &MsgWithdrawDelegatorReward{ 26 DelegatorAddress: delAddr, 27 ValidatorAddress: valAddr, 28 } 29 } 30 31 func NewMsgWithdrawValidatorCommission(valAddr string) *MsgWithdrawValidatorCommission { 32 return &MsgWithdrawValidatorCommission{ 33 ValidatorAddress: valAddr, 34 } 35 } 36 37 // NewMsgFundCommunityPool returns a new MsgFundCommunityPool with a sender and 38 // a funding amount. 39 func NewMsgFundCommunityPool(amount sdk.Coins, depositor string) *MsgFundCommunityPool { 40 return &MsgFundCommunityPool{ 41 Amount: amount, 42 Depositor: depositor, 43 } 44 } 45 46 // NewMsgDepositValidatorRewardsPool returns a new MsgDepositValidatorRewardsPool 47 // with a depositor and a funding amount. 48 func NewMsgDepositValidatorRewardsPool(depositor, valAddr string, amount sdk.Coins) *MsgDepositValidatorRewardsPool { 49 return &MsgDepositValidatorRewardsPool{ 50 Amount: amount, 51 Depositor: depositor, 52 ValidatorAddress: valAddr, 53 } 54 }