Skip to content
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

chore: adding sdk.Msg impl for ics27 MsgRegisterAccount #2081

Merged
merged 13 commits into from
Aug 24, 2022

Conversation

damiannolan
Copy link
Member

Description

  • Implement sdk.Msg interface
    • Adding ValidateBasic
    • Adding GetSigners
    • Adding tests

closes: #2053


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Copy link
Contributor

@charleenfei charleenfei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit comment but otherwise LGTM!!

)

var (
testAccAddress = "cosmos17dtl0mjt3t77kpuhg2edqzjpszulwhgzuj9ljs"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit but maybe we can add this a const file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added TestAccAddress to testing/values.go


if _, err := sdk.AccAddressFromBech32(msg.Owner); err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "failed to parse owner address: %s", msg.Owner)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we also need a validation on the version?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can since this version may be wrapped with many different versions (ics29 and so forth). There's no guarantee that the provided version is an ics27 version at the top level

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a changelog entry already for adding this message type?


if _, err := sdk.AccAddressFromBech32(msg.Owner); err != nil {
return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "failed to parse owner address: %s", msg.Owner)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can since this version may be wrapped with many different versions (ics29 and so forth). There's no guarantee that the provided version is an ics27 version at the top level

@damiannolan
Copy link
Member Author

damiannolan commented Aug 24, 2022

Do we have a changelog entry already for adding this message type

Good point! I think I'll need to add one retrospectively for #2068

edit: will add a single changelog entry for the meta issue #2026

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2022

Codecov Report

Merging #2081 (85f32bf) into main (0fa2978) will increase coverage by 0.08%.
The diff coverage is 84.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2081      +/-   ##
==========================================
+ Coverage   79.94%   80.03%   +0.08%     
==========================================
  Files         170      170              
  Lines       11801    11813      +12     
==========================================
+ Hits         9434     9454      +20     
+ Misses       1950     1941       -9     
- Partials      417      418       +1     
Impacted Files Coverage Δ
...ps/27-interchain-accounts/controller/types/msgs.go 90.90% <84.61%> (+90.90%) ⬆️

@damiannolan damiannolan merged commit 94d0840 into main Aug 24, 2022
@damiannolan damiannolan deleted the damian/2053-impl-sdk-msg-interface-register-acc branch August 24, 2022 13:32
mergify bot pushed a commit that referenced this pull request Aug 24, 2022
* adding new controller msg service, register account types, register interfaces and boilerplate

* fixing typo

* fixing protodoc and regenerate godocs

* adding channel id to MsgRegisterAccountResponse

* adding sdk.Msg impl for MsgRegisterAccount

* formatting imports

* adding additional tests with multiple versions, creating TestAccAddress const

(cherry picked from commit 94d0840)

# Conflicts:
#	modules/apps/27-interchain-accounts/controller/types/msgs.go
#	testing/values.go
damiannolan added a commit that referenced this pull request Aug 25, 2022
…2108)

* adding new controller msg service, register account types, register interfaces and boilerplate

* fixing typo

* fixing protodoc and regenerate godocs

* adding channel id to MsgRegisterAccountResponse

* adding sdk.Msg impl for MsgRegisterAccount

* formatting imports

* adding additional tests with multiple versions, creating TestAccAddress const

(cherry picked from commit 94d0840)

# Conflicts:
#	modules/apps/27-interchain-accounts/controller/types/msgs.go
#	testing/values.go

Co-authored-by: Damian Nolan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement sdk.Msg interface for MsgRegisterAccount
6 participants