-
Notifications
You must be signed in to change notification settings - Fork 62
[CHORE] sync with master v1.58.2 #329
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
Changes from all commits
9ccb3b7
258341a
97aaaf4
9f908d1
53c94ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -261,7 +261,6 @@ func (msg *MsgUpdateDerivativeMarket) ValidateBasic() error { | |||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if msg.HasInitialMarginRatioUpdate() && msg.HasMaintenanceMarginRatioUpdate() { | ||||||||||||||||||||||||
| if msg.NewInitialMarginRatio.LTE(msg.NewMaintenanceMarginRatio) { | ||||||||||||||||||||||||
| return types.ErrMarginsRelation | ||||||||||||||||||||||||
|
|
@@ -2607,3 +2606,35 @@ func hasDuplicatesOrder(slice []*OrderData) bool { | |||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| return false | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| func (msg *MsgSetDelegationTransferReceivers) Route() string { return RouterKey } | ||||||||||||||||||||||||
| func (msg *MsgSetDelegationTransferReceivers) Type() string { return "setDelegationTransferReceivers" } | ||||||||||||||||||||||||
| func (msg *MsgSetDelegationTransferReceivers) ValidateBasic() error { | ||||||||||||||||||||||||
| if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { | ||||||||||||||||||||||||
| return errors.Wrap(sdkerrors.ErrInvalidAddress, msg.Sender) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if len(msg.Receivers) == 0 { | ||||||||||||||||||||||||
| return errors.Wrap(sdkerrors.ErrInvalidRequest, "receivers list cannot be empty") | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| for _, receiver := range msg.Receivers { | ||||||||||||||||||||||||
| if _, err := sdk.AccAddressFromBech32(receiver); err != nil { | ||||||||||||||||||||||||
| return errors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid receiver address: %s", receiver) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| return nil | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| func (msg *MsgSetDelegationTransferReceivers) GetSignBytes() []byte { | ||||||||||||||||||||||||
| bz, _ := json.Marshal(msg) | ||||||||||||||||||||||||
| return sdk.MustSortJSON(bz) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+2630
to
+2633
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. 🛠️ Refactor suggestion Use ModuleCdc for GetSignBytes to preserve JSON encoding consistency Other messages use types.ModuleCdc.MustMarshalJSON for signing bytes. Using encoding/json directly can diverge if custom marshalling is introduced. Apply this diff: -func (msg *MsgSetDelegationTransferReceivers) GetSignBytes() []byte {
- bz, _ := json.Marshal(msg)
- return sdk.MustSortJSON(bz)
-}
+func (msg *MsgSetDelegationTransferReceivers) GetSignBytes() []byte {
+ return sdk.MustSortJSON(types.ModuleCdc.MustMarshalJSON(msg))
+}🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| func (msg *MsgSetDelegationTransferReceivers) GetSigners() []sdk.AccAddress { | ||||||||||||||||||||||||
| sender, _ := sdk.AccAddressFromBech32(msg.Sender) | ||||||||||||||||||||||||
| return []sdk.AccAddress{sender} | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+2635
to
+2638
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. Don’t ignore bech32 parse errors in GetSigners; panic like the rest of the codebase GetSigners is called prior to ValidateBasic during tx ante-handling. Ignoring the error here may return a nil signer and lead to subtle failures. Match the established pattern and panic on invalid sender. Apply this diff: -func (msg *MsgSetDelegationTransferReceivers) GetSigners() []sdk.AccAddress {
- sender, _ := sdk.AccAddressFromBech32(msg.Sender)
- return []sdk.AccAddress{sender}
-}
+func (msg *MsgSetDelegationTransferReceivers) GetSigners() []sdk.AccAddress {
+ sender, err := sdk.AccAddressFromBech32(msg.Sender)
+ if err != nil {
+ panic(err)
+ }
+ return []sdk.AccAddress{sender}
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| var _ sdk.Msg = &MsgSetDelegationTransferReceivers{} | ||||||||||||||||||||||||
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.
💡 Verification agent
🧩 Analysis chain
Interface addition is source-breaking for implementers; call out/update mocks
Adding SetDelegationTransferReceiver requires downstream implementers/mocks of StakingKeeper to add this method. Please call this out in release notes and update any local mocks/tests accordingly.
To find potential implementers/mocks that need updates (in this repo):
🏁 Script executed:
Length of output: 167
Call out interface addition breaking change in release notes
We’ve added
SetDelegationTransferReceiver(ctx context.Context, receiver sdk.AccAddress)to theStakingKeeperinterface—a source-breaking change for any downstream implementers or mocks. A search revealed no local implementations or mocks ofStakingKeeperin this repo, but consumers must:SetDelegationTransferReceiverto their ownStakingKeeperimplementationsPlease document this change in the release notes so integrators can update their code accordingly.
🤖 Prompt for AI Agents