Skip to content

Commit

Permalink
Remove GetSignBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
0Tech committed Jan 26, 2024
1 parent 0e1c38b commit 87cbf13
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 86 deletions.
18 changes: 0 additions & 18 deletions x/foundation/codec/cdc.go

This file was deleted.

67 changes: 0 additions & 67 deletions x/foundation/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,8 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/Finschia/finschia-sdk/x/foundation/codec"
)

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgUpdateParams) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgFundTreasury) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgWithdrawFromTreasury) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgUpdateMembers) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgUpdateDecisionPolicy) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

func (m MsgUpdateDecisionPolicy) GetDecisionPolicy() DecisionPolicy {
if m.DecisionPolicy == nil {
return nil
Expand Down Expand Up @@ -88,36 +61,6 @@ func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) err
return UnpackInterfaces(unpacker, m.Messages)
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgSubmitProposal) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgWithdrawProposal) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgVote) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgExec) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgLeaveFoundation) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgUpdateCensorship) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

func (m MsgGrant) GetAuthorization() Authorization {
if m.Authorization == nil {
return nil
Expand All @@ -144,13 +87,3 @@ func (m MsgGrant) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
var authorization Authorization
return unpacker.UnpackAny(m.Authorization, &authorization)
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgGrant) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}

// GetSignBytes implements the LegacyMsg.GetSignBytes method.
func (m MsgRevoke) GetSignBytes() []byte {
return sdk.MustSortJSON(codec.ModuleCdc.MustMarshalJSON(&m))
}
2 changes: 1 addition & 1 deletion x/foundation/msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestAminoJSON(t *testing.T) {
}

testCases := map[string]struct {
msg legacytx.LegacyMsg
msg sdk.Msg
expected string
}{
"MsgFundTreasury": {
Expand Down

0 comments on commit 87cbf13

Please sign in to comment.