Skip to content

Commit

Permalink
fix: fix wrong argument order when editing a subspace (#1014)
Browse files Browse the repository at this point in the history
## Description

Closes: #XXXX
This PR fixes the argument order of `EditSubspace` message.



---

### 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...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html)
- [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### 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...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
  • Loading branch information
dadamu authored Oct 11, 2022
1 parent efecce5 commit 4c8449c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: fix
module: x/subspaces
pull_request: 1014
description: Fixed the argument order when editing a subspace
backward_compatible: true
date: 2022-10-11T07:27:41.5528426Z
2 changes: 1 addition & 1 deletion x/subspaces/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (k msgServer) EditSubspace(goCtx context.Context, msg *types.MsgEditSubspac
}

// Update the subspace and validate it
updated := subspace.Update(types.NewSubspaceUpdate(msg.Name, msg.Description, msg.Owner, msg.Treasury))
updated := subspace.Update(types.NewSubspaceUpdate(msg.Name, msg.Description, msg.Treasury, msg.Owner))
err = updated.Validate()
if err != nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error())
Expand Down
28 changes: 14 additions & 14 deletions x/subspaces/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ func (suite *KeeperTestsuite) TestMsgServer_EditSubspace() {
1,
"Test subspace",
"This is a test subspace",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1y4emx0mm4ncva9mnv9yvjrm7nrq3psvmwhk9ll",
"cosmos1s0he0z3g92zwsxdj83h0ky9w463sx7gq9mqtgn",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
blockTime,
))
Expand All @@ -301,8 +301,8 @@ func (suite *KeeperTestsuite) TestMsgServer_EditSubspace() {
1,
"Test subspace",
"This is a test subspace",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1y4emx0mm4ncva9mnv9yvjrm7nrq3psvmwhk9ll",
"cosmos1s0he0z3g92zwsxdj83h0ky9w463sx7gq9mqtgn",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
blockTime,
), subspace)
Expand All @@ -315,8 +315,8 @@ func (suite *KeeperTestsuite) TestMsgServer_EditSubspace() {
1,
"Test subspace",
"This is a test subspace",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1y4emx0mm4ncva9mnv9yvjrm7nrq3psvmwhk9ll",
"cosmos1s0he0z3g92zwsxdj83h0ky9w463sx7gq9mqtgn",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
blockTime,
))
Expand All @@ -337,8 +337,8 @@ func (suite *KeeperTestsuite) TestMsgServer_EditSubspace() {
1,
"Test subspace",
"This is a test subspace",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1y4emx0mm4ncva9mnv9yvjrm7nrq3psvmwhk9ll",
"cosmos1s0he0z3g92zwsxdj83h0ky9w463sx7gq9mqtgn",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
blockTime,
), subspace)
Expand All @@ -351,8 +351,8 @@ func (suite *KeeperTestsuite) TestMsgServer_EditSubspace() {
1,
"Test subspace",
"This is a test subspace",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
"cosmos1y4emx0mm4ncva9mnv9yvjrm7nrq3psvmwhk9ll",
"cosmos1s0he0z3g92zwsxdj83h0ky9w463sx7gq9mqtgn",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
blockTime,
))
Expand All @@ -368,8 +368,8 @@ func (suite *KeeperTestsuite) TestMsgServer_EditSubspace() {
1,
"This is a new name",
"This is a new description",
"cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5",
"cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5",
"cosmos1y4emx0mm4ncva9mnv9yvjrm7nrq3psvmwhk9ll",
"cosmos1s0he0z3g92zwsxdj83h0ky9w463sx7gq9mqtgn",
"cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5",
),
shouldErr: false,
Expand All @@ -392,8 +392,8 @@ func (suite *KeeperTestsuite) TestMsgServer_EditSubspace() {
1,
"This is a new name",
"This is a new description",
"cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5",
"cosmos1m0czrla04f7rp3zg7dsgc4kla54q7pc4xt00l5",
"cosmos1y4emx0mm4ncva9mnv9yvjrm7nrq3psvmwhk9ll",
"cosmos1s0he0z3g92zwsxdj83h0ky9w463sx7gq9mqtgn",
"cosmos1qzskhrcjnkdz2ln4yeafzsdwht8ch08j4wed69",
blockTime,
), subspace)
Expand Down

0 comments on commit 4c8449c

Please sign in to comment.