fix(x/staking): fix validator metadata update (#23461)
Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io>
This commit is contained in:
co-authored by
Alex | Interchain Labs
parent
66a766beae
commit
84a32cc4b3
@@ -57,6 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
* [#20688](https://github.com/cosmos/cosmos-sdk/pull/20688) Avoid overslashing unbonding delegations after a redelegation.
|
||||
* [#19226](https://github.com/cosmos/cosmos-sdk/pull/19226) Ensure `GetLastValidators` in `x/staking` does not return an error when `MaxValidators` exceeds total number of bonded validators.
|
||||
* [#23461](https://github.com/cosmos/cosmos-sdk/pull/23461) Fix `UpdateDescription` to correctly update the `Metadata` field.
|
||||
|
||||
### API Breaking Changes
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ func (d Description) UpdateDescription(d2 Description) (Description, error) {
|
||||
d2.Website,
|
||||
d2.SecurityContact,
|
||||
d2.Details,
|
||||
d.Metadata,
|
||||
d2.Metadata,
|
||||
).Validate()
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,10 @@ func TestUpdateDescription(t *testing.T) {
|
||||
d1 := types.Description{
|
||||
Website: "https://validator.cosmos",
|
||||
Details: "Test validator",
|
||||
Metadata: &types.Metadata{
|
||||
ProfilePicUri: "https://validator.cosmos/profile.png",
|
||||
SocialHandleUris: []string{"https://validator.cosmos/twitter", "https://validator.cosmos/telegram"},
|
||||
},
|
||||
}
|
||||
|
||||
d2 := types.Description{
|
||||
@@ -39,6 +43,10 @@ func TestUpdateDescription(t *testing.T) {
|
||||
Identity: types.DoNotModifyDesc,
|
||||
Website: types.DoNotModifyDesc,
|
||||
Details: types.DoNotModifyDesc,
|
||||
Metadata: &types.Metadata{
|
||||
ProfilePicUri: types.DoNotModifyDesc,
|
||||
SocialHandleUris: []string{"https://validator.cosmos/twitter", "https://validator.cosmos/telegram"},
|
||||
},
|
||||
}
|
||||
|
||||
d3 := types.Description{
|
||||
@@ -46,6 +54,7 @@ func TestUpdateDescription(t *testing.T) {
|
||||
Identity: "",
|
||||
Website: "",
|
||||
Details: "",
|
||||
Metadata: &types.Metadata{},
|
||||
}
|
||||
|
||||
d, err := d1.UpdateDescription(d2)
|
||||
|
||||
Reference in New Issue
Block a user