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

test: e2e localhost test create new channel for existing ica account #3146

Merged
merged 15 commits into from
Feb 16, 2023

Conversation

damiannolan
Copy link
Member

Description

  • Adding e2e test for localhost interchain accounts channel closing via packet timeout and regaining access to the account by creating a new channel

Steps are as follows:

  1. Broadcast MsgRegisterInterchainAccount (channel open init).
  2. Finish localhost channel handshake by broadcasting msgs for (try, ack, confirm).
  3. Send a packet with timeout.
  4. Timeout the packet (controller channel end closes), CloseConfirm host channel end.
  5. Create new channel by repeating steps 1 and 2.
  6. Query the interchain account address and expect the existing balance.
  7. SendPacket, RecvPacket, AcknowledgePacket, Verify tokens are transferred.

ref: #3033

Commit Message / Changelog Entry

NA

see the guidelines for commit messages. (view raw markdown for examples)


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 and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@damiannolan damiannolan marked this pull request as ready for review February 15, 2023 09:10
Base automatically changed from damian/3033-localhost-e2e to 09-localhost February 15, 2023 15:02
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.

Wow, fantastic work! The code is so clean and beautiful! Was really easy to follow the logic of what was happening

Comment on lines +325 to +326
events := testsuite.ABCIToSDKEvents(txResp.Events)
packet, err = ibctesting.ParsePacketFromEvents(events)
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Copy link
Member Author

Choose a reason for hiding this comment

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

Pretty nice how this came to be so valuable here! :D

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 left one suggestions for a followup improvement but this looks great! Nice work ❤️

Comment on lines +201 to +203
// relayer and channel output is discarded, only a single chain is required
_, _ = s.SetupChainsRelayerAndChannel(ctx)
chainA, _ := s.GetChains()
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should create an issue to add a second setup function which only spins up a single chain, could be useful for localhost/non-ibc e2e tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, definitely agree!

@damiannolan damiannolan merged commit 2edfbd2 into 09-localhost Feb 16, 2023
@damiannolan damiannolan deleted the damian/3033-localhost-e2e-ica branch February 16, 2023 09:51
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.

3 participants