-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: ConsumerModificationProposal is needed in Gaia upgrade handler #2176
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,16 @@ import ( | |
|
||
const ( | ||
ProposalTypeConsumerAddition = "ConsumerAddition" | ||
ProposalTypeConsumerRemoval = "RemoveConsumer" | ||
ProposalTypeConsumerModification = "UpdateConsumer" | ||
ProposalTypeConsumerRemoval = "ConsumerRemoval" | ||
ProposalTypeConsumerModification = "ConsumerModification" | ||
ProposalTypeEquivocation = "Equivocation" | ||
ProposalTypeChangeRewardDenoms = "ChangeRewardDenoms" | ||
) | ||
|
||
var ( | ||
_ govv1beta1.Content = &ConsumerAdditionProposal{} | ||
_ govv1beta1.Content = &ConsumerRemovalProposal{} | ||
_ govv1beta1.Content = &ConsumerModificationProposal{} | ||
_ govv1beta1.Content = &ChangeRewardDenomsProposal{} | ||
_ govv1beta1.Content = &EquivocationProposal{} | ||
) | ||
|
@@ -239,6 +240,55 @@ func (sccp *ConsumerRemovalProposal) ValidateBasic() error { | |
return nil | ||
} | ||
|
||
// NewConsumerModificationProposal creates a new consumer modification proposal. | ||
func NewConsumerModificationProposal(title, description, chainID string, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add a |
||
topN uint32, | ||
validatorsPowerCap uint32, | ||
validatorSetCap uint32, | ||
allowlist []string, | ||
denylist []string, | ||
minStake uint64, | ||
allowInactiveVals bool, | ||
) govv1beta1.Content { | ||
return &ConsumerModificationProposal{ | ||
Title: title, | ||
Description: description, | ||
ChainId: chainID, | ||
Top_N: topN, | ||
ValidatorsPowerCap: validatorsPowerCap, | ||
ValidatorSetCap: validatorSetCap, | ||
Allowlist: allowlist, | ||
Denylist: denylist, | ||
MinStake: minStake, | ||
AllowInactiveVals: allowInactiveVals, | ||
} | ||
} | ||
|
||
// ProposalRoute returns the routing key of a consumer modification proposal. | ||
func (cccp *ConsumerModificationProposal) ProposalRoute() string { return RouterKey } | ||
|
||
// ProposalType returns the type of the consumer modification proposal. | ||
func (cccp *ConsumerModificationProposal) ProposalType() string { | ||
return ProposalTypeConsumerModification | ||
} | ||
|
||
// ValidateBasic runs basic stateless validity checks | ||
func (cccp *ConsumerModificationProposal) ValidateBasic() error { | ||
if err := govv1beta1.ValidateAbstract(cccp); err != nil { | ||
return err | ||
} | ||
|
||
if strings.TrimSpace(cccp.ChainId) == "" { | ||
return errorsmod.Wrap(ErrInvalidConsumerModificationProposal, "consumer chain id must not be blank") | ||
} | ||
|
||
err := ValidatePSSFeatures(cccp.Top_N, cccp.ValidatorsPowerCap) | ||
if err != nil { | ||
return errorsmod.Wrapf(ErrInvalidConsumerModificationProposal, "invalid PSS features: %s", err.Error()) | ||
} | ||
return nil | ||
} | ||
|
||
// NewEquivocationProposal creates a new equivocation proposal. | ||
// [DEPRECATED]: do not use because equivocations can be submitted | ||
// and verified automatically on the provider. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the rename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reverted the entire file to what's in ICS main.