diff --git a/x/lifecycle-hooks/types/codec.go b/x/lifecycle-hooks/types/codec.go index 844157a..8217e0d 100644 --- a/x/lifecycle-hooks/types/codec.go +++ b/x/lifecycle-hooks/types/codec.go @@ -3,6 +3,9 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + // this line is used by starport scaffolding # 1 "github.com/cosmos/cosmos-sdk/types/msgservice" ) @@ -13,6 +16,16 @@ func RegisterCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgFundExistentContract{}, + ) + + registry.RegisterImplementations((*govtypes.Content)(nil), + &MsgUpdateParamsProposal{}, + &MsgRegisterContractProposal{}, + &MsgModifyContractProposal{}, + &MsgRemoveContractProposal{}, + ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/lifecycle-hooks/types/gov.go b/x/lifecycle-hooks/types/gov.go index 69cb31f..746551d 100644 --- a/x/lifecycle-hooks/types/gov.go +++ b/x/lifecycle-hooks/types/gov.go @@ -17,6 +17,11 @@ var ( _ govtypes.Content = &MsgRegisterContractProposal{} _ govtypes.Content = &MsgModifyContractProposal{} _ govtypes.Content = &MsgRemoveContractProposal{} + + _ sdk.Msg = &MsgUpdateParamsProposal{} + _ sdk.Msg = &MsgRegisterContractProposal{} + _ sdk.Msg = &MsgModifyContractProposal{} + _ sdk.Msg = &MsgRemoveContractProposal{} ) func init() { @@ -43,6 +48,16 @@ func NewMsgCreateAllianceProposal( }, } } +func (m MsgUpdateParamsProposal) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} +func (m MsgUpdateParamsProposal) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + panic(ErrorInvalidSigner) + } + return []sdk.AccAddress{signer} +} func (m *MsgUpdateParamsProposal) ProposalRoute() string { return RouterKey } func (m *MsgUpdateParamsProposal) ProposalType() string { return UpdateParamsProposalType } func (m *MsgUpdateParamsProposal) ValidateBasic() error { @@ -78,6 +93,16 @@ func NewMsgRegisterContractProposal( ExecutionBlocksFrequency: executionBlocksFrequency, } } +func (m MsgRegisterContractProposal) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} +func (m MsgRegisterContractProposal) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + panic(ErrorInvalidSigner) + } + return []sdk.AccAddress{signer} +} func (m *MsgRegisterContractProposal) ProposalRoute() string { return RouterKey } func (m *MsgRegisterContractProposal) ProposalType() string { return UpdateParamsProposalType } func (m *MsgRegisterContractProposal) ValidateBasic() error { @@ -112,6 +137,16 @@ func NewMsgModifyContractProposal( ExecutionBlocksFrequency: executionBlocksFrequency, } } +func (m MsgModifyContractProposal) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} +func (m MsgModifyContractProposal) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + panic(ErrorInvalidSigner) + } + return []sdk.AccAddress{signer} +} func (m *MsgModifyContractProposal) ProposalRoute() string { return RouterKey } func (m *MsgModifyContractProposal) ProposalType() string { return UpdateParamsProposalType } func (m *MsgModifyContractProposal) ValidateBasic() error { @@ -143,6 +178,16 @@ func NewMsgRemoveContractProposal( DepositRefundAccount: depositRefundAccount, } } +func (m MsgRemoveContractProposal) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} +func (m MsgRemoveContractProposal) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(m.Authority) + if err != nil { + panic(ErrorInvalidSigner) + } + return []sdk.AccAddress{signer} +} func (m *MsgRemoveContractProposal) ProposalRoute() string { return RouterKey } func (m *MsgRemoveContractProposal) ProposalType() string { return UpdateParamsProposalType } func (m *MsgRemoveContractProposal) ValidateBasic() error {