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

E2E: Interchain Account failed bank transfer over incentivised channel #2049

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Aug 19, 2022

Description

Tests

This test is largely the same as the one added in this pr the main difference is that the assertion on the chainB wallet is now expecting it to have the starting amount (as there are insufficient funds in the ICA account)

closes: #2048


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

@chatton chatton marked this pull request as ready for review August 19, 2022 10:32
Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Good stuff, @chatton!

s.Require().Equal(len(channels), 2)

// interchain accounts channel at index: 0
channelOutput = channels[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

How do you know that the ICA channel is at index 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good question, @damiannolan do you recall why it is at index 0 rather than 1?

Copy link
Member

Choose a reason for hiding this comment

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

Originally I would've expected it to be at index 1 (as the transfer channel is created first), but after trying that and having a failing test, I quickly switched it around and had no failures after.
It's not ideal and I haven't dug into it much more than taking a look at this function https://github.com/strangelove-ventures/ibctest/blob/main/relayer/rly/cosmos_relayer.go#L247

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just looking into it here, it looks like this is output of that variable

CHANNELS=[{State:STATE_OPEN Ordering:ORDER_ORDERED Counterparty:{PortID:icahost ChannelID:channel-1} ConnectionHops:[connection-0] Version:{"fee_version":"ics29-1","app_version":"{\"version\":\"ics27-1\",\"controller_connection_id\":\"connection-0\",\"host_connection_id\":\"connection-0\",\"address\":\"cosmos1vlmvwtdcwrdczsn97t6w8dezegvp3fpsvml28d2fx6xz8k8rpzuqqg6lr4\",\"encoding\":\"proto3\",\"tx_type\":\"sdk_multi_msg\"}"} PortID:icacontroller-cosmos1qjkpfk26cfftrj096q759ftv4ap3lfqgatngdc ChannelID:channel-1} {State:STATE_OPEN Ordering:ORDER_UNORDERED Counterparty:{PortID:transfer ChannelID:channel-0} ConnectionHops:[connection-0] Version:ics20-1 PortID:transfer ChannelID:channel-0}]

The order seems unexpected but the channel we care about is definitely first.

s.Require().NoError(err)

expected := testvalues.StartingTokenAmount
s.Require().Equal(expected, balance, "tokens should not have been sent as interchain account was not funded")
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the interchain account is not funded, shouldn't the balance be zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just because all of the accounts are initialized like this

chainBAccount := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount)

It is not possible to initialize an account with a balance of 0 with the framework as far as I understand.

@chatton chatton merged commit 00af73c into main Aug 19, 2022
@chatton chatton deleted the cian/issue#2048-e2e-interchain-account-failed-bank-transfer-over-incentivised-channel branch August 19, 2022 15:25
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.

E2E: Interchain Account failed bank transfer over incentivised channel
4 participants