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

[FEAT] ICS20-V2 Path Forwarding #6693

Merged
merged 162 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 154 commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
c07bca9
Adding proto files for ics20-v2 (#6110)
chatton Apr 8, 2024
e66bd89
update amount -> string (#6120)
charleenfei Apr 9, 2024
034f472
Update MsgTransfer to accept sdk.Coins instead of sdk.Coin (#6113)
chatton Apr 9, 2024
4cc6a85
fix: allow base denom with trailing slash (#6148)
crodriguezvega Apr 15, 2024
71f830c
imp: add CurrentVersion, EscrowVersion (#6160)
charleenfei Apr 16, 2024
28ff9b6
chore: add function for converting packet data from v1 to v3 (#6116)
chatton Apr 16, 2024
4e55137
chore: implement required `FungibleTokenPacketData` v3 interface meth…
charleenfei Apr 22, 2024
ca056cf
imp: `getMultiDenomFungibleTokenPacketData`to be used in packet unmar…
charleenfei Apr 29, 2024
147cf17
chore: implement version checking for channel handshake application c…
charleenfei May 6, 2024
9bbfa1a
imp: update transfer authz implementation to account for multi denom …
charleenfei May 6, 2024
4f57916
ics20-v2: backwards compatibility for transfer rpc and packet callbac…
crodriguezvega May 10, 2024
e04047e
add v3 packet proto
May 10, 2024
c73d5f6
fix protos
May 10, 2024
03cc2e5
fixes
May 10, 2024
65f4476
test fixes
May 10, 2024
db85a29
add forwardPath keys and memo check in sendTransfer
May 13, 2024
999ed80
wip onRecvPacket logic
May 13, 2024
be72180
minor fixes
May 13, 2024
4c333c5
changes to transfer tx CLI to support multiple denoms
crodriguezvega May 14, 2024
0478cb9
import renaming
crodriguezvega May 14, 2024
37f5b5e
onRecv logic completed
May 14, 2024
3fd3345
add revertInFlights function
May 14, 2024
24e2407
add onAck && onTimeout logic
May 14, 2024
7858528
fix interchain accounts test
crodriguezvega May 14, 2024
55d7bf9
basic unit test for path forwarding
crodriguezvega May 14, 2024
1a95262
fix test unsuccessful refund from source
May 15, 2024
44e15cb
wip test fix
May 15, 2024
334d5a9
fix mbt test - need more investigation
May 16, 2024
7466b19
revert test fix
May 16, 2024
5c46d79
add assertions
May 16, 2024
99e6b0a
add support for async ack
May 16, 2024
a114af6
wip test forwarding happy path
May 16, 2024
d800caa
icsv20(path forwarding): use nil as default forwarding path when not …
crodriguezvega May 17, 2024
dd873a1
add forwarding happy path tests
May 17, 2024
a292a3f
Merge branch 'feat/ics20-v2' into stefano/carlos/ics20-v2-forwarding-poc
sangier May 20, 2024
e25ba0c
fix merge
May 20, 2024
f39d173
Use type with V2 suffix for package data (#6330)
chatton May 21, 2024
9b39944
Adding additional comments and changing version variable names (#6345)
chatton May 21, 2024
06ca9a5
Merge branch 'main' into merge-main
chatton May 21, 2024
7897ef3
chore: correctly claim capability
chatton May 21, 2024
786a4f1
lint
colin-axner May 21, 2024
5747756
Merge pull request #6346 from cosmos/merge-main
DimitrisJim May 21, 2024
7e2e6df
Merge branch 'main' into feat/ics20-v2
chatton May 22, 2024
a84b0e7
imp: change ics20 events to emit token set (#6348)
colin-axner May 22, 2024
43877df
imp: check length tokens array against maximum allowed (#6349)
crodriguezvega May 22, 2024
8eae033
Modify UnmarshalPacketData interface to allow additional args (#6341)
DimitrisJim May 22, 2024
dbcff45
Refactor packet data unmarshalling to use specific version (#6354)
chatton May 23, 2024
bb69698
Merge branch 'main' into merge-main-2
chatton May 23, 2024
f19a145
chore: fixing tests
chatton May 23, 2024
8f86dda
Merge pull request #6359 from cosmos/merge-main-2
chatton May 23, 2024
d4b06c8
imp: self review comments for ics20-v2 (#6360)
colin-axner May 23, 2024
a9391a4
imp: self review on ics20-v2 part 2 (#6364)
colin-axner May 23, 2024
575403e
chore: move functions from internal/denom back to trace.go (#6368)
DimitrisJim May 23, 2024
50ccd94
imp: ics20 v2 self review part 3 (#6373)
colin-axner May 23, 2024
87eb32e
chore: remove duplicate test case
colin-axner May 23, 2024
e8b9d5a
chore: address minor nits (#6374)
DimitrisJim May 23, 2024
57aab01
Merge branch 'feat/ics20-v2' into stefano/carlos/ics20-v2-forwarding-poc
crodriguezvega May 23, 2024
2519593
fix lint warning, add extra godocs, and some other small fixes and cl…
crodriguezvega May 26, 2024
3bf6c04
Merge branch 'main' into stefano/carlos/ics20-v2-forwarding-poc
crodriguezvega May 27, 2024
64c2fc4
fix finalReceiver address bug
May 27, 2024
7cd7260
wip - ack test scenario5
May 27, 2024
6673e74
add FungibleTokenPacketDataV2 test for ValidateBasic (#6398)
hastur199 May 28, 2024
550eeef
fix linter complaints
crodriguezvega May 28, 2024
4c54a88
add test - currently faling on middle hop revert
May 28, 2024
debc4cb
add test comments
May 28, 2024
e50fa40
fixes
May 28, 2024
6d87d95
Merge branch 'main' into stefano/carlos/ics20-v2-forwarding-poc
crodriguezvega May 31, 2024
7c8f516
retrieve channel capability only if there is a previous packet in store
crodriguezvega May 31, 2024
feb7b01
Merge branch 'main' into stefano/carlos/ics20-v2-forwarding-poc
crodriguezvega Jun 7, 2024
6fd1773
Merge branch 'main' into stefano/carlos/ics20-v2-forwarding-poc
crodriguezvega Jun 9, 2024
efcfa5d
add missing parameter
crodriguezvega Jun 9, 2024
21dbb37
fix: e2e build failures.
DimitrisJim Jun 10, 2024
70d7a29
Use Transfer instead of sendTransfer when forwarding. (#6564)
DimitrisJim Jun 11, 2024
465b16c
lint: fix linter issues.
DimitrisJim Jun 11, 2024
ec472cf
tests(transfer): move forwarding tests to separate file. (#6568)
DimitrisJim Jun 11, 2024
e483b9a
chore: rename ForwardingInfo to Forwarding
damiannolan Jun 12, 2024
0c9f368
Revert "chore: rename ForwardingInfo to Forwarding"
damiannolan Jun 12, 2024
413b7c1
nit(transfer): Mark hops as non nullable. (#6566)
DimitrisJim Jun 12, 2024
ae2046a
feat(transfer): add forwarding info validation to token packet (#6571)
gjermundgaraba Jun 12, 2024
ba7c4a8
feat(transfer): add validation for forwarding info in msg transfer va…
gjermundgaraba Jun 13, 2024
6b3b5aa
Fix and simplify reverts of forwarding state (#6574)
srdtrk Jun 13, 2024
5070e50
chore: rename ForwardingInfo to Forwarding (#6576)
damiannolan Jun 13, 2024
d874b54
Refactor packet forward functions (#6575)
chatton Jun 13, 2024
a8cd302
Merge branch 'main' into feat/ics20-v2-path-forwarding
crodriguezvega Jun 13, 2024
fbb9cd8
feat(transfer): validate forwarding memo in transfer authorization (#…
gjermundgaraba Jun 13, 2024
c4987a7
Add func convert token to coin ibc (#6584)
duonghb53 Jun 14, 2024
a90b671
transfer: Disallow a forwarding object specified with zero hops and a…
DimitrisJim Jun 14, 2024
c348732
feat(transfer): move async decision and handling to the ibc module on…
gjermundgaraba Jun 14, 2024
789b09b
Merge branch 'main' into feat/ics20-v2-path-forwarding
crodriguezvega Jun 16, 2024
c00ddd9
chore: use NewForwarding instead of direct init (#6605)
gjermundgaraba Jun 17, 2024
fc6c111
Reduce max forwarding to 16 (#6610)
DimitrisJim Jun 17, 2024
72714b3
feat(transfer): use single byte ack for successful forward (#6604)
gjermundgaraba Jun 17, 2024
c546f69
chore(transfer/cli): add forwarding flag to tx cli (#6609)
DimitrisJim Jun 18, 2024
60a6b99
chore(transfer): make Forwarding non-null (#6618)
DimitrisJim Jun 18, 2024
dc47641
chore: restructure functions with logical ordering (#6638)
damiannolan Jun 18, 2024
832b1bd
test: Add tests for OnTimeoutPacket when middle chain times out packe…
bznein Jun 19, 2024
360b2f8
feat(transfer): add ShouldBeForwarded convenience method to msg trans…
gjermundgaraba Jun 19, 2024
84c7c33
disallow timeout height usage when forwarding packets (#6641)
crodriguezvega Jun 19, 2024
007dee1
nit: make set forwarded packet unexported (#6637)
crodriguezvega Jun 19, 2024
14d5486
feat(transfer): use registered error code for error acks in token for…
gjermundgaraba Jun 19, 2024
a28a549
chore(transfer): emit forwarding information in events. (#6647)
DimitrisJim Jun 20, 2024
d6db0c5
Merge branch 'main' into gjermund/merge-main-to-feat-ics20-v2-path-fo…
gjermundgaraba Jun 20, 2024
64bc502
Fix e2e test
gjermundgaraba Jun 20, 2024
1ca1f2f
Merge pull request #6662 from cosmos/gjermund/merge-main-to-feat-ics2…
chatton Jun 20, 2024
87d1f91
Refactor forwarding messages for Transfer and Packet (#6655)
DimitrisJim Jun 20, 2024
ef6d22f
feat: allow authz granters to specify forwarding info for token trans…
bznein Jun 21, 2024
da2f9f6
feat: delete forwarded packet when it is not needed anymore (#6621)
bznein Jun 21, 2024
e68143b
test(transfer): forwarding acknowledgment errors in middle hop (#6659)
gjermundgaraba Jun 21, 2024
6619821
test(transfer): last chain in forwarding packet is ICS20 v1 (#6622)
gjermundgaraba Jun 21, 2024
43eceed
refactor: rename SetupPath to SetupPaths (#6674)
gjermundgaraba Jun 24, 2024
aa860ac
chore: add flag for unwind in transfer cli (#6680)
neitdung Jun 24, 2024
2b4d24b
feat: impl check reject transfer if len(hops) > 0 and ics20-1 (#6675)
duonghb53 Jun 24, 2024
59e3df7
feat(transfer): add unwinding ability (#6656)
DimitrisJim Jun 25, 2024
e3ffcff
Merge branch 'main' into feat/ics20-v2-path-forwarding
chatton Jun 25, 2024
9c5ae03
fix typo
crodriguezvega Jun 25, 2024
c2a6bc6
remove unnecessary wrapping of function
crodriguezvega Jun 25, 2024
c3ccbfc
Revert "remove unnecessary wrapping of function"
crodriguezvega Jun 25, 2024
5345776
fix usage of function
crodriguezvega Jun 25, 2024
74088ba
(chore) replace reflect.DeepEqual with slices.Equal (#6697)
bznein Jun 25, 2024
272c12b
chore: comment hop slicing for clarity (#6702)
gjermundgaraba Jun 25, 2024
4349a1d
chore: cleanup forwarding tests (#6691)
crodriguezvega Jun 26, 2024
24cd07f
chore: pull out hop validation and consolidate for transfer+packet (#…
gjermundgaraba Jun 26, 2024
dca8c42
Merge branch 'main' into feat/ics20-v2-path-forwarding
chatton Jun 26, 2024
37d7335
Remove unwind field in authz (#6701)
chatton Jun 26, 2024
6e1a082
chore: add packet data validation back (#6704)
chatton Jun 26, 2024
8f9691f
(chore) Refactor code around forwarding validation (#6706)
bznein Jun 26, 2024
c505243
use setupForwardingPaths in test
crodriguezvega Jun 26, 2024
d715455
feat(transfer): allow non-cosmos-sdk AccAddress in final receiver for…
gjermundgaraba Jun 26, 2024
4e61ea9
chore: pass only hops to sendTransfer + events rename (#6703)
gjermundgaraba Jun 26, 2024
3e2a5fa
test: forwarding test that verifies forwarded memo (#6707)
gjermundgaraba Jun 26, 2024
5ea9d79
chore: update godoc for relay forwarding tests
gjermundgaraba Jun 26, 2024
100ccc7
chore: use module account instead of custom forward address (#6688)
gjermundgaraba Jun 26, 2024
13d3ac6
chore: replace continue with if/else (#6700)
crodriguezvega Jun 26, 2024
b6d77d7
Merge branch 'main' into feat/ics20-v2-path-forwarding
crodriguezvega Jun 27, 2024
4d19be1
add changelog
crodriguezvega Jun 27, 2024
2838aef
add test for invalid receiver address
crodriguezvega Jun 27, 2024
7afb7f6
Update CHANGELOG.md
crodriguezvega Jun 27, 2024
0221c6b
Update CHANGELOG.md
crodriguezvega Jun 27, 2024
cc46a63
make getForwardedPacket private
crodriguezvega Jun 27, 2024
e67aeaf
remove auxiliary burn coins function
crodriguezvega Jun 27, 2024
966a644
nit: rename func method recv args in types/forwarding.go
damiannolan Jun 27, 2024
e92e086
chore: rename ShouldBeForwarded to HasFowarding
damiannolan Jun 27, 2024
6ea614f
e2e: remove template test for three chain setup.
DimitrisJim Jun 27, 2024
18d0567
nit: no generics silly
DimitrisJim Jun 27, 2024
1b7214d
nit: add clarifying comment to validate basic call on msg.
DimitrisJim Jun 27, 2024
1f5e61f
nit: remove unused key.
DimitrisJim Jun 27, 2024
0a78bde
nit: clean up cli help text.
DimitrisJim Jun 27, 2024
07036a9
nit: don't export is blocked address helper.
DimitrisJim Jun 27, 2024
1442874
nit: docustring for e2e test and helper.
DimitrisJim Jun 27, 2024
25c73c4
nit: improve documentation for transfer's OnRecv callback.
DimitrisJim Jun 27, 2024
baf3fd3
Apply suggestions from code review
crodriguezvega Jun 27, 2024
7d2a881
chore: remove unused function
crodriguezvega Jun 27, 2024
4ea36c2
perf: allocate slice to length of packet data tokens
crodriguezvega Jun 27, 2024
0a28e9b
Merge branch 'main' into feat/ics20-v2-path-forwarding
crodriguezvega Jun 27, 2024
7411f2d
chore(transfer/authz): wrapf unauthorized forwarding hops
damiannolan Jun 27, 2024
199c14a
lint
crodriguezvega Jun 27, 2024
c7af85a
Update modules/apps/transfer/types/forwarding.go
crodriguezvega Jun 27, 2024
25239a2
Merge branch 'main' into feat/ics20-v2-path-forwarding
crodriguezvega Jun 27, 2024
90d57db
Preallocate slice but keep len==0 (#6725)
bznein Jun 27, 2024
e310e27
imp: validate allowed forwarding hops
crodriguezvega Jun 27, 2024
f28e937
test: unwind fails in Transfer rpc
crodriguezvega Jun 27, 2024
50daed0
Merge branch 'main' into feat/ics20-v2-path-forwarding
crodriguezvega Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Features

* (apps/transfer) [\#6492](https://github.com/cosmos/ibc-go/pull/6492) Added new `Tokens` field to `MsgTransfer` to enable sending of multiple denoms, and deprecated the `Token` field.
* (apps/transfer) [\#6693](https://github.com/cosmos/ibc-go/pull/6693) Added new `Forwarding` field to `MsgTransfer` to enable forwarding tokens through multiple intermediary chains with a single transaction. This also enables automatic unwinding of tokens to their native chain. `x/authz` support for transfer allows granters to specify a set of possible forwarding hops that are allowed for grantees.

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/core/03-connection/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type ConnectionTestSuite struct {
}

func (s *ConnectionTestSuite) SetupTest() {
s.SetupPath(ibc.DefaultClientOpts(), s.TransferChannelOptions())
s.SetupPaths(ibc.DefaultClientOpts(), s.TransferChannelOptions())
}

// QueryMaxExpectedTimePerBlockParam queries the on-chain max expected time per block param for 03-connection
Expand Down
6 changes: 5 additions & 1 deletion e2e/tests/transfer/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type AuthzTransferTestSuite struct {
}

func (suite *AuthzTransferTestSuite) SetupTest() {
suite.SetupPath(ibc.DefaultClientOpts(), suite.TransferChannelOptions())
suite.SetupPaths(ibc.DefaultClientOpts(), suite.TransferChannelOptions())
}

// QueryGranterGrants returns all GrantAuthorizations for the given granterAddress.
Expand Down Expand Up @@ -131,6 +131,7 @@ func (suite *AuthzTransferTestSuite) TestAuthz_MsgTransfer_Succeeds() {
suite.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)

protoAny, err := codectypes.NewAnyWithValue(transferMsg)
Expand Down Expand Up @@ -191,6 +192,7 @@ func (suite *AuthzTransferTestSuite) TestAuthz_MsgTransfer_Succeeds() {
suite.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)

protoAny, err := codectypes.NewAnyWithValue(transferMsg)
Expand Down Expand Up @@ -274,6 +276,7 @@ func (suite *AuthzTransferTestSuite) TestAuthz_InvalidTransferAuthorizations() {
suite.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)

protoAny, err := codectypes.NewAnyWithValue(transferMsg)
Expand Down Expand Up @@ -334,6 +337,7 @@ func (suite *AuthzTransferTestSuite) TestAuthz_InvalidTransferAuthorizations() {
suite.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)

protoAny, err := codectypes.NewAnyWithValue(transferMsg)
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/transfer/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type TransferTestSuite struct {
}

func (s *TransferTestSuite) SetupTest() {
s.SetupPath(ibc.DefaultClientOpts(), s.TransferChannelOptions())
s.SetupPaths(ibc.DefaultClientOpts(), s.TransferChannelOptions())
}

// QueryTransferParams queries the on-chain send enabled param for the transfer module
Expand Down
83 changes: 41 additions & 42 deletions e2e/tests/transfer/forwarding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ package transfer
import (
"context"
"testing"
"time"

"github.com/strangelove-ventures/interchaintest/v8/ibc"
testifysuite "github.com/stretchr/testify/suite"

"github.com/cosmos/ibc-go/e2e/testsuite"
"github.com/cosmos/ibc-go/e2e/testsuite/query"
"github.com/cosmos/ibc-go/e2e/testvalues"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
)

func TestTransferForwardingTestSuite(t *testing.T) {
Expand All @@ -26,72 +30,67 @@ func (s *TransferForwardingTestSuite) SetupSuite() {
s.SetupChains(context.TODO(), nil, testsuite.ThreeChainSetup())
}

// TODO: replace this with actual tests https://github.com/cosmos/ibc-go/issues/6578
// this test verifies that three chains can be set up, and the relayer will relay
// packets between them as configured in the newInterchain function.
func (s *TransferForwardingTestSuite) TestThreeChainSetup() {
// TestForwarding_WithLastChainBeingICS20v1_Succeeds tests the case where a token is forwarded and successfully
// received on a destination chain that is on ics20-v1 version.
func (s *TransferForwardingTestSuite) TestForwarding_WithLastChainBeingICS20v1_Succeeds() {
DimitrisJim marked this conversation as resolved.
Show resolved Hide resolved
ctx := context.TODO()
t := s.T()

relayer, chains := s.GetRelayer(), s.GetAllChains()

chainA, chainB, chainC := chains[0], chains[1], chains[2]

chainAChannels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID)
s.Require().NoError(err)
chainBChannels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainB.Config().ChainID)
s.Require().NoError(err)
chainCChannels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainC.Config().ChainID)
s.Require().NoError(err)
channelAtoB := s.GetChainAChannel()

s.Require().Len(chainAChannels, 1, "expected 1 channels on chain A")
s.Require().Len(chainBChannels, 2, "expected 2 channels on chain B")
s.Require().Len(chainCChannels, 1, "expected 1 channels on chain C")

channelAToB := chainAChannels[0]
channelBToC := chainBChannels[1]
// Creating a new path between chain B and chain C with a ICS20-v1 channel
opts := s.TransferChannelOptions()
opts.Version = transfertypes.V1
channelBtoC, _ := s.CreatePath(ctx, chainB, chainC, ibc.DefaultClientOpts(), opts)
s.Require().Equal(transfertypes.V1, channelBtoC.Version, "the channel version is not ics20-1")

chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)
chainAAddress := chainAWallet.FormattedAddress()
chainADenom := chainA.Config().Denom

chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount)
chainBAddress := chainBWallet.FormattedAddress()
chainBDenom := chainB.Config().Denom

chainCWallet := s.CreateUserOnChainC(ctx, testvalues.StartingTokenAmount)
chainCAddress := chainCWallet.FormattedAddress()

t.Run("IBC transfer from A to B", func(t *testing.T) {
transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelAToB.PortID, channelAToB.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "")
s.AssertTxSuccess(transferTxResp)
})

t.Run("IBC transfer from B to C", func(t *testing.T) {
transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelBToC.PortID, channelBToC.ChannelID, testvalues.DefaultTransferCoins(chainBDenom), chainBAddress, chainCAddress, s.GetTimeoutHeight(ctx, chainC), 0, "")
s.AssertTxSuccess(transferTxResp)
t.Run("IBC transfer from A to C with forwarding through B", func(t *testing.T) {
inFiveMinutes := time.Now().Add(5 * time.Minute).UnixNano()
forwarding := transfertypes.NewForwarding(false, transfertypes.Hop{
PortId: channelBtoC.PortID,
ChannelId: channelBtoC.ChannelID,
})

msgTransfer := testsuite.GetMsgTransfer(
channelAtoB.PortID,
channelAtoB.ChannelID,
transfertypes.V2,
testvalues.DefaultTransferCoins(chainADenom),
chainAAddress,
chainCAddress,
clienttypes.ZeroHeight(),
uint64(inFiveMinutes),
"",
forwarding)
resp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgTransfer)
s.AssertTxSuccess(resp)
})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're omitting the usual escrow checks and stuff here, but I think that's actually fine. We have those in other tests and this test ends up being short and sweet because of it!

t.Run("start relayer", func(t *testing.T) {
s.StartRelayer(relayer)
})

chainBIBCToken := testsuite.GetIBCToken(chainADenom, channelAToB.Counterparty.PortID, channelAToB.Counterparty.ChannelID)
t.Run("packets are relayed from A to B", func(t *testing.T) {
s.AssertPacketRelayed(ctx, chainA, channelAToB.PortID, channelAToB.ChannelID, 1)

actualBalance, err := query.Balance(ctx, chainB, chainBAddress, chainBIBCToken.IBCDenom())
s.Require().NoError(err)

expected := testvalues.IBCTransferAmount
s.Require().Equal(expected, actualBalance.Int64())
})
t.Run("packets are relayed from A to B to C", func(t *testing.T) {
chainCDenom := transfertypes.NewDenom(chainADenom,
transfertypes.NewTrace(channelBtoC.Counterparty.PortID, channelBtoC.Counterparty.ChannelID),
transfertypes.NewTrace(channelAtoB.Counterparty.PortID, channelAtoB.Counterparty.ChannelID),
)

chainCIBCToken := testsuite.GetIBCToken(chainBDenom, channelBToC.Counterparty.PortID, channelBToC.Counterparty.ChannelID)
t.Run("packets are relayed from B to C", func(t *testing.T) {
s.AssertPacketRelayed(ctx, chainB, channelBToC.PortID, channelBToC.ChannelID, 1)
s.AssertPacketRelayed(ctx, chainA, channelAtoB.PortID, channelAtoB.ChannelID, 1)
s.AssertPacketRelayed(ctx, chainB, channelBtoC.PortID, channelBtoC.ChannelID, 1)

actualBalance, err := query.Balance(ctx, chainC, chainCAddress, chainCIBCToken.IBCDenom())
actualBalance, err := query.Balance(ctx, chainC, chainCAddress, chainCDenom.IBCDenom())
s.Require().NoError(err)

expected := testvalues.IBCTransferAmount
Expand Down
5 changes: 4 additions & 1 deletion e2e/tests/transfer/incentivized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/cosmos/ibc-go/e2e/testsuite/query"
"github.com/cosmos/ibc-go/e2e/testvalues"
feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
)

Expand All @@ -38,7 +39,7 @@ func TestIncentivizedTransferTestSuite(t *testing.T) {

// SetupTest explicitly enables fee middleware in the channel options.
func (s *IncentivizedTransferTestSuite) SetupTest() {
s.SetupPath(ibc.DefaultClientOpts(), s.FeeTransferChannelOptions())
s.SetupPaths(ibc.DefaultClientOpts(), s.FeeTransferChannelOptions())
}

func (s *IncentivizedTransferTestSuite) TestMsgPayPacketFee_AsyncSingleSender_Succeeds() {
Expand Down Expand Up @@ -216,6 +217,7 @@ func (s *IncentivizedTransferTestSuite) TestMsgPayPacketFee_InvalidReceiverAccou
s.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)
txResp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgTransfer)
// this message should be successful, as receiver account is not validated on the sending chain.
Expand Down Expand Up @@ -354,6 +356,7 @@ func (s *IncentivizedTransferTestSuite) TestMultiMsg_MsgPayPacketFeeSingleSender
s.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)
resp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgPayPacketFee, msgTransfer)
s.AssertTxSuccess(resp)
Expand Down
3 changes: 2 additions & 1 deletion e2e/tests/transfer/upgradesv1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type TransferChannelUpgradesV1TestSuite struct {
func (s *TransferChannelUpgradesV1TestSuite) SetupTest() {
opts := s.TransferChannelOptions()
opts.Version = transfertypes.V1
s.SetupPath(ibc.DefaultClientOpts(), opts)
s.SetupPaths(ibc.DefaultClientOpts(), opts)
}

// TestChannelUpgrade_WithICS20v2_Succeeds tests upgrading a transfer channel to ICS20 v2.
Expand Down Expand Up @@ -306,6 +306,7 @@ func (s *TransferChannelUpgradesV1TestSuite) TestChannelUpgrade_WithFeeMiddlewar
s.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)
resp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgPayPacketFee, msgTransfer)
s.AssertTxSuccess(resp)
Expand Down
3 changes: 2 additions & 1 deletion e2e/tests/transfer/upgradesv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type TransferChannelUpgradesTestSuite struct {
}

func (s *TransferChannelUpgradesTestSuite) SetupTest() {
s.SetupPath(ibc.DefaultClientOpts(), s.TransferChannelOptions())
s.SetupPaths(ibc.DefaultClientOpts(), s.TransferChannelOptions())
}

// TestChannelUpgrade_WithFeeMiddleware_Succeeds tests upgrading a transfer channel to wire up fee middleware
Expand Down Expand Up @@ -213,6 +213,7 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_
s.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)
resp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgPayPacketFee, msgTransfer)
s.AssertTxSuccess(resp)
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/upgrades/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/cosmos/ibc-go/e2e/testsuite/query"
"github.com/cosmos/ibc-go/e2e/testvalues"
feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
v7migrations "github.com/cosmos/ibc-go/v8/modules/core/02-client/migrations/v7"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
Expand Down Expand Up @@ -62,7 +63,7 @@ func (s *UpgradeTestSuite) SetupTest() {
if strings.HasSuffix(s.T().Name(), "TestV8ToV8_1ChainUpgrade") {
channelOpts = s.FeeTransferChannelOptions()
}
s.SetupPath(ibc.DefaultClientOpts(), channelOpts)
s.SetupPaths(ibc.DefaultClientOpts(), channelOpts)
}

// UpgradeChain upgrades a chain to a specific version using the planName provided.
Expand Down Expand Up @@ -978,6 +979,7 @@ func (s *UpgradeTestSuite) TestV8ToV8_1ChainUpgrade_ChannelUpgrades() {
s.GetTimeoutHeight(ctx, chainB),
0,
"",
transfertypes.Forwarding{},
)
resp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgPayPacketFee, msgTransfer)
s.AssertTxSuccess(resp)
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/wasm/grandpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (s *GrandpaTestSuite) SetupTest() {

channelOpts := ibc.DefaultChannelOpts()
channelOpts.Version = transfertypes.V1
s.SetupPath(ibc.DefaultClientOpts(), channelOpts)
s.SetupPaths(ibc.DefaultClientOpts(), channelOpts)
}

// TestMsgTransfer_Succeeds_GrandpaContract features
Expand Down
Loading
Loading