Skip to content

Commit

Permalink
Merge branch 'main' into testnet-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Vuong Nguyen authored and Vuong Nguyen committed Jun 15, 2023
2 parents f2cf954 + 6666541 commit 1bc799b
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 31 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ replace (
// ibc-go with wasm client
github.com/cosmos/ibc-go/v7 => github.com/strangelove-ventures/ibc-go/v7 v7.0.0-20230410223156-8c202c556f82

github.com/strangelove-ventures/packet-forward-middleware/v7 => github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230614215530-986f283e0073
github.com/strangelove-ventures/packet-forward-middleware/v7 => github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230615054050-5523db83e69a

github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7

)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230614215530-986f283e0073 h1:HDZImocqKCU6YiTI4hUERpt6P2bBGfgEIXyg3oAMSAs=
github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230614215530-986f283e0073/go.mod h1:9C/cvYi6C0YqCc7sh0Eyv+pRYCXnt1DkJ1AN9q555Hw=
github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230615054050-5523db83e69a h1:MMb5U1UydbPHdQGmvLBy5/KgX9NUb8tY6H5aJvXXKjI=
github.com/notional-labs/packet-forward-middleware/v7 v7.0.0-20230615054050-5523db83e69a/go.mod h1:9C/cvYi6C0YqCc7sh0Eyv+pRYCXnt1DkJ1AN9q555Hw=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
Expand Down
125 changes: 97 additions & 28 deletions x/transfermiddleware/pfm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM_ErrorAck() {
timeoutHeight = clienttypes.NewHeight(1, 110)
pathAtoB *customibctesting.Path
pathBtoC *customibctesting.Path
nativeDenom = "ppica"
ibcDenom = "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878"
assetID = sdk.DefaultBondDenom
// expDenom = "ibc/3262D378E1636BE287EC355990D229DCEB828F0C60ED5049729575E235C60E8B"
)

