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

chore: bump ics29 to tip of main #900

Merged
merged 60 commits into from
Feb 10, 2022
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
0a7ad9b
removing unused proto imports in interchain-accounts (#718)
damiannolan Jan 12, 2022
dd9c385
Merge pull request #721 from cosmos/colin/694-fix-err-msg
colin-axner Jan 13, 2022
d882b43
refactor: move ica connection identifiers from port to version metada…
damiannolan Jan 13, 2022
a4b9517
make IsValidAddr private and extend regex to account for 0 length str…
colin-axner Jan 13, 2022
5f4a90c
Update LICENSE (#728)
crodriguezvega Jan 13, 2022
5b7d362
refactor: allow ICA authentication module provided timeout timestamp …
colin-axner Jan 13, 2022
b0b52a3
Fix ambiguity in TimeoutTimestamp docs (#715)
assafmo Jan 13, 2022
e2693b0
bump docs json lock file to fix security vulnerability (#727)
colin-axner Jan 14, 2022
e28b6d1
fix: gogoproto yaml (#732)
seantking Jan 14, 2022
7415da7
refactor: no longer removing active channel mapping on close channel …
seantking Jan 14, 2022
8924ee6
refactor: reusable metadata validation (#729)
damiannolan Jan 14, 2022
e2ac503
remove amino, enforce serialize and deserialize functions to only acc…
colin-axner Jan 14, 2022
87bb391
fix: update IsRevisionFormat and IsClientIDFormat to account for newl…
colin-axner Jan 17, 2022
87b058d
add goreleaser github action to attach simd binary to releases and pr…
crodriguezvega Jan 18, 2022
bfcf9ab
docs: ica tx atomicity docs and code snippet updates (#719)
damiannolan Jan 18, 2022
89ffaaf
deps: bump vuepress-theme-cosmos (#754)
crodriguezvega Jan 18, 2022
4fb75e8
fix: remove error from ics27 channel ack (#751)
damiannolan Jan 20, 2022
60ed992
feat: adding helper fn to generate capability name for testing (#776)
seantking Jan 21, 2022
a6656a0
test: adding test for accessing interchain account after closing chan…
seantking Jan 21, 2022
f822756
Replace github.com/pkg/errors with stdlib errors (#775)
dkmccandless Jan 21, 2022
01c5848
update roadmap (#735)
crodriguezvega Jan 22, 2022
e19623f
fix: resolve proto lint failure - buf.yaml (#781)
damiannolan Jan 24, 2022
d7bf2a8
feat: query host chain msg events via cli (#782)
damiannolan Jan 24, 2022
1da4885
docs: add MakeFile command to view docs locally (#788)
seantking Jan 26, 2022
8dfbc9c
fix: support custom chain IDs for testing (#774)
ramacarlucho Jan 26, 2022
3e6464b
chore: renaming API fns (#786)
seantking Jan 27, 2022
640ba14
build(deps): bump google.golang.org/grpc from 1.43.0 to 1.44.0 (#796)
dependabot[bot] Jan 27, 2022
4f70554
chore: restructure code logically (#804)
colin-axner Jan 27, 2022
19b5b5f
refactor: construct ics27 error acknowledgement with determinstic ABC…
colin-axner Jan 28, 2022
3c2f2eb
docs: active channel description (#787)
seantking Jan 28, 2022
54dc848
add helper function in testing package: RecvPacketWithResult (#810)
colin-axner Jan 28, 2022
f393893
chore: use connection ID in interchain account store keys (#791)
damiannolan Jan 28, 2022
90a175e
chore: remove unnecessary arg from RelayPacket testing function (#813)
colin-axner Jan 28, 2022
1c0bee5
chore: use host chain connection id in ica address generation (#790)
damiannolan Jan 28, 2022
d8c74f4
docs: adding ica docs for exclusive submodule app wiring (#809)
damiannolan Jan 28, 2022
25fb89d
Defensive checks for active channel (#785)
seantking Jan 31, 2022
20e5dd9
Add stable release policy (#685)
colin-axner Feb 1, 2022
f7bb142
build(deps): bump github.com/cosmos/cosmos-sdk from 0.44.5 to 0.45.0 …
dependabot[bot] Feb 2, 2022
8cba0eb
rename portid and port prefix for interchain accounts submodules (#779)
crodriguezvega Feb 2, 2022
83c3e41
test: adding ica test for multiple controllers, single host (#816)
damiannolan Feb 2, 2022
142056f
the ica_auth page was renamed to auth-modules (#792)
crodriguezvega Feb 2, 2022
ac46ac0
chore: replace error string in transfer acks with const (#818)
damiannolan Feb 2, 2022
4c28c1c
refactor: active channel key format (#823)
seantking Feb 2, 2022
fed6a86
refactor: RegisterInterchainAccount (#814)
seantking Feb 2, 2022
bbcc09c
refactor: reformat KeyOwnerAccount (#833)
seantking Feb 2, 2022
5ae8e35
chore: adding encoding and txType fields to metadata (#824)
damiannolan Feb 2, 2022
6c48f7e
refactor: include transaction response in ics27 channel acknowledgeme…
colin-axner Feb 2, 2022
1021617
ADR 003: ICS27 Ack format (#812)
colin-axner Feb 3, 2022
c7ea0e8
test: ensure ics27 optimistic packet sends are disallowed (#842)
damiannolan Feb 3, 2022
ec36c75
docs: add security model to ics27 docs (#841)
colin-axner Feb 3, 2022
f6a9279
test: Register using same owner address on multiple connections (#846)
seantking Feb 4, 2022
81b619d
Move emissions to functions (#783)
nir1218 Feb 7, 2022
7b7eb9f
Added ChannelId to MsgChannelOpenInitResponse (#848)
rigelrozanski Feb 7, 2022
c378ff3
build(deps): bump github.com/cosmos/cosmos-sdk from 0.45.0 to 0.45.1 …
dependabot[bot] Feb 7, 2022
31487bc
fix: ica host OnRecvPacket error acknowledgement (#885)
damiannolan Feb 8, 2022
482b7ab
chore: add defensive check to ensure metadata does not change when re…
colin-axner Feb 8, 2022
acbc9b6
refactor: WriteAcknowledgement API (#882)
seantking Feb 9, 2022
d5e2ba5
bug: use custom ante handler to reject redundant transactions in sima…
crodriguezvega Feb 9, 2022
8f62a47
refactor: allow the mock module to be used multiple times as base ibc…
colin-axner Feb 10, 2022
e0161a7
Merge branch 'main' of github.com:cosmos/ibc-go into ics29-fee-middle…
colin-axner Feb 10, 2022
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
Prev Previous commit
Next Next commit
test: adding test for accessing interchain account after closing chan…
…nel (#736)

* test: adding test for accessing interchain account after closing channel

* fix packet commitment does not exist bug

Packet commitment hash was not matching due to non zero timeout height

* test: send another packet on the newly created channel

* nit: update comments

* nits: update test and move to top level

* nit: don't discard err

Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com>
  • Loading branch information
seantking and colin-axner authored Jan 21, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit a6656a0dcae78faa4dcf48a1610665e03b9f7408
97 changes: 97 additions & 0 deletions modules/apps/27-interchain-accounts/host/ibc_module_test.go
Original file line number Diff line number Diff line change
@@ -590,3 +590,100 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() {
})
}
}

func (suite *InterchainAccountsTestSuite) fundICAWallet(ctx sdk.Context, portID string, amount sdk.Coins) {
interchainAccountAddr, found := suite.chainB.GetSimApp().ICAHostKeeper.GetInterchainAccountAddress(ctx, portID)
suite.Require().True(found)

msgBankSend := &banktypes.MsgSend{
FromAddress: suite.chainB.SenderAccount.GetAddress().String(),
ToAddress: interchainAccountAddr,
Amount: amount,
}

res, err := suite.chainB.SendMsgs(msgBankSend)
suite.Require().NotEmpty(res)
suite.Require().NoError(err)
}

// TestControlAccountAfterChannelClose tests that a controller chain can control a registered interchain account after the currently active channel for that interchain account has been closed
// by opening a new channel on the associated portID
func (suite *InterchainAccountsTestSuite) TestControlAccountAfterChannelClose() {
// create channel + init interchain account on a particular port
path := NewICAPath(suite.chainA, suite.chainB)
suite.coordinator.SetupConnections(path)
err := SetupICAPath(path, TestOwnerAddress)
suite.Require().NoError(err)

// check that the account is working as expected
suite.fundICAWallet(suite.chainB.GetContext(), path.EndpointA.ChannelConfig.PortID, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(10000))))
interchainAccountAddr, found := suite.chainB.GetSimApp().ICAHostKeeper.GetInterchainAccountAddress(suite.chainB.GetContext(), path.EndpointA.ChannelConfig.PortID)
suite.Require().True(found)

tokenAmt := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5000)))
msg := &banktypes.MsgSend{
FromAddress: interchainAccountAddr,
ToAddress: suite.chainB.SenderAccount.GetAddress().String(),
Amount: tokenAmt,
}

data, err := icatypes.SerializeCosmosTx(suite.chainA.GetSimApp().AppCodec(), []sdk.Msg{msg})
suite.Require().NoError(err)

icaPacketData := icatypes.InterchainAccountPacketData{
Type: icatypes.EXECUTE_TX,
Data: data,
}

params := types.NewParams(true, []string{sdk.MsgTypeURL(msg)})
suite.chainB.GetSimApp().ICAHostKeeper.SetParams(suite.chainB.GetContext(), params)

chanCap, ok := suite.chainA.GetSimApp().ScopedICAMockKeeper.GetCapability(path.EndpointA.Chain.GetContext(), host.ChannelCapabilityPath(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID))
suite.Require().True(ok)

_, err = suite.chainA.GetSimApp().ICAControllerKeeper.TrySendTx(suite.chainA.GetContext(), chanCap, path.EndpointA.ChannelConfig.PortID, icaPacketData, ^uint64(0))
suite.Require().NoError(err)
path.EndpointB.UpdateClient()

// relay the packet
packetRelay := channeltypes.NewPacket(icaPacketData.GetBytes(), 1, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, clienttypes.ZeroHeight(), ^uint64(0))
ack := channeltypes.NewResultAcknowledgement([]byte{byte(1)})
err = path.RelayPacket(packetRelay, ack.Acknowledgement())
suite.Require().NoError(err) // relay committed

// check that the ica balance is updated
icaAddr, err := sdk.AccAddressFromBech32(interchainAccountAddr)
suite.Require().NoError(err)

hasBalance := suite.chainB.GetSimApp().BankKeeper.HasBalance(suite.chainB.GetContext(), icaAddr, sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(5000)})
suite.Require().True(hasBalance)

// close the channel
err = path.EndpointA.SetChannelClosed()
suite.Require().NoError(err)
err = path.EndpointB.SetChannelClosed()
suite.Require().NoError(err)

// open a new channel on the same port
path.EndpointA.ChannelID = ""
path.EndpointB.ChannelID = ""
suite.coordinator.CreateChannels(path)

// try to control the interchain account again
chanCap, ok = suite.chainA.GetSimApp().ScopedICAMockKeeper.GetCapability(path.EndpointA.Chain.GetContext(), host.ChannelCapabilityPath(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID))
suite.Require().True(ok)

_, err = suite.chainA.GetSimApp().ICAControllerKeeper.TrySendTx(suite.chainA.GetContext(), chanCap, path.EndpointA.ChannelConfig.PortID, icaPacketData, ^uint64(0))
suite.Require().NoError(err)
path.EndpointB.UpdateClient()

// relay the packet
packetRelay = channeltypes.NewPacket(icaPacketData.GetBytes(), 1, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, clienttypes.ZeroHeight(), ^uint64(0))
ack = channeltypes.NewResultAcknowledgement([]byte{byte(1)})
err = path.RelayPacket(packetRelay, ack.Acknowledgement())
suite.Require().NoError(err) // relay committed

// check that the ica balance is updated
hasBalance = suite.chainB.GetSimApp().BankKeeper.HasBalance(suite.chainB.GetContext(), icaAddr, sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(0)})
suite.Require().True(hasBalance)
}