- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #678 from UnUniFi/backward-proposal
feat: backward-proposal
Showing
4 changed files
with
527 additions
and
35 deletions.
There are no files selected for viewing
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
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,45 @@ | ||
package types | ||
|
||
import ( | ||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" | ||
) | ||
|
||
const ( | ||
// ProposalTypeAddStrategy defines the type for a ProposalAddStrategy | ||
ProposalTypeAddStrategy = "AddStrategy" | ||
) | ||
|
||
func init() { | ||
govtypes.RegisterProposalType(ProposalTypeAddStrategy) | ||
} | ||
|
||
// Assert ProposalAddStrategy implements govtypes.Content at compile-time | ||
var _ govtypes.Content = &ProposalAddStrategy{} | ||
|
||
// Deprecated: Just for backward compatibility | ||
func NewProposalAddStrategy(title, description string, denom, contractAddr, name, gitUrl string) *ProposalAddStrategy { | ||
return &ProposalAddStrategy{ | ||
Title: title, | ||
Description: description, | ||
Denom: denom, | ||
ContractAddress: contractAddr, | ||
Name: name, | ||
GitUrl: gitUrl, | ||
} | ||
} | ||
|
||
// ProposalRoute returns the routing key of a parameter change proposal. | ||
func (p *ProposalAddStrategy) ProposalRoute() string { return RouterKey } | ||
|
||
// ProposalType returns the type of a parameter change proposal. | ||
func (p *ProposalAddStrategy) ProposalType() string { return ProposalTypeAddStrategy } | ||
|
||
// ValidateBasic validates the parameter change proposal | ||
func (p *ProposalAddStrategy) ValidateBasic() error { | ||
err := govtypes.ValidateAbstract(p) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.