-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(x/ecocredit): add back allow denom legacy proposal type (#1595)
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
- Loading branch information
1 parent
9ccfbdf
commit c4c8dad
Showing
5 changed files
with
99 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
x/ecocredit/marketplace/types/v1/msg_allowed_denom_proposal.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package v1 | ||
|
||
import ( | ||
"fmt" | ||
|
||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" | ||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" | ||
) | ||
|
||
var _ govtypes.Content = &AllowDenomProposal{} | ||
|
||
const ( | ||
AllowDenomProposalType = "AllowDenomProposal" | ||
) | ||
|
||
func init() { | ||
govtypes.RegisterProposalType(AllowDenomProposalType) | ||
} | ||
|
||
func (m AllowDenomProposal) ProposalRoute() string { return "ecocredit" } | ||
|
||
func (m AllowDenomProposal) ProposalType() string { return AllowDenomProposalType } | ||
|
||
func (m AllowDenomProposal) ValidateBasic() error { | ||
if m.Denom == nil { | ||
return sdkerrors.ErrInvalidRequest.Wrap("denom cannot be empty") | ||
} | ||
if err := m.Denom.Validate(); err != nil { | ||
return err | ||
} | ||
return govtypes.ValidateAbstract(&m) | ||
} | ||
|
||
func (m AllowDenomProposal) String() string { | ||
return fmt.Sprintf(`Allow Denom Proposal: | ||
Title: %s | ||
Description: %s | ||
Allowed Denom: %v | ||
`, m.Title, m.Description, m.Denom) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.