suite.SetupTest()
Expand All @@ -101,7 +104,7 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM_ErrorAck() {
suite.coordinator.Setup(pathBtoC)
// Add parachain token info
chainBtransMiddleware := suite.chainB.TransferMiddleware()
err := chainBtransMiddleware.AddParachainIBCInfo(suite.chainB.GetContext(), ibcDenom, pathAtoB.EndpointB.ChannelID, sdk.DefaultBondDenom, sdk.DefaultBondDenom)
err := chainBtransMiddleware.AddParachainIBCInfo(suite.chainB.GetContext(), ibcDenom, pathAtoB.EndpointB.ChannelID, nativeDenom, assetID)
suite.Require().NoError(err)

params := transfertypes.Params{
Expand Down Expand Up @@ -133,7 +136,7 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM_ErrorAck() {
msg := transfertypes.NewMsgTransfer(
pathAtoB.EndpointA.ChannelConfig.PortID,
pathAtoB.EndpointA.ChannelID,
sdk.NewCoin(sdk.DefaultBondDenom, transferAmount),
sdk.NewCoin(assetID, transferAmount),
suite.chainA.SenderAccount.GetAddress().String(),
testAcc.String(),
timeoutHeight,
Expand All @@ -160,15 +163,15 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM_ErrorAck() {

// Check after first Hop
senderABalance := suite.chainA.AllBalances(suite.chainA.SenderAccount.GetAddress())
suite.Require().Equal(senderAOriginalBalance.Sub(sdk.NewCoin(sdk.DefaultBondDenom, transferAmount)), senderABalance)
suite.Require().Equal(senderAOriginalBalance.Sub(sdk.NewCoin(assetID, transferAmount)), senderABalance)

escrowIbcDenomAddress := transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance := suite.chainB.AllBalances(escrowIbcDenomAddress)
suite.Require().Equal(sdk.NewCoins(sdk.NewCoin(ibcDenom, transferAmount)), escrowIbcDenomAddressBalance)

escrowNativeDenomAddress := transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance := suite.chainB.AllBalances(escrowNativeDenomAddress)
suite.Require().Equal(sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, transferAmount)), escrowNativeDenomAddressBalance)
suite.Require().Equal(sdk.NewCoins(sdk.NewCoin(nativeDenom, transferAmount)), escrowNativeDenomAddressBalance)

// then should have a packet from B to C
suite.Require().Equal(1, len(suite.chainB.PendingSendPackets))
Expand Down Expand Up @@ -234,6 +237,10 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM() {
timeoutHeight = clienttypes.NewHeight(1, 110)
pathAtoB *customibctesting.Path
pathBtoC *customibctesting.Path
nativeDenom = "ppica"
ibcDenom = "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878"
assetID = sdk.DefaultBondDenom
expDenom = "ibc/3262D378E1636BE287EC355990D229DCEB828F0C60ED5049729575E235C60E8B"
)

testCases := []struct {
Expand All @@ -252,8 +259,9 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM() {
suite.coordinator.Setup(pathBtoC)

// Add parachain token info
senderAOriginalBalance := suite.chainA.AllBalances(suite.chainA.SenderAccount.GetAddress())
chainBtransMiddleware := suite.chainB.TransferMiddleware()
err := chainBtransMiddleware.AddParachainIBCInfo(suite.chainB.GetContext(), "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878", pathAtoB.EndpointB.ChannelID, sdk.DefaultBondDenom, sdk.DefaultBondDenom)
err := chainBtransMiddleware.AddParachainIBCInfo(suite.chainB.GetContext(), ibcDenom, pathAtoB.EndpointB.ChannelID, nativeDenom, assetID)
suite.Require().NoError(err)

testAcc := RandomAccountAddress(suite.T())
Expand All @@ -278,7 +286,7 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM() {
msg := transfertypes.NewMsgTransfer(
pathAtoB.EndpointA.ChannelConfig.PortID,
pathAtoB.EndpointA.ChannelID,
sdk.NewCoin(sdk.DefaultBondDenom, transferAmount),
sdk.NewCoin(assetID, transferAmount),
suite.chainA.SenderAccount.GetAddress().String(),
suite.chainB.SenderAccount.GetAddress().String(),
timeoutHeight,
Expand Down Expand Up @@ -317,6 +325,17 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM() {
suite.Require().NoError(err)
suite.chainB.PendingSendPackets = nil

// Check escrow address
escrowIbcDenomAddress := transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance := suite.chainB.AllBalances(escrowIbcDenomAddress)
expectBalance := sdk.NewCoins(sdk.NewCoin(ibcDenom, transferAmount))
suite.Require().Equal(expectBalance, escrowIbcDenomAddressBalance)

escrowNativeDenomAddress := transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance := suite.chainB.AllBalances(escrowNativeDenomAddress)
expectBalance = sdk.NewCoins(sdk.NewCoin(nativeDenom, transferAmount))
suite.Require().Equal(expectBalance, escrowNativeDenomAddressBalance)

// relay ack C to B
suite.Require().Equal(1, len(suite.chainC.PendingAckPackets))
ack := suite.chainC.PendingAckPackets[0]
Expand All @@ -341,9 +360,23 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFM() {
suite.Require().NoError(err)
suite.chainB.PendingAckPackets = nil

// Check escrow address
escrowIbcDenomAddress = transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance = suite.chainB.AllBalances(escrowIbcDenomAddress)
expectBalance = sdk.NewCoins(sdk.NewCoin(ibcDenom, transferAmount))
suite.Require().Equal(expectBalance, escrowIbcDenomAddressBalance)

escrowNativeDenomAddress = transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance = suite.chainB.AllBalances(escrowNativeDenomAddress)
expectBalance = sdk.NewCoins(sdk.NewCoin(nativeDenom, transferAmount))
suite.Require().Equal(expectBalance, escrowNativeDenomAddressBalance)

intermediaryBalance := suite.chainB.AllBalances(suite.chainB.SenderAccount.GetAddress())
suite.Require().Equal(intermediaryOriginalBalance, intermediaryBalance)
expDenom := "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878"

senderABalance := suite.chainA.AllBalances(suite.chainA.SenderAccount.GetAddress())
suite.Require().Equal(senderAOriginalBalance.Sub(sdk.NewCoin(assetID, transferAmount)), senderABalance)

expBalance := sdk.NewCoins(sdk.NewCoin(expDenom, transferAmount))
balance := suite.chainC.AllBalances(testAcc)
suite.Require().Equal(expBalance, balance)
Expand All @@ -358,14 +391,17 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse_ErrorAck()
timeoutHeight = clienttypes.NewHeight(1, 110)
pathAtoB *customibctesting.Path
pathBtoC *customibctesting.Path
expDenom = "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878"
nativeDenom = "ppica"
ibcDenom = "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878"
assetID = sdk.DefaultBondDenom
expDenom = "ibc/3262D378E1636BE287EC355990D229DCEB828F0C60ED5049729575E235C60E8B"
)

testCases := []struct {
name string
}{
{
"Success case Picasso -> Composable -> Osmosis and reverse from Osmosis -> Composable -> Picasso",
"Success transfer from Picasso -> Composable -> Osmosis and error reverse from Osmosis -> Composable -> Picasso",
},
}
for _, tc := range testCases {
Expand All @@ -383,7 +419,7 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse_ErrorAck()
_ = senderCOriginalBalance
// Add parachain token info
chainBtransMiddleware := suite.chainB.TransferMiddleware()
err := chainBtransMiddleware.AddParachainIBCInfo(suite.chainB.GetContext(), expDenom, pathAtoB.EndpointB.ChannelID, sdk.DefaultBondDenom, sdk.DefaultBondDenom)
err := chainBtransMiddleware.AddParachainIBCInfo(suite.chainB.GetContext(), ibcDenom, pathAtoB.EndpointB.ChannelID, nativeDenom, assetID)
suite.Require().NoError(err)

// Disable receiveEnabled on chain A so it will return error ack
Expand Down Expand Up @@ -413,7 +449,7 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse_ErrorAck()
msg := transfertypes.NewMsgTransfer(
pathAtoB.EndpointA.ChannelConfig.PortID,
pathAtoB.EndpointA.ChannelID,
sdk.NewCoin(sdk.DefaultBondDenom, transferAmount),
sdk.NewCoin(assetID, transferAmount),
suite.chainA.SenderAccount.GetAddress().String(),
suite.chainB.SenderAccount.GetAddress().String(),
timeoutHeight,
Expand All @@ -437,6 +473,17 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse_ErrorAck()
err = pathAtoB.EndpointB.RecvPacket(sendingPacket)
suite.Require().NoError(err)
suite.chainA.PendingSendPackets = nil
// Check escrow address
escrowIbcDenomAddress := transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance := suite.chainB.AllBalances(escrowIbcDenomAddress)
expBalance := sdk.NewCoins(sdk.NewCoin(ibcDenom, transferAmount))
suite.Require().Equal(expBalance, escrowIbcDenomAddressBalance)

escrowNativeDenomAddress := transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance := suite.chainB.AllBalances(escrowNativeDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(nativeDenom, transferAmount))
suite.Require().Equal(expBalance, escrowNativeDenomAddressBalance)

// then should have a packet from B to C
suite.Require().Equal(1, len(suite.chainB.PendingSendPackets))
suite.Require().Equal(0, len(suite.chainC.PendingSendPackets))
Expand Down Expand Up @@ -479,14 +526,14 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse_ErrorAck()
senderBCurrentBalance := suite.chainB.AllBalances(suite.chainB.SenderAccount.GetAddress())
suite.Require().Equal(senderBOriginalBalance, senderBCurrentBalance)

escrowIbcDenomAddress := transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance := suite.chainB.AllBalances(escrowIbcDenomAddress)
expBalance := sdk.NewCoins(sdk.NewCoin(expDenom, transferAmount))
escrowIbcDenomAddress = transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance = suite.chainB.AllBalances(escrowIbcDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(ibcDenom, transferAmount))
suite.Require().Equal(expBalance, escrowIbcDenomAddressBalance)

escrowNativeDenomAddress := transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance := suite.chainB.AllBalances(escrowNativeDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, transferAmount))
escrowNativeDenomAddress = transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance = suite.chainB.AllBalances(escrowNativeDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(nativeDenom, transferAmount))
suite.Require().Equal(expBalance, escrowNativeDenomAddressBalance)

balance := suite.chainC.AllBalances(suite.chainC.SenderAccount.GetAddress())
Expand Down Expand Up @@ -539,6 +586,14 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse_ErrorAck()
err = pathBtoC.EndpointA.RecvPacket(sendingPacket)
suite.Require().NoError(err)
suite.chainC.PendingSendPackets = nil
// Check escrow address
escrowIbcDenomAddress = transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance = suite.chainB.AllBalances(escrowIbcDenomAddress)
suite.Require().Empty(escrowIbcDenomAddressBalance)

escrowNativeDenomAddress = transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance = suite.chainB.AllBalances(escrowNativeDenomAddress)
suite.Require().Empty(escrowNativeDenomAddressBalance)

// then should have a packet from B to A
suite.Require().Equal(1, len(suite.chainB.PendingSendPackets))
Expand Down Expand Up @@ -590,12 +645,12 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse_ErrorAck()

escrowIbcDenomAddress = transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance = suite.chainB.AllBalances(escrowIbcDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(expDenom, transferAmount))
expBalance = sdk.NewCoins(sdk.NewCoin(ibcDenom, transferAmount))
suite.Require().Equal(expBalance, escrowIbcDenomAddressBalance)

escrowNativeDenomAddress = transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance = suite.chainB.AllBalances(escrowNativeDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, transferAmount))
expBalance = sdk.NewCoins(sdk.NewCoin(nativeDenom, transferAmount))
suite.Require().Equal(expBalance, escrowNativeDenomAddressBalance)
})
}
Expand All @@ -608,7 +663,10 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse() {
timeoutHeight = clienttypes.NewHeight(1, 110)
pathAtoB *customibctesting.Path
pathBtoC *customibctesting.Path
expDenom = "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878"
nativeDenom = "ppica"
ibcDenom = "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878"
assetID = sdk.DefaultBondDenom
expDenom = "ibc/3262D378E1636BE287EC355990D229DCEB828F0C60ED5049729575E235C60E8B"
)

testCases := []struct {
Expand All @@ -630,7 +688,7 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse() {
senderCOriginalBalance := suite.chainC.AllBalances(suite.chainC.SenderAccount.GetAddress())
// Add parachain token info
chainBtransMiddleware := suite.chainB.TransferMiddleware()
err := chainBtransMiddleware.AddParachainIBCInfo(suite.chainB.GetContext(), expDenom, pathAtoB.EndpointB.ChannelID, sdk.DefaultBondDenom, sdk.DefaultBondDenom)
err := chainBtransMiddleware.AddParachainIBCInfo(suite.chainB.GetContext(), ibcDenom, pathAtoB.EndpointB.ChannelID, nativeDenom, assetID)
suite.Require().NoError(err)

timeOut := 10 * time.Minute
Expand All @@ -652,7 +710,7 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse() {
msg := transfertypes.NewMsgTransfer(
pathAtoB.EndpointA.ChannelConfig.PortID,
pathAtoB.EndpointA.ChannelID,
sdk.NewCoin(sdk.DefaultBondDenom, transferAmount),
sdk.NewCoin(assetID, transferAmount),
suite.chainA.SenderAccount.GetAddress().String(),
suite.chainB.SenderAccount.GetAddress().String(),
timeoutHeight,
Expand All @@ -676,6 +734,17 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse() {
err = pathAtoB.EndpointB.RecvPacket(sendingPacket)
suite.Require().NoError(err)
suite.chainA.PendingSendPackets = nil
// Check escrow address
escrowIbcDenomAddress := transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance := suite.chainB.AllBalances(escrowIbcDenomAddress)
expBalance := sdk.NewCoins(sdk.NewCoin(ibcDenom, transferAmount))
suite.Require().Equal(expBalance, escrowIbcDenomAddressBalance)

escrowNativeDenomAddress := transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance := suite.chainB.AllBalances(escrowNativeDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(nativeDenom, transferAmount))
suite.Require().Equal(expBalance, escrowNativeDenomAddressBalance)

// then should have a packet from B to C
suite.Require().Equal(1, len(suite.chainB.PendingSendPackets))
suite.Require().Equal(0, len(suite.chainC.PendingSendPackets))
Expand Down Expand Up @@ -718,14 +787,14 @@ func (suite *TransferMiddlewareTestSuite) TestTransferWithPFMReverse() {
senderBCurrentBalance := suite.chainB.AllBalances(suite.chainB.SenderAccount.GetAddress())
suite.Require().Equal(senderBOriginalBalance, senderBCurrentBalance)

escrowIbcDenomAddress := transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance := suite.chainB.AllBalances(escrowIbcDenomAddress)
expBalance := sdk.NewCoins(sdk.NewCoin(expDenom, transferAmount))
escrowIbcDenomAddress = transfertypes.GetEscrowAddress(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)
escrowIbcDenomAddressBalance = suite.chainB.AllBalances(escrowIbcDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(ibcDenom, transferAmount))
suite.Require().Equal(expBalance, escrowIbcDenomAddressBalance)

escrowNativeDenomAddress := transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance := suite.chainB.AllBalances(escrowNativeDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, transferAmount))
escrowNativeDenomAddress = transfertypes.GetEscrowAddress(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID)
escrowNativeDenomAddressBalance = suite.chainB.AllBalances(escrowNativeDenomAddress)
expBalance = sdk.NewCoins(sdk.NewCoin(nativeDenom, transferAmount))
suite.Require().Equal(expBalance, escrowNativeDenomAddressBalance)

balance := suite.chainC.AllBalances(suite.chainC.SenderAccount.GetAddress())
Expand Down

0 comments on commit 1bc799b

Please sign in to comment.