From 486a797ed7d97ae8d8026c810be133d740cbe6fe Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Tue, 26 Nov 2019 18:44:03 +0100 Subject: [PATCH 1/5] add json tag to MsgEditValidator; closes #5336 --- x/staking/legacy/v0_36/types.go | 3 +- x/staking/legacy/v0_38/types.go | 2 +- x/staking/types/msg.go | 72 ++++++++++++++++++++++----------- 3 files changed, 51 insertions(+), 26 deletions(-) diff --git a/x/staking/legacy/v0_36/types.go b/x/staking/legacy/v0_36/types.go index b5edcc04864c..1e0ff71bd8f8 100644 --- a/x/staking/legacy/v0_36/types.go +++ b/x/staking/legacy/v0_36/types.go @@ -5,10 +5,11 @@ package v0_36 import ( "time" + "github.com/tendermint/tendermint/crypto" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" v034staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v0_34" - "github.com/tendermint/tendermint/crypto" ) const ( diff --git a/x/staking/legacy/v0_38/types.go b/x/staking/legacy/v0_38/types.go index 3b21d8f9cc0b..88bce2c5c505 100644 --- a/x/staking/legacy/v0_38/types.go +++ b/x/staking/legacy/v0_38/types.go @@ -5,9 +5,9 @@ package v0_38 import ( "time" - "github.com/cosmos/cosmos-sdk/codec" "github.com/tendermint/tendermint/crypto" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" v034staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v0_34" v036staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v0_36" diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index 6be3587865da..980b401458bf 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -42,7 +42,8 @@ type msgCreateValidatorJSON struct { Value sdk.Coin `json:"value" yaml:"value"` } -// Default way to create validator. Delegator address and validator address are the same +// NewMsgCreateValidator creates a new MsgCreateValidator instance. +// Delegator address and validator address are the same func NewMsgCreateValidator( valAddr sdk.ValAddress, pubKey crypto.PubKey, selfDelegation sdk.Coin, description Description, commission CommissionRates, minSelfDelegation sdk.Int, @@ -59,18 +60,21 @@ func NewMsgCreateValidator( } } -//nolint +// Route implements the sdk.Msg interface func (msg MsgCreateValidator) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface func (msg MsgCreateValidator) Type() string { return "create_validator" } -// Return address(es) that must sign over msg.GetSignBytes() +// GetSigners implements the sdk.Msg interface. It returns the address(es) that +// must sign over msg.GetSignBytes(). +// If the validator address is not same as delegator's, then the validator must +// sign the msg as well. func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress { // delegator is first signer so delegator pays fees addrs := []sdk.AccAddress{msg.DelegatorAddress} if !bytes.Equal(msg.DelegatorAddress.Bytes(), msg.ValidatorAddress.Bytes()) { - // if validator addr is not same as delegator addr, validator must sign - // msg as well addrs = append(addrs, sdk.AccAddress(msg.ValidatorAddress)) } return addrs @@ -113,7 +117,7 @@ func (msg *MsgCreateValidator) UnmarshalJSON(bz []byte) error { return nil } -// custom marshal yaml function due to consensus pubkey +// MarshalYAML implements a custom marshal yaml function due to consensus pubkey func (msg MsgCreateValidator) MarshalYAML() (interface{}, error) { bs, err := yaml.Marshal(struct { Description Description @@ -146,7 +150,7 @@ func (msg MsgCreateValidator) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// quick validity check +// ValidateBasic implements the sdk.Msg interface func (msg MsgCreateValidator) ValidateBasic() sdk.Error { // note that unmarshaling from bech32 ensures either empty or valid if msg.DelegatorAddress.Empty() { @@ -182,7 +186,7 @@ func (msg MsgCreateValidator) ValidateBasic() sdk.Error { // MsgEditValidator - struct for editing a validator type MsgEditValidator struct { - Description + Description Description `json:"description" yaml:"description"` ValidatorAddress sdk.ValAddress `json:"address" yaml:"address"` // We pass a reference to the new commission rate and min self delegation as it's not mandatory to @@ -194,6 +198,7 @@ type MsgEditValidator struct { MinSelfDelegation *sdk.Int `json:"min_self_delegation" yaml:"min_self_delegation"` } +// NewMsgEditValidator creates a new MsgEditValidator instance func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRate *sdk.Dec, newMinSelfDelegation *sdk.Int) MsgEditValidator { return MsgEditValidator{ Description: description, @@ -203,20 +208,24 @@ func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRat } } -//nolint +// Route implements the sdk.Msg interface func (msg MsgEditValidator) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface func (msg MsgEditValidator) Type() string { return "edit_validator" } + +// GetSigners implements the sdk.Msg interface func (msg MsgEditValidator) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sdk.AccAddress(msg.ValidatorAddress)} } -// get the bytes for the message signer to sign on +// GetSignBytes implements the sdk.Msg interface func (msg MsgEditValidator) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -// quick validity check +// ValidateBasic implements the sdk.Msg interface func (msg MsgEditValidator) ValidateBasic() sdk.Error { if msg.ValidatorAddress.Empty() { return sdk.NewError(DefaultCodespace, CodeInvalidInput, "nil validator address") @@ -246,6 +255,7 @@ type MsgDelegate struct { Amount sdk.Coin `json:"amount" yaml:"amount"` } +// NewMsgDelegate creates a new MsgDelegate instance func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) MsgDelegate { return MsgDelegate{ DelegatorAddress: delAddr, @@ -254,20 +264,24 @@ func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.C } } -//nolint +// Route implements the sdk.Msg interface func (msg MsgDelegate) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface func (msg MsgDelegate) Type() string { return "delegate" } + +// GetSigners implements the sdk.Msg interface func (msg MsgDelegate) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.DelegatorAddress} } -// get the bytes for the message signer to sign on +// GetSignBytes implements the sdk.Msg interface func (msg MsgDelegate) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -// quick validity check +// ValidateBasic implements the sdk.Msg interface func (msg MsgDelegate) ValidateBasic() sdk.Error { if msg.DelegatorAddress.Empty() { return ErrNilDelegatorAddr(DefaultCodespace) @@ -283,7 +297,7 @@ func (msg MsgDelegate) ValidateBasic() sdk.Error { //______________________________________________________________________ -// MsgDelegate - struct for bonding transactions +// MsgBeginRedelegate - struct for bonding transactions type MsgBeginRedelegate struct { DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"` ValidatorSrcAddress sdk.ValAddress `json:"validator_src_address" yaml:"validator_src_address"` @@ -291,9 +305,10 @@ type MsgBeginRedelegate struct { Amount sdk.Coin `json:"amount" yaml:"amount"` } -func NewMsgBeginRedelegate(delAddr sdk.AccAddress, valSrcAddr, - valDstAddr sdk.ValAddress, amount sdk.Coin) MsgBeginRedelegate { - +// NewMsgBeginRedelegate creates a new MsgBeginRedelegate instance +func NewMsgBeginRedelegate( + delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, amount sdk.Coin, + ) MsgBeginRedelegate { return MsgBeginRedelegate{ DelegatorAddress: delAddr, ValidatorSrcAddress: valSrcAddr, @@ -302,20 +317,24 @@ func NewMsgBeginRedelegate(delAddr sdk.AccAddress, valSrcAddr, } } -//nolint +// Route implements the sdk.Msg interface func (msg MsgBeginRedelegate) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface func (msg MsgBeginRedelegate) Type() string { return "begin_redelegate" } + +// GetSigners implements the sdk.Msg interface func (msg MsgBeginRedelegate) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.DelegatorAddress} } -// get the bytes for the message signer to sign on +// GetSignBytes implements the sdk.Msg interface func (msg MsgBeginRedelegate) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -// quick validity check +// ValidateBasic implements the sdk.Msg interface func (msg MsgBeginRedelegate) ValidateBasic() sdk.Error { if msg.DelegatorAddress.Empty() { return ErrNilDelegatorAddr(DefaultCodespace) @@ -339,6 +358,7 @@ type MsgUndelegate struct { Amount sdk.Coin `json:"amount" yaml:"amount"` } +// NewMsgUndelegate creates a new MsgUndelegate instance func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) MsgUndelegate { return MsgUndelegate{ DelegatorAddress: delAddr, @@ -347,18 +367,22 @@ func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk } } -//nolint +// Route implements the sdk.Msg interface func (msg MsgUndelegate) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface func (msg MsgUndelegate) Type() string { return "begin_unbonding" } + +// GetSigners implements the sdk.Msg interface func (msg MsgUndelegate) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.DelegatorAddress} } -// get the bytes for the message signer to sign on +// GetSignBytes implements the sdk.Msg interface func (msg MsgUndelegate) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -// quick validity check +// ValidateBasic implements the sdk.Msg interface func (msg MsgUndelegate) ValidateBasic() sdk.Error { if msg.DelegatorAddress.Empty() { return ErrNilDelegatorAddr(DefaultCodespace) From 21d768bba6bfeda8931c3d99f5bae5fb93e27c1f Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Tue, 26 Nov 2019 18:46:31 +0100 Subject: [PATCH 2/5] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc3a700d4213..1eee4c157b08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,7 @@ if the provided arguments are invalid. * (rest) [\#4783](https://github.com/cosmos/cosmos-sdk/issues/4783) The balance field in the DelegationResponse type is now sdk.Coin instead of sdk.Int * (x/auth) [\#5006](https://github.com/cosmos/cosmos-sdk/pull/5006) The gas required to pass the `AnteHandler` has increased significantly due to modular `AnteHandler` support. Increase GasLimit accordingly. +* (rest) [\#5336](https://github.com/cosmos/cosmos-sdk/issues/5336) `MsgEditValidator` uses `delegator` instead of `Delegator` as a JSON key. ### Features From a64cc557a1913d3bdef7fd295cd7f96ded3cd8c3 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Mon, 2 Dec 2019 16:37:00 +0100 Subject: [PATCH 3/5] Apply suggestions from code review Co-Authored-By: Alessio Treglia --- x/staking/types/msg.go | 54 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index 980b401458bf..f01333461e57 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -43,7 +43,7 @@ type msgCreateValidatorJSON struct { } // NewMsgCreateValidator creates a new MsgCreateValidator instance. -// Delegator address and validator address are the same +// Delegator address and validator address are the same. func NewMsgCreateValidator( valAddr sdk.ValAddress, pubKey crypto.PubKey, selfDelegation sdk.Coin, description Description, commission CommissionRates, minSelfDelegation sdk.Int, @@ -60,10 +60,10 @@ func NewMsgCreateValidator( } } -// Route implements the sdk.Msg interface +// Route implements the sdk.Msg interface. func (msg MsgCreateValidator) Route() string { return RouterKey } -// Type implements the sdk.Msg interface +// Type implements the sdk.Msg interface. func (msg MsgCreateValidator) Type() string { return "create_validator" } // GetSigners implements the sdk.Msg interface. It returns the address(es) that @@ -117,7 +117,7 @@ func (msg *MsgCreateValidator) UnmarshalJSON(bz []byte) error { return nil } -// MarshalYAML implements a custom marshal yaml function due to consensus pubkey +// MarshalYAML implements a custom marshal yaml function due to consensus pubkey. func (msg MsgCreateValidator) MarshalYAML() (interface{}, error) { bs, err := yaml.Marshal(struct { Description Description @@ -150,7 +150,7 @@ func (msg MsgCreateValidator) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// ValidateBasic implements the sdk.Msg interface +// ValidateBasic implements the sdk.Msg interface. func (msg MsgCreateValidator) ValidateBasic() sdk.Error { // note that unmarshaling from bech32 ensures either empty or valid if msg.DelegatorAddress.Empty() { @@ -208,24 +208,24 @@ func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRat } } -// Route implements the sdk.Msg interface +// Route implements the sdk.Msg interface. func (msg MsgEditValidator) Route() string { return RouterKey } -// Type implements the sdk.Msg interface +// Type implements the sdk.Msg interface. func (msg MsgEditValidator) Type() string { return "edit_validator" } -// GetSigners implements the sdk.Msg interface +// GetSigners implements the sdk.Msg interface. func (msg MsgEditValidator) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{sdk.AccAddress(msg.ValidatorAddress)} } -// GetSignBytes implements the sdk.Msg interface +// GetSignBytes implements the sdk.Msg interface. func (msg MsgEditValidator) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -// ValidateBasic implements the sdk.Msg interface +// ValidateBasic implements the sdk.Msg interface. func (msg MsgEditValidator) ValidateBasic() sdk.Error { if msg.ValidatorAddress.Empty() { return sdk.NewError(DefaultCodespace, CodeInvalidInput, "nil validator address") @@ -255,7 +255,7 @@ type MsgDelegate struct { Amount sdk.Coin `json:"amount" yaml:"amount"` } -// NewMsgDelegate creates a new MsgDelegate instance +// NewMsgDelegate creates a new MsgDelegate instance. func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) MsgDelegate { return MsgDelegate{ DelegatorAddress: delAddr, @@ -264,24 +264,24 @@ func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.C } } -// Route implements the sdk.Msg interface +// Route implements the sdk.Msg interface. func (msg MsgDelegate) Route() string { return RouterKey } -// Type implements the sdk.Msg interface +// Type implements the sdk.Msg interface. func (msg MsgDelegate) Type() string { return "delegate" } -// GetSigners implements the sdk.Msg interface +// GetSigners implements the sdk.Msg interface. func (msg MsgDelegate) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.DelegatorAddress} } -// GetSignBytes implements the sdk.Msg interface +// GetSignBytes implements the sdk.Msg interface. func (msg MsgDelegate) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -// ValidateBasic implements the sdk.Msg interface +// ValidateBasic implements the sdk.Msg interface. func (msg MsgDelegate) ValidateBasic() sdk.Error { if msg.DelegatorAddress.Empty() { return ErrNilDelegatorAddr(DefaultCodespace) @@ -297,7 +297,7 @@ func (msg MsgDelegate) ValidateBasic() sdk.Error { //______________________________________________________________________ -// MsgBeginRedelegate - struct for bonding transactions +// MsgBeginRedelegate defines the attributes of a bonding transaction. type MsgBeginRedelegate struct { DelegatorAddress sdk.AccAddress `json:"delegator_address" yaml:"delegator_address"` ValidatorSrcAddress sdk.ValAddress `json:"validator_src_address" yaml:"validator_src_address"` @@ -305,7 +305,7 @@ type MsgBeginRedelegate struct { Amount sdk.Coin `json:"amount" yaml:"amount"` } -// NewMsgBeginRedelegate creates a new MsgBeginRedelegate instance +// NewMsgBeginRedelegate creates a new MsgBeginRedelegate instance. func NewMsgBeginRedelegate( delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, amount sdk.Coin, ) MsgBeginRedelegate { @@ -317,7 +317,7 @@ func NewMsgBeginRedelegate( } } -// Route implements the sdk.Msg interface +// Route implements the sdk.Msg interface. func (msg MsgBeginRedelegate) Route() string { return RouterKey } // Type implements the sdk.Msg interface @@ -328,13 +328,13 @@ func (msg MsgBeginRedelegate) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.DelegatorAddress} } -// GetSignBytes implements the sdk.Msg interface +// GetSignBytes implements the sdk.Msg interface. func (msg MsgBeginRedelegate) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -// ValidateBasic implements the sdk.Msg interface +// ValidateBasic implements the sdk.Msg interface. func (msg MsgBeginRedelegate) ValidateBasic() sdk.Error { if msg.DelegatorAddress.Empty() { return ErrNilDelegatorAddr(DefaultCodespace) @@ -358,7 +358,7 @@ type MsgUndelegate struct { Amount sdk.Coin `json:"amount" yaml:"amount"` } -// NewMsgUndelegate creates a new MsgUndelegate instance +// NewMsgUndelegate creates a new MsgUndelegate instance. func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin) MsgUndelegate { return MsgUndelegate{ DelegatorAddress: delAddr, @@ -367,22 +367,22 @@ func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk } } -// Route implements the sdk.Msg interface +// Route implements the sdk.Msg interface. func (msg MsgUndelegate) Route() string { return RouterKey } -// Type implements the sdk.Msg interface +// Type implements the sdk.Msg interface. func (msg MsgUndelegate) Type() string { return "begin_unbonding" } -// GetSigners implements the sdk.Msg interface +// GetSigners implements the sdk.Msg interface. func (msg MsgUndelegate) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.DelegatorAddress} } -// GetSignBytes implements the sdk.Msg interface +// GetSignBytes implements the sdk.Msg interface. func (msg MsgUndelegate) GetSignBytes() []byte { bz := ModuleCdc.MustMarshalJSON(msg) return sdk.MustSortJSON(bz) } -// ValidateBasic implements the sdk.Msg interface +// ValidateBasic implements the sdk.Msg interface. func (msg MsgUndelegate) ValidateBasic() sdk.Error { if msg.DelegatorAddress.Empty() { return ErrNilDelegatorAddr(DefaultCodespace) From 406e106ec6ff2fdedf0289ef94fd10bd37e32147 Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Tue, 3 Dec 2019 10:35:26 +0100 Subject: [PATCH 4/5] format --- x/staking/types/msg.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index f01333461e57..1efe19530de9 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -64,10 +64,10 @@ func NewMsgCreateValidator( func (msg MsgCreateValidator) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgCreateValidator) Type() string { return "create_validator" } +func (msg MsgCreateValidator) Type() string { return "create_validator" } // GetSigners implements the sdk.Msg interface. It returns the address(es) that -// must sign over msg.GetSignBytes(). +// must sign over msg.GetSignBytes(). // If the validator address is not same as delegator's, then the validator must // sign the msg as well. func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress { @@ -212,7 +212,7 @@ func NewMsgEditValidator(valAddr sdk.ValAddress, description Description, newRat func (msg MsgEditValidator) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgEditValidator) Type() string { return "edit_validator" } +func (msg MsgEditValidator) Type() string { return "edit_validator" } // GetSigners implements the sdk.Msg interface. func (msg MsgEditValidator) GetSigners() []sdk.AccAddress { @@ -268,7 +268,7 @@ func NewMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.C func (msg MsgDelegate) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgDelegate) Type() string { return "delegate" } +func (msg MsgDelegate) Type() string { return "delegate" } // GetSigners implements the sdk.Msg interface. func (msg MsgDelegate) GetSigners() []sdk.AccAddress { @@ -308,7 +308,7 @@ type MsgBeginRedelegate struct { // NewMsgBeginRedelegate creates a new MsgBeginRedelegate instance. func NewMsgBeginRedelegate( delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, amount sdk.Coin, - ) MsgBeginRedelegate { +) MsgBeginRedelegate { return MsgBeginRedelegate{ DelegatorAddress: delAddr, ValidatorSrcAddress: valSrcAddr, @@ -321,7 +321,7 @@ func NewMsgBeginRedelegate( func (msg MsgBeginRedelegate) Route() string { return RouterKey } // Type implements the sdk.Msg interface -func (msg MsgBeginRedelegate) Type() string { return "begin_redelegate" } +func (msg MsgBeginRedelegate) Type() string { return "begin_redelegate" } // GetSigners implements the sdk.Msg interface func (msg MsgBeginRedelegate) GetSigners() []sdk.AccAddress { @@ -368,10 +368,10 @@ func NewMsgUndelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk } // Route implements the sdk.Msg interface. -func (msg MsgUndelegate) Route() string { return RouterKey } +func (msg MsgUndelegate) Route() string { return RouterKey } // Type implements the sdk.Msg interface. -func (msg MsgUndelegate) Type() string { return "begin_unbonding" } +func (msg MsgUndelegate) Type() string { return "begin_unbonding" } // GetSigners implements the sdk.Msg interface. func (msg MsgUndelegate) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{msg.DelegatorAddress} } From 5739234c95d375fc955d92e084cbfebb23f335e0 Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Tue, 3 Dec 2019 10:37:40 +0100 Subject: [PATCH 5/5] changelog minor fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1243290fea70..7148e122122b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,7 +83,7 @@ if the provided arguments are invalid. * (rest) [\#4783](https://github.com/cosmos/cosmos-sdk/issues/4783) The balance field in the DelegationResponse type is now sdk.Coin instead of sdk.Int * (x/auth) [\#5006](https://github.com/cosmos/cosmos-sdk/pull/5006) The gas required to pass the `AnteHandler` has increased significantly due to modular `AnteHandler` support. Increase GasLimit accordingly. -* (rest) [\#5336](https://github.com/cosmos/cosmos-sdk/issues/5336) `MsgEditValidator` uses `delegator` instead of `Delegator` as a JSON key. +* (rest) [\#5336](https://github.com/cosmos/cosmos-sdk/issues/5336) `MsgEditValidator` uses `description` instead of `Description` as a JSON key. ### Features