-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat: deprecate x/params usage in x/distr #12434
Conversation
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.
Nice work!!!
@@ -18,6 +18,9 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { | |||
legacy.RegisterAminoMsg(cdc, &MsgWithdrawValidatorCommission{}, "cosmos-sdk/MsgWithdrawValCommission") | |||
legacy.RegisterAminoMsg(cdc, &MsgSetWithdrawAddress{}, "cosmos-sdk/MsgModifyWithdrawAddress") | |||
legacy.RegisterAminoMsg(cdc, &MsgFundCommunityPool{}, "cosmos-sdk/MsgFundCommunityPool") | |||
legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/distribution/MsgUpdateParams") |
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.
had to register it with cosmos-sdk/distribution/MsgUpdateParams
, because len of cosmos-sdk/x/distribution/MsgUpdateParams
is exceeding 40.
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.
Nice, looks good overall!
authKeeper: ak, | ||
bankKeeper: bk, | ||
stakingKeeper: sk, | ||
feeCollectorName: feeCollectorName, | ||
authority: authority, |
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.
should we also check that authority is a well-defined address?
return params | ||
} | ||
|
||
// SetParams sets the distribution parameters to the param space. | ||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { | ||
k.paramSpace.SetParamSet(ctx, ¶ms) | ||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { |
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'd say let's add an API-breaking change on the keeper method?
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.
WDYM exactly? The API doesn't change -- only the storage and management mechanics.
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.
there's a new error
return arg
@@ -42,6 +42,8 @@ const ( | |||
// - 0x07<valAddrLen (1 Byte)><valAddr_Bytes>: ValidatorCurrentCommission | |||
// | |||
// - 0x08<valAddrLen (1 Byte)><valAddr_Bytes><height>: ValidatorSlashEvent | |||
// | |||
// - 0x09: Params |
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.
should we update the SPEC in this PR, or is that tracked separately?
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.
Please yes :)
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.
🚀
return params | ||
} | ||
|
||
// SetParams sets the distribution parameters to the param space. | ||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { | ||
k.paramSpace.SetParamSet(ctx, ¶ms) | ||
func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { |
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.
WDYM exactly? The API doesn't change -- only the storage and management mechanics.
@@ -120,3 +120,12 @@ func (k Keeper) initializeDelegation(ctx sdk.Context, val sdk.ValAddress, del sd | |||
k.SetDelegatorStartingInfo(ctx, val, del, types.NewDelegatorStartingInfo(previousPeriod, stake, uint64(ctx.BlockHeight()))) | |||
} | |||
``` | |||
|
|||
## MsgUpdateParams |
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.
## MsgUpdateParams | |
## MsgUpdateParams | |
Description
Closes: #12287
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change