-
Notifications
You must be signed in to change notification settings - Fork 593
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
E2E: Interchain Account failed bank transfer over incentivised channel #2049
Conversation
There was a problem hiding this 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] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
…d-bank-transfer-over-incentivised-channel
…d-bank-transfer-over-incentivised-channel
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.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes