From b2eb2ed6b9572ae620cf957220ea92c6da22e3de Mon Sep 17 00:00:00 2001 From: Eric Mokaya Date: Mon, 20 Jan 2025 11:48:31 +0300 Subject: [PATCH 1/3] fix: use correct variable --- x/staking/types/validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 16ff0737026a..c3b3c5247d24 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -239,7 +239,7 @@ func (d Description) UpdateDescription(d2 Description) (Description, error) { d2.Website, d2.SecurityContact, d2.Details, - d.Metadata, + d2.Metadata, ).Validate() } From e85dcfbbaae69f794a46e3d9c66b05b8ea4833b0 Mon Sep 17 00:00:00 2001 From: Eric Mokaya Date: Mon, 20 Jan 2025 11:48:38 +0300 Subject: [PATCH 2/3] test: update tests --- x/staking/types/validator_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index a94889fb5418..455b2e41bb19 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -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) From 99d613b4208040134756821ceb72d42702ecabfb Mon Sep 17 00:00:00 2001 From: Eric Mokaya Date: Mon, 20 Jan 2025 12:01:04 +0300 Subject: [PATCH 3/3] chore(x/staking): changelog --- x/staking/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/x/staking/CHANGELOG.md b/x/staking/CHANGELOG.md index 684a5f672354..37ea08469e24 100644 --- a/x/staking/CHANGELOG.md +++ b/x/staking/CHANGELOG.md @@ -56,6 +56,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