diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 9cb089d1f239..8b6a60b1fa26 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -39,3 +39,4 @@ ____ - [ ] Not duplicate issue - [ ] Appropriate labels applied - [ ] Appropriate contributors tagged/assigned +- [ ] Estimate provided \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 4e7e7aa42dcc..243feb36cd89 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -37,3 +37,4 @@ ____ - [ ] Not duplicate issue - [ ] Appropriate labels applied - [ ] Appropriate contributors tagged/assigned +- [ ] Estimate provided diff --git a/.github/compatibility-test-matrices/release-v7.8.x/client-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/client-chain-a.json new file mode 100644 index 000000000000..ee10af4c1ab1 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/client-chain-a.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestClientTestSuite" + ], + "test": [ + "TestClient_Update_Misbehaviour", + "TestAllowedClientsParam" + ], + "relayer-type": [ + "hermes" + ] +} diff --git a/.github/compatibility-test-matrices/release-v7.8.x/connection-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/connection-chain-a.json new file mode 100644 index 000000000000..4b1371ed73c2 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/connection-chain-a.json @@ -0,0 +1,17 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestConnectionTestSuite" + ], + "test": [ + "TestMaxExpectedTimePerBlockParam" + ], + "relayer-type": [ + "hermes" + ] +} diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-chain-a.json new file mode 100644 index 000000000000..8d5346909742 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-chain-a.json @@ -0,0 +1,26 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer", + "TestMsgSendTx_FailedTransfer_InsufficientFunds", + "TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA", + "TestControllerEnabledParam" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-chain-b.json new file mode 100644 index 000000000000..7548c5aff2b6 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-chain-b.json @@ -0,0 +1,26 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer", + "TestMsgSendTx_FailedTransfer_InsufficientFunds", + "TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA", + "TestHostEnabledParam" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-gov-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-gov-chain-a.json new file mode 100644 index 000000000000..280ff71a44f9 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-gov-chain-a.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsGovTestSuite" + ], + "test": [ + "TestInterchainAccountsGovIntegration" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-gov-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-gov-chain-b.json new file mode 100644 index 000000000000..a3ee58294384 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-gov-chain-b.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsGovTestSuite" + ], + "test": [ + "TestInterchainAccountsGovIntegration" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-groups-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-groups-chain-a.json new file mode 100644 index 000000000000..80af55872101 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-groups-chain-a.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsGroupsTestSuite" + ], + "test": [ + "TestInterchainAccountsGroupsIntegration" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-groups-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-groups-chain-b.json new file mode 100644 index 000000000000..cb9628633156 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-groups-chain-b.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsGroupsTestSuite" + ], + "test": [ + "TestInterchainAccountsGroupsIntegration" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-queries-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-queries-chain-a.json new file mode 100644 index 000000000000..b8bb98ec2664 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-queries-chain-a.json @@ -0,0 +1,20 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v7.7.0", + "v7.6.0", + "v7.5.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsQueryTestSuite" + ], + "test": [ + "TestInterchainAccountsQuery" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-queries-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-queries-chain-b.json new file mode 100644 index 000000000000..03695e4d3ec7 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-queries-chain-b.json @@ -0,0 +1,20 @@ +{ + "chain-a": [ + "v7.7.0", + "v7.6.0", + "v7.5.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsQueryTestSuite" + ], + "test": [ + "TestInterchainAccountsQuery" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-unordered-channel-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-unordered-channel-chain-a.json new file mode 100644 index 000000000000..0c725f8c0fdd --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-unordered-channel-chain-a.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_UnorderedChannel" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/ica-unordered-channel-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/ica-unordered-channel-chain-b.json new file mode 100644 index 000000000000..632a2bb66ba2 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/ica-unordered-channel-chain-b.json @@ -0,0 +1,18 @@ +{ + "chain-a": [ + "v8.4.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_UnorderedChannel" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/incentivized-ica-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/incentivized-ica-chain-a.json new file mode 100644 index 000000000000..47f4a37be22d --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/incentivized-ica-chain-a.json @@ -0,0 +1,24 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestIncentivizedInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulBankSend_Incentivized", + "TestMsgSendTx_FailedBankSend_Incentivized" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/incentivized-ica-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/incentivized-ica-chain-b.json new file mode 100644 index 000000000000..3fc7290b6436 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/incentivized-ica-chain-b.json @@ -0,0 +1,24 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestIncentivizedInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulBankSend_Incentivized", + "TestMsgSendTx_FailedBankSend_Incentivized" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/incentivized-transfer-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/incentivized-transfer-chain-a.json new file mode 100644 index 000000000000..04c5fe9d9994 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/incentivized-transfer-chain-a.json @@ -0,0 +1,30 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "v5.4.0", + "v4.6.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestIncentivizedTransferTestSuite" + ], + "test": [ + "TestMsgPayPacketFee_AsyncSingleSender_Succeeds", + "TestMsgPayPacketFee_InvalidReceiverAccount", + "TestMultiMsg_MsgPayPacketFeeSingleSender", + "TestMsgPayPacketFee_SingleSender_TimesOut", + "TestPayPacketFeeAsync_SingleSender_NoCounterPartyAddress", + "TestMsgPayPacketFee_AsyncMultipleSenders_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/incentivized-transfer-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/incentivized-transfer-chain-b.json new file mode 100644 index 000000000000..07689c63072e --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/incentivized-transfer-chain-b.json @@ -0,0 +1,30 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "v5.4.0", + "v4.6.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestIncentivizedTransferTestSuite" + ], + "test": [ + "TestMsgPayPacketFee_AsyncSingleSender_Succeeds", + "TestMsgPayPacketFee_InvalidReceiverAccount", + "TestMultiMsg_MsgPayPacketFeeSingleSender", + "TestMsgPayPacketFee_SingleSender_TimesOut", + "TestPayPacketFeeAsync_SingleSender_NoCounterPartyAddress", + "TestMsgPayPacketFee_AsyncMultipleSenders_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/localhost-ica-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/localhost-ica-chain-a.json new file mode 100644 index 000000000000..c6b4dfc7d90a --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/localhost-ica-chain-a.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "release-v7.8.x" + ], + "entrypoint": [ + "LocalhostInterchainAccountsTestSuite" + ], + "test": [ + "TestInterchainAccounts_Localhost", + "TestInterchainAccounts_ReopenChannel_Localhost" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/localhost-transfer-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/localhost-transfer-chain-a.json new file mode 100644 index 000000000000..1a341946ebe0 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/localhost-transfer-chain-a.json @@ -0,0 +1,22 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "release-v7.8.x" + ], + "entrypoint": [ + "LocalhostTransferTestSuite" + ], + "test": [ + "TestMsgTransfer_Localhost" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/transfer-authz-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/transfer-authz-chain-a.json new file mode 100644 index 000000000000..1b25fe70856d --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/transfer-authz-chain-a.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestAuthzTransferTestSuite" + ], + "test": [ + "TestAuthz_MsgTransfer_Succeeds", + "TestAuthz_InvalidTransferAuthorizations" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/transfer-authz-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/transfer-authz-chain-b.json new file mode 100644 index 000000000000..06034306cd6e --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/transfer-authz-chain-b.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestAuthzTransferTestSuite" + ], + "test": [ + "TestAuthz_MsgTransfer_Succeeds", + "TestAuthz_InvalidTransferAuthorizations" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/transfer-chain-a.json b/.github/compatibility-test-matrices/release-v7.8.x/transfer-chain-a.json new file mode 100644 index 000000000000..7df2f0941726 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/transfer-chain-a.json @@ -0,0 +1,32 @@ +{ + "chain-a": [ + "release-v7.8.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "v5.4.0", + "v4.6.0", + "v3.4.0", + "v2.5.0", + "release-v7.8.x" + ], + "entrypoint": [ + "TestTransferTestSuite" + ], + "test": [ + "TestMsgTransfer_Succeeds_Nonincentivized", + "TestMsgTransfer_Fails_InvalidAddress", + "TestMsgTransfer_Timeout_Nonincentivized", + "TestMsgTransfer_WithMemo", + "TestSendEnabledParam", + "TestReceiveEnabledParam" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v7.8.x/transfer-chain-b.json b/.github/compatibility-test-matrices/release-v7.8.x/transfer-chain-b.json new file mode 100644 index 000000000000..5028ea428d6a --- /dev/null +++ b/.github/compatibility-test-matrices/release-v7.8.x/transfer-chain-b.json @@ -0,0 +1,31 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "v5.4.0", + "v4.6.0", + "v3.4.0", + "v2.5.0", + "release-v7.8.x" + ], + "chain-b": [ + "release-v7.8.x" + ], + "entrypoint": [ + "TestTransferTestSuite" + ], + "test": [ + "TestMsgTransfer_Succeeds_Nonincentivized", + "TestMsgTransfer_Fails_InvalidAddress", + "TestMsgTransfer_Timeout_Nonincentivized", + "TestMsgTransfer_WithMemo", + "TestMsgTransfer_EntireBalance" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.4.x/ica-queries-chain-b.json b/.github/compatibility-test-matrices/release-v8.4.x/ica-queries-chain-b.json index f00e20ef1c9b..0ca69de04da7 100644 --- a/.github/compatibility-test-matrices/release-v8.4.x/ica-queries-chain-b.json +++ b/.github/compatibility-test-matrices/release-v8.4.x/ica-queries-chain-b.json @@ -1,12 +1,12 @@ { "chain-a": [ + "v8.4.0", "v7.7.0", "v7.6.0", "v7.5.0", "release-v8.4.x" ], "chain-b": [ - "v8.4.0", "release-v8.4.x" ], "entrypoint": [ diff --git a/.github/compatibility-test-matrices/release-v8.5.x/client-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/client-chain-a.json new file mode 100644 index 000000000000..929400b33195 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/client-chain-a.json @@ -0,0 +1,20 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestClientTestSuite" + ], + "test": [ + "TestRecoverClient_Succeeds", + "TestScheduleIBCUpgrade_Succeeds", + "TestClient_Update_Misbehaviour", + "TestAllowedClientsParam" + ], + "relayer-type": [ + "hermes" + ] +} diff --git a/.github/compatibility-test-matrices/release-v8.5.x/connection-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/connection-chain-a.json new file mode 100644 index 000000000000..0377638e340e --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/connection-chain-a.json @@ -0,0 +1,17 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestConnectionTestSuite" + ], + "test": [ + "TestMaxExpectedTimePerBlockParam" + ], + "relayer-type": [ + "hermes" + ] +} diff --git a/.github/compatibility-test-matrices/release-v8.5.x/genesis-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/genesis-chain-a.json new file mode 100644 index 000000000000..f94fd73f5028 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/genesis-chain-a.json @@ -0,0 +1,17 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestGenesisTestSuite" + ], + "test": [ + "TestIBCGenesis" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-chain-a.json new file mode 100644 index 000000000000..ae684f494352 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-chain-a.json @@ -0,0 +1,26 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer", + "TestMsgSendTx_FailedTransfer_InsufficientFunds", + "TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA", + "TestControllerEnabledParam" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-chain-b.json new file mode 100644 index 000000000000..7b0f84ef666a --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-chain-b.json @@ -0,0 +1,26 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer", + "TestMsgSendTx_FailedTransfer_InsufficientFunds", + "TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA", + "TestHostEnabledParam" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-channel-upgrade-chain-a.json new file mode 100644 index 000000000000..f2dfd6714f07 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-channel-upgrade-chain-a.json @@ -0,0 +1,19 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsChannelUpgradesTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered", + "TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-channel-upgrade-chain-b.json new file mode 100644 index 000000000000..94626e60a9a7 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-channel-upgrade-chain-b.json @@ -0,0 +1,19 @@ +{ + "chain-a": [ + "v8.4.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsChannelUpgradesTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_AfterUpgradingOrdertoUnordered", + "TestChannelUpgrade_ICAChannelClosesAfterTimeout_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-gov-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-gov-chain-a.json new file mode 100644 index 000000000000..e47438d43dbd --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-gov-chain-a.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsGovTestSuite" + ], + "test": [ + "TestInterchainAccountsGovIntegration" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-gov-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-gov-chain-b.json new file mode 100644 index 000000000000..c3bc5a089cf4 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-gov-chain-b.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsGovTestSuite" + ], + "test": [ + "TestInterchainAccountsGovIntegration" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-groups-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-groups-chain-a.json new file mode 100644 index 000000000000..4b089c06ec18 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-groups-chain-a.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsGroupsTestSuite" + ], + "test": [ + "TestInterchainAccountsGroupsIntegration" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-groups-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-groups-chain-b.json new file mode 100644 index 000000000000..43a3676f1951 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-groups-chain-b.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsGroupsTestSuite" + ], + "test": [ + "TestInterchainAccountsGroupsIntegration" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-queries-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-queries-chain-a.json new file mode 100644 index 000000000000..90d6235d1373 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-queries-chain-a.json @@ -0,0 +1,21 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsQueryTestSuite" + ], + "test": [ + "TestInterchainAccountsQuery" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-queries-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-queries-chain-b.json new file mode 100644 index 000000000000..66fd343c5087 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-queries-chain-b.json @@ -0,0 +1,21 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsQueryTestSuite" + ], + "test": [ + "TestInterchainAccountsQuery" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-unordered-channel-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-unordered-channel-chain-a.json new file mode 100644 index 000000000000..3c584dd135ea --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-unordered-channel-chain-a.json @@ -0,0 +1,21 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_UnorderedChannel" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/ica-unordered-channel-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/ica-unordered-channel-chain-b.json new file mode 100644 index 000000000000..0b1430a571d4 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/ica-unordered-channel-chain-b.json @@ -0,0 +1,21 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulTransfer_UnorderedChannel" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/incentivized-ica-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/incentivized-ica-chain-a.json new file mode 100644 index 000000000000..7bc899c42983 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/incentivized-ica-chain-a.json @@ -0,0 +1,24 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestIncentivizedInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulBankSend_Incentivized", + "TestMsgSendTx_FailedBankSend_Incentivized" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/incentivized-ica-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/incentivized-ica-chain-b.json new file mode 100644 index 000000000000..73307a385cb7 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/incentivized-ica-chain-b.json @@ -0,0 +1,24 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestIncentivizedInterchainAccountsTestSuite" + ], + "test": [ + "TestMsgSendTx_SuccessfulBankSend_Incentivized", + "TestMsgSendTx_FailedBankSend_Incentivized" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/incentivized-transfer-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/incentivized-transfer-chain-a.json new file mode 100644 index 000000000000..ebdf7db6835f --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/incentivized-transfer-chain-a.json @@ -0,0 +1,30 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "v5.4.0", + "v4.6.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestIncentivizedTransferTestSuite" + ], + "test": [ + "TestMsgPayPacketFee_AsyncSingleSender_Succeeds", + "TestMsgPayPacketFee_InvalidReceiverAccount", + "TestMultiMsg_MsgPayPacketFeeSingleSender", + "TestMsgPayPacketFee_SingleSender_TimesOut", + "TestPayPacketFeeAsync_SingleSender_NoCounterPartyAddress", + "TestMsgPayPacketFee_AsyncMultipleSenders_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/incentivized-transfer-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/incentivized-transfer-chain-b.json new file mode 100644 index 000000000000..ee4b931996b1 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/incentivized-transfer-chain-b.json @@ -0,0 +1,30 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "v5.4.0", + "v4.6.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestIncentivizedTransferTestSuite" + ], + "test": [ + "TestMsgPayPacketFee_AsyncSingleSender_Succeeds", + "TestMsgPayPacketFee_InvalidReceiverAccount", + "TestMultiMsg_MsgPayPacketFeeSingleSender", + "TestMsgPayPacketFee_SingleSender_TimesOut", + "TestPayPacketFeeAsync_SingleSender_NoCounterPartyAddress", + "TestMsgPayPacketFee_AsyncMultipleSenders_Succeeds" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/localhost-ica-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/localhost-ica-chain-a.json new file mode 100644 index 000000000000..f93b5ce25842 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/localhost-ica-chain-a.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "release-v8.5.x" + ], + "entrypoint": [ + "LocalhostInterchainAccountsTestSuite" + ], + "test": [ + "TestInterchainAccounts_Localhost", + "TestInterchainAccounts_ReopenChannel_Localhost" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/localhost-transfer-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/localhost-transfer-chain-a.json new file mode 100644 index 000000000000..9ab7023b6530 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/localhost-transfer-chain-a.json @@ -0,0 +1,22 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "release-v8.5.x" + ], + "entrypoint": [ + "LocalhostTransferTestSuite" + ], + "test": [ + "TestMsgTransfer_Localhost" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/transfer-authz-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/transfer-authz-chain-a.json new file mode 100644 index 000000000000..0d2e396eaea9 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/transfer-authz-chain-a.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestAuthzTransferTestSuite" + ], + "test": [ + "TestAuthz_MsgTransfer_Succeeds", + "TestAuthz_InvalidTransferAuthorizations" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/transfer-authz-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/transfer-authz-chain-b.json new file mode 100644 index 000000000000..32fe156fcbc7 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/transfer-authz-chain-b.json @@ -0,0 +1,23 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestAuthzTransferTestSuite" + ], + "test": [ + "TestAuthz_MsgTransfer_Succeeds", + "TestAuthz_InvalidTransferAuthorizations" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/transfer-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/transfer-chain-a.json new file mode 100644 index 000000000000..9a252e671033 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/transfer-chain-a.json @@ -0,0 +1,32 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "v5.4.0", + "v4.6.0", + "v3.4.0", + "v2.5.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestTransferTestSuite" + ], + "test": [ + "TestMsgTransfer_Succeeds_Nonincentivized", + "TestMsgTransfer_Fails_InvalidAddress", + "TestMsgTransfer_Timeout_Nonincentivized", + "TestMsgTransfer_WithMemo", + "TestSendEnabledParam", + "TestReceiveEnabledParam" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/transfer-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/transfer-chain-b.json new file mode 100644 index 000000000000..789ae395b27b --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/transfer-chain-b.json @@ -0,0 +1,31 @@ +{ + "chain-a": [ + "v8.4.0", + "v7.7.0", + "v7.6.0", + "v7.5.0", + "v7.4.0", + "v6.3.0", + "v5.4.0", + "v4.6.0", + "v3.4.0", + "v2.5.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestTransferTestSuite" + ], + "test": [ + "TestMsgTransfer_Succeeds_Nonincentivized", + "TestMsgTransfer_Fails_InvalidAddress", + "TestMsgTransfer_Timeout_Nonincentivized", + "TestMsgTransfer_WithMemo", + "TestMsgTransfer_EntireBalance" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/transfer-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/release-v8.5.x/transfer-channel-upgrade-chain-a.json new file mode 100644 index 000000000000..34753a18aa8b --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/transfer-channel-upgrade-chain-a.json @@ -0,0 +1,20 @@ +{ + "chain-a": [ + "release-v8.5.x" + ], + "chain-b": [ + "v8.4.0", + "release-v8.5.x" + ], + "entrypoint": [ + "TestTransferChannelUpgradesTestSuite" + ], + "test": [ + "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/release-v8.5.x/transfer-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/release-v8.5.x/transfer-channel-upgrade-chain-b.json new file mode 100644 index 000000000000..3c1f68985dd4 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v8.5.x/transfer-channel-upgrade-chain-b.json @@ -0,0 +1,20 @@ +{ + "chain-a": [ + "v8.4.0", + "release-v8.5.x" + ], + "chain-b": [ + "release-v8.5.x" + ], + "entrypoint": [ + "TestTransferChannelUpgradesTestSuite" + ], + "test": [ + "TestChannelUpgrade_WithFeeMiddleware_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_CrossingHello_Succeeds", + "TestChannelUpgrade_WithFeeMiddleware_FailsWithTimeoutOnAck" + ], + "relayer-type": [ + "hermes" + ] +} \ No newline at end of file diff --git a/.github/compatibility-test-matrices/unreleased/client-1.json b/.github/compatibility-test-matrices/unreleased/client-1.json index 7bc2bc6e477d..e45ba2f2c62c 100644 --- a/.github/compatibility-test-matrices/unreleased/client-1.json +++ b/.github/compatibility-test-matrices/unreleased/client-1.json @@ -1,11 +1,13 @@ { "chain-a": [ + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", "release-v7.4.x" ], "chain-b": [ + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/client-2.json b/.github/compatibility-test-matrices/unreleased/client-2.json index b3835740d5ce..866b148d1e5a 100644 --- a/.github/compatibility-test-matrices/unreleased/client-2.json +++ b/.github/compatibility-test-matrices/unreleased/client-2.json @@ -1,10 +1,12 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "entrypoint": [ diff --git a/.github/compatibility-test-matrices/unreleased/connection.json b/.github/compatibility-test-matrices/unreleased/connection.json index 7751a0f73922..b65be9871525 100644 --- a/.github/compatibility-test-matrices/unreleased/connection.json +++ b/.github/compatibility-test-matrices/unreleased/connection.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -9,7 +11,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/genesis.json b/.github/compatibility-test-matrices/unreleased/genesis.json index 6a4705f5cfcd..6145bd50ecfd 100644 --- a/.github/compatibility-test-matrices/unreleased/genesis.json +++ b/.github/compatibility-test-matrices/unreleased/genesis.json @@ -1,10 +1,12 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "entrypoint": [ diff --git a/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-a.json index 84c35854ee10..6857b4276073 100644 --- a/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-a.json +++ b/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-a.json @@ -1,10 +1,12 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "entrypoint": [ diff --git a/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-b.json index 84c35854ee10..6857b4276073 100644 --- a/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-b.json +++ b/.github/compatibility-test-matrices/unreleased/ica-channel-upgrade-chain-b.json @@ -1,10 +1,12 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "entrypoint": [ diff --git a/.github/compatibility-test-matrices/unreleased/ica-gov.json b/.github/compatibility-test-matrices/unreleased/ica-gov.json index e5f7344cb996..926eecdee954 100644 --- a/.github/compatibility-test-matrices/unreleased/ica-gov.json +++ b/.github/compatibility-test-matrices/unreleased/ica-gov.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -10,7 +12,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/ica-groups.json b/.github/compatibility-test-matrices/unreleased/ica-groups.json index 62ccf3e57bef..652eac90caf8 100644 --- a/.github/compatibility-test-matrices/unreleased/ica-groups.json +++ b/.github/compatibility-test-matrices/unreleased/ica-groups.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -10,7 +12,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/ica-queries.json b/.github/compatibility-test-matrices/unreleased/ica-queries.json index d03e10d5c868..c3239708c7fc 100644 --- a/.github/compatibility-test-matrices/unreleased/ica-queries.json +++ b/.github/compatibility-test-matrices/unreleased/ica-queries.json @@ -1,14 +1,18 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x" ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x" diff --git a/.github/compatibility-test-matrices/unreleased/ica-unordered-channel.json b/.github/compatibility-test-matrices/unreleased/ica-unordered-channel.json index 8f96c3dfb6a8..910e9cdb1409 100644 --- a/.github/compatibility-test-matrices/unreleased/ica-unordered-channel.json +++ b/.github/compatibility-test-matrices/unreleased/ica-unordered-channel.json @@ -1,14 +1,18 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x" ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x" diff --git a/.github/compatibility-test-matrices/unreleased/ica.json b/.github/compatibility-test-matrices/unreleased/ica.json index b3d78978d142..de0a74e36109 100644 --- a/.github/compatibility-test-matrices/unreleased/ica.json +++ b/.github/compatibility-test-matrices/unreleased/ica.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -12,7 +14,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/incentivized-ica.json b/.github/compatibility-test-matrices/unreleased/incentivized-ica.json index 93cd6fd8bea9..08f515f67dad 100644 --- a/.github/compatibility-test-matrices/unreleased/incentivized-ica.json +++ b/.github/compatibility-test-matrices/unreleased/incentivized-ica.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -10,7 +12,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/incentivized-transfer-1.json b/.github/compatibility-test-matrices/unreleased/incentivized-transfer-1.json index f2fd0385f862..34a0cdedac37 100644 --- a/.github/compatibility-test-matrices/unreleased/incentivized-transfer-1.json +++ b/.github/compatibility-test-matrices/unreleased/incentivized-transfer-1.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -12,7 +14,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/incentivized-transfer-2.json b/.github/compatibility-test-matrices/unreleased/incentivized-transfer-2.json index 23f8b54acd56..3825197240fa 100644 --- a/.github/compatibility-test-matrices/unreleased/incentivized-transfer-2.json +++ b/.github/compatibility-test-matrices/unreleased/incentivized-transfer-2.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -12,7 +14,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/incentivized-transfer-3.json b/.github/compatibility-test-matrices/unreleased/incentivized-transfer-3.json index 7939997adc1e..4568630a48f3 100644 --- a/.github/compatibility-test-matrices/unreleased/incentivized-transfer-3.json +++ b/.github/compatibility-test-matrices/unreleased/incentivized-transfer-3.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -12,7 +14,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/localhost-ica.json b/.github/compatibility-test-matrices/unreleased/localhost-ica.json index dfb422c1b5d4..9fbe98ca3a72 100644 --- a/.github/compatibility-test-matrices/unreleased/localhost-ica.json +++ b/.github/compatibility-test-matrices/unreleased/localhost-ica.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -9,7 +11,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/localhost-transfer.json b/.github/compatibility-test-matrices/unreleased/localhost-transfer.json index 3641d271d036..2311b4e5580a 100644 --- a/.github/compatibility-test-matrices/unreleased/localhost-transfer.json +++ b/.github/compatibility-test-matrices/unreleased/localhost-transfer.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -9,7 +11,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/transfer-1.json b/.github/compatibility-test-matrices/unreleased/transfer-1.json index e52ce4e837c6..8c8746c23430 100644 --- a/.github/compatibility-test-matrices/unreleased/transfer-1.json +++ b/.github/compatibility-test-matrices/unreleased/transfer-1.json @@ -1,6 +1,7 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", "release-v7.7.x", "release-v7.6.x", @@ -12,6 +13,7 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", "release-v7.7.x", "release-v7.6.x", diff --git a/.github/compatibility-test-matrices/unreleased/transfer-2.json b/.github/compatibility-test-matrices/unreleased/transfer-2.json index 751def47b316..8807456eed6d 100644 --- a/.github/compatibility-test-matrices/unreleased/transfer-2.json +++ b/.github/compatibility-test-matrices/unreleased/transfer-2.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -12,7 +14,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/transfer-3.json b/.github/compatibility-test-matrices/unreleased/transfer-3.json index c25bed4085f9..d7e8576f59b2 100644 --- a/.github/compatibility-test-matrices/unreleased/transfer-3.json +++ b/.github/compatibility-test-matrices/unreleased/transfer-3.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -12,7 +14,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/transfer-authz.json b/.github/compatibility-test-matrices/unreleased/transfer-authz.json index 2651a6b19015..6a8cbc22c52e 100644 --- a/.github/compatibility-test-matrices/unreleased/transfer-authz.json +++ b/.github/compatibility-test-matrices/unreleased/transfer-authz.json @@ -1,7 +1,9 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", @@ -9,7 +11,9 @@ ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x", + "release-v7.8.x", "release-v7.7.x", "release-v7.6.x", "release-v7.5.x", diff --git a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json index 8700e96671cc..37411d76b16d 100644 --- a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json +++ b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-a.json @@ -1,10 +1,12 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "entrypoint": [ diff --git a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json index 8700e96671cc..37411d76b16d 100644 --- a/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json +++ b/.github/compatibility-test-matrices/unreleased/transfer-channel-upgrade-chain-b.json @@ -1,10 +1,12 @@ { "chain-a": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "chain-b": [ "release-v9.0.x", + "release-v8.5.x", "release-v8.4.x" ], "entrypoint": [ diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b5b37a612d09..75e9fb10faec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -46,4 +46,12 @@ updates: labels: - dependencies + - package-ecosystem: gomod + directory: "/simapp" + schedule: + interval: daily + open-pull-requests-limit: 10 + labels: + - dependencies + diff --git a/.github/mergify.yml b/.github/mergify.yml index 724a0898bcef..09eb23e64b03 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -50,22 +50,30 @@ pull_request_rules: backport: branches: - callbacks/release/v0.2.x+ibc-go-v8.0.x - - name: backport patches to v0.3.x wasm ibc-go v7.3.x & wasmvm 1.5.x branch + - name: backport patches to v0.3.x wasm ibc-go v7.4.x & wasmvm 1.5.x branch conditions: - base=main - - label=backport-wasm-v0.3.x+ibc-go-v7.3.x-wasmvm-v1.5.x + - label=backport-wasm-v0.3.x+ibc-go-v7.4.x-wasmvm-v1.5.x actions: backport: branches: - 08-wasm/release/v0.3.x+ibc-go-v7.4.x-wasmvm-v1.5.x - - name: backport patches to v0.4.x wasm ibc-go v8.3.x & wasmvm 2.0.x branch + - name: backport patches to v0.4.x wasm ibc-go v8.4.x & wasmvm 2.0.x branch conditions: - base=main - - label=backport-wasm-v0.4.x+ibc-go-v8.3.x-wasmvm-v2.0.x + - label=backport-wasm-v0.4.x+ibc-go-v8.4.x-wasmvm-v2.0.x actions: backport: branches: - - 08-wasm/release/v0.4.x+ibc-go-v8.4.x-wasmvm-v2.0.x + - 08-wasm/release/v0.4.x+ibc-go-v8.4.x-wasmvm-v2.0.x + - name: backport patches to v0.5.x wasm ibc-go v9.0.x & wasmvm 2.1.x branch + conditions: + - base=main + - label=backport-wasm-v0.5.x+ibc-go-v9.0.x-wasmvm-v2.1.x + actions: + backport: + branches: + - 08-wasm/release/v0.5.x+ibc-go-v9.0.x-wasmvm-v2.1.x - name: backport patches to v7.4.x branch conditions: - base=main @@ -98,6 +106,14 @@ pull_request_rules: backport: branches: - release/v7.7.x + - name: backport patches to v7.8.x branch + conditions: + - base=main + - label=backport-to-v7.8.x + actions: + backport: + branches: + - release/v7.8.x - name: backport patches to v8.4.x branch conditions: - base=main @@ -106,6 +122,14 @@ pull_request_rules: backport: branches: - release/v8.4.x + - name: backport patches to v8.5.x branch + conditions: + - base=main + - label=backport-to-v8.5.x + actions: + backport: + branches: + - release/v8.5.x - name: backport patches to v9.0.x branch conditions: - base=main diff --git a/.github/workflows/callbacks.yml b/.github/workflows/callbacks.yml index 32cee5708f0a..c09e14b93878 100644 --- a/.github/workflows/callbacks.yml +++ b/.github/workflows/callbacks.yml @@ -62,7 +62,7 @@ jobs: steps: - name: sonarcloud if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@v2.3.0 + uses: SonarSource/sonarcloud-github-action@v3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/capability.yml b/.github/workflows/capability.yml index ef09e42cbc2e..720ca0db5bbb 100644 --- a/.github/workflows/capability.yml +++ b/.github/workflows/capability.yml @@ -43,7 +43,7 @@ jobs: steps: - name: sonarcloud if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@v2.3.0 + uses: SonarSource/sonarcloud-github-action@v3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bd58e9aaf8e9..f61ded505031 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,7 +28,7 @@ jobs: images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} - name: Build Docker image - uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 + uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 with: context: . tags: ${{ steps.meta.outputs.tags }} @@ -46,7 +46,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Push Docker image - uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 + uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 with: context: . push: true diff --git a/.github/workflows/e2e-compatibility-unreleased.yaml b/.github/workflows/e2e-compatibility-unreleased.yaml index 1e0cc54f5d53..8bbbf4a579d8 100644 --- a/.github/workflows/e2e-compatibility-unreleased.yaml +++ b/.github/workflows/e2e-compatibility-unreleased.yaml @@ -19,6 +19,8 @@ jobs: - release/v7.5.x - release/v7.6.x - release/v7.7.x + - release/v7.8.x + - release/v8.5.x - release/v8.4.x - release/v9.0.x steps: diff --git a/.github/workflows/e2e-compatibility.yaml b/.github/workflows/e2e-compatibility.yaml index 58c3794ef785..97572d37da21 100644 --- a/.github/workflows/e2e-compatibility.yaml +++ b/.github/workflows/e2e-compatibility.yaml @@ -17,7 +17,9 @@ on: - release/v7.5.x - release/v7.6.x - release/v7.7.x + - release/v7.8.x - release/v8.4.x + - release/v8.5.x - release/v9.0.x - main ibc-go-version: diff --git a/.github/workflows/e2e-test-workflow-call.yml b/.github/workflows/e2e-test-workflow-call.yml index 2b80aeefa84f..76bcadd55288 100644 --- a/.github/workflows/e2e-test-workflow-call.yml +++ b/.github/workflows/e2e-test-workflow-call.yml @@ -132,7 +132,7 @@ jobs: - name: Build and push Docker image if: ${{ inputs.build-and-push-docker-image }} - uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 + uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 with: context: . push: true @@ -179,7 +179,7 @@ jobs: - name: Build and push Docker image if: ${{ inputs.build-and-push-docker-image-wasm }} - uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 + uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 with: context: . push: true @@ -277,6 +277,8 @@ jobs: CHAIN_BINARY: '${{ inputs.chain-binary }}' CHAIN_UPGRADE_TAG: '${{ inputs.chain-upgrade-tag }}' CHAIN_UPGRADE_PLAN: '${{ inputs.upgrade-plan-name }}' + # explicitly set to true so that if a test fails, it doesn't delete the chain and cause other tests to fail. + KEEP_CONTAINERS: "true" strategy: fail-fast: false matrix: diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 0142d4727d38..8ddf3cdff362 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: tj-actions/changed-files@v44 + - uses: tj-actions/changed-files@v45 id: changed-files with: files: '**/*.md' diff --git a/.github/workflows/proto-registry.yml b/.github/workflows/proto-registry.yml index 0e37bb53c963..f13c88c584e9 100644 --- a/.github/workflows/proto-registry.yml +++ b/.github/workflows/proto-registry.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.35.1 + - uses: bufbuild/buf-setup-action@v1.38.0 - uses: bufbuild/buf-push-action@v1 with: input: "proto" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff75dabb463b..f6f6a875ce8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 + uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 with: context: . push: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e04f32fc3fea..356bfc291fe8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -146,7 +146,7 @@ jobs: name: '${{ github.sha }}-03-coverage' - name: sonarcloud if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} - uses: SonarSource/sonarcloud-github-action@v2.3.0 + uses: SonarSource/sonarcloud-github-action@v3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/wasm-client.yml b/.github/workflows/wasm-client.yml index 34d2e29e2082..47046d33cde5 100644 --- a/.github/workflows/wasm-client.yml +++ b/.github/workflows/wasm-client.yml @@ -68,7 +68,7 @@ jobs: steps: - name: sonarcloud if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} - uses: SonarSource/sonarcloud-github-action@v2.3.0 + uses: SonarSource/sonarcloud-github-action@v3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bd77bc57ebe..dd8687a21791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,9 +38,23 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies -* [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump Cosmos SDK to v0.50.7. +### API Breaking + +### State Machine Breaking + +### Improvements + +### Features + +### Bug Fixes + +## v9.0.0 (unreleased) + +### Dependencies + +* [\#6828](https://github.com/cosmos/ibc-go/pull/6828) Bump Cosmos SDK to v0.50.9. * [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump `cosmossdk.io/store` to v1.1.0. -* [\#6848](https://github.com/cosmos/ibc-go/pull/6848) Bump CometBFT to v0.38.10. +* [\#7126](https://github.com/cosmos/ibc-go/pull/7126) Bump CometBFT to v0.38.11. * [\#6380](https://github.com/cosmos/ibc-go/pull/6380) Bump go to v1.22. ### API Breaking @@ -77,7 +91,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (light-clients/06-solomachine, light-clients/07-tendermint) [\#6891](https://github.com/cosmos/ibc-go/pull/6891) The `VerifyMembership` and `VerifyNonMembership` functions of solomachine's `ClientState` have been made private. The `VerifyMembership`, `VerifyNonMembership`, `GetTimestampAtHeight`, `Status` and `Initialize` functions of tendermint's `ClientState` have been made private. * (core/04-channel) [\#6902](https://github.com/cosmos/ibc-go/pull/6902) Add channel version to core application callbacks. * (core/03-connection, core/02-client) [\#6937](https://github.com/cosmos/ibc-go/pull/6937) Remove 'ConsensusHost' interface, also removing self client and consensus state validation in the connection handshake. -* (core/24-host) [\#6882](https://github.com/cosmos/ibc-go/issues/6882) All functions ending in `Path` have been removed from 24-host in favour of their sybling functions ending in `Key`. +* (core/24-host) [\#6882](https://github.com/cosmos/ibc-go/issues/6882) All functions ending in `Path` have been removed from 24-host in favour of their sibling functions ending in `Key`. +* (apps/27-interchain-accounts) [\#7053](https://github.com/cosmos/ibc-go/pull/7053) Remove ICS27 channel capability migration introduced in v6. ### State Machine Breaking diff --git a/SECURITY.md b/SECURITY.md index bf9a5a6aaec0..485d39559b3a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,7 +3,7 @@ If you believe you have found a security vulnerability in the Interchain Stack, you can report it to our primary vulnerability disclosure channel, the [Cosmos HackerOne Bug Bounty program](https://hackerone.com/cosmos?type=team). -If you prefer to report an issue via email, you may send a bug report to [security@interchain.io](security@interchain.io) with the issue details, reproduction, impact, and other information. Please submit only one unique email thread per vulnerability. Any issues reported via email are ineligible for bounty rewards. +If you prefer to report an issue via email, you may send a bug report to [security@interchain.io](mailto:security@interchain.io) with the issue details, reproduction, impact, and other information. Please submit only one unique email thread per vulnerability. Any issues reported via email are ineligible for bounty rewards. Artifacts from an email report are saved at the time the email is triaged. Please note: our team is not able to monitor dynamic content (e.g. a Google Docs link that is edited after receipt) throughout the lifecycle of a report. If you would like to share additional information or modify previous information, please include it in an additional reply as an additional attachment. diff --git a/docs/architecture/README.md b/docs/architecture/README.md index d619f655f67b..9db91ab2f2a8 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -38,7 +38,7 @@ To suggest an ADR, please make use of the [ADR template](https://github.com/cosm | [005](./adr-005-consensus-height-events.md) | `UpdateClient` events - `ClientState` consensus heights | Accepted | | [006](./adr-006-02-client-refactor.md) | ICS02 client refactor | Accepted | | [007](./adr-007-solomachine-signbytes.md) | ICS06 Solo machine sign bytes | Accepted | -| [008](./adr-008-app-caller-cbs.md) | Callback to IBC ACtors | Accepted | +| [008](./adr-008-app-caller-cbs.md) | Callback to IBC Actors | Accepted | | [009](./adr-009-v6-ics27-msgserver.md) | ICS27 message server addition | Accepted | | [010](./adr-010-light-clients-as-sdk-modules.md) | IBC light clients as SDK modules | Accepted | | [011](./adr-011-transfer-total-escrow-state-entry.md) | ICS20 state entry for total amount of tokens in escrow | Accepted | diff --git a/docs/client/swagger-ui/swagger.yaml b/docs/client/swagger-ui/swagger.yaml index 1ae230cad246..bb8d6cb6d2ae 100644 --- a/docs/client/swagger-ui/swagger.yaml +++ b/docs/client/swagger-ui/swagger.yaml @@ -3943,6 +3943,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. description: >- QueryClientStateResponse is the response type for the Query/ClientState RPC @@ -4418,6 +4425,13 @@ paths: the RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. consensus_state: type: object properties: @@ -4939,6 +4953,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: >- Height is a monotonically increasing data type @@ -5462,6 +5483,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: >- Height is a monotonically increasing data type @@ -6951,6 +6979,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: >- Height is a monotonically increasing data type @@ -7041,6 +7076,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryClientConnectionsResponse is the response type for the Query/ClientConnections RPC method @@ -7401,6 +7443,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. description: >- QueryConnectionsResponse is the response type for the Query/Connections RPC @@ -7795,6 +7844,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. description: >- QueryConnectionResponse is the response type for the Query/Connection RPC @@ -8243,6 +8299,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryConnectionClientStateResponse is the response type for the Query/ConnectionClientState RPC method @@ -8673,6 +8736,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryConnectionConsensusStateResponse is the response type for the Query/ConnectionConsensusState RPC method @@ -9275,6 +9345,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. description: >- QueryChannelsResponse is the response type for the Query/Channels RPC method. @@ -9662,6 +9739,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. description: >- QueryChannelResponse is the response type for the Query/Channel RPC method. @@ -10117,6 +10201,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryChannelClientStateResponse is the Response type for the Query/QueryChannelClientState RPC method @@ -10552,6 +10643,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryChannelClientStateResponse is the Response type for the Query/QueryChannelClientState RPC method @@ -10823,6 +10921,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QuerySequenceResponse is the response type for the Query/QueryNextSequenceReceiveResponse RPC method @@ -11080,6 +11185,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryNextSequenceSendResponse is the request type for the Query/QueryNextSequenceSend RPC method @@ -11391,6 +11503,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryPacketAcknowledgemetsResponse is the request type for the Query/QueryPacketAcknowledgements RPC method @@ -11713,6 +11832,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: >- QueryPacketAcknowledgementResponse defines the client query response for a @@ -12032,6 +12158,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryPacketCommitmentsResponse is the request type for the Query/QueryPacketCommitments RPC method @@ -12347,6 +12480,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryUnreceivedAcksResponse is the response type for the Query/UnreceivedAcks RPC method @@ -12616,6 +12756,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryUnreceivedPacketsResponse is the response type for the Query/UnreceivedPacketCommitments RPC method @@ -12883,6 +13030,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: >- QueryPacketCommitmentResponse defines the client query response for a packet @@ -13154,6 +13308,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: >- QueryPacketReceiptResponse defines the client query response for a packet @@ -13450,6 +13611,15 @@ paths: as the RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty + jsontag. + + This enforces the Go json marshaller to always emit + zero values for both revision_number and + revision_height. timestamp: type: string format: uint64 @@ -13516,6 +13686,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: >- QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method @@ -13785,6 +13962,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: >- QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method @@ -14157,6 +14341,13 @@ paths: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. title: |- QueryConnectionChannelsResponse is the Response type for the Query/QueryConnectionChannels RPC method @@ -14466,6 +14657,15 @@ paths: as the RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty + jsontag. + + This enforces the Go json marshaller to always emit + zero values for both revision_number and + revision_height. timestamp: type: string format: uint64 @@ -16201,6 +16401,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. consensus_state: type: object properties: @@ -16382,13 +16589,25 @@ definitions: type: string format: uint64 title: the height within the given revision - description: |- + description: >- Normally the RevisionHeight is incremented at each height while keeping + RevisionNumber the same. However some consensus algorithms may choose to + reset the height in certain conditions e.g. hard forks, state-machine + breaking changes In these cases, the RevisionNumber is incremented so that + height continues to be monitonically increasing even as the RevisionHeight + gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for both + revision_number and revision_height. title: >- Height is a monotonically increasing data type @@ -16811,6 +17030,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. description: >- QueryClientStateResponse is the response type for the Query/ClientState RPC @@ -17085,6 +17311,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: >- Height is a monotonically increasing data type @@ -17324,6 +17557,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: >- Height is a monotonically increasing data type @@ -17373,6 +17613,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden + to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values + for both revision_number and revision_height. consensus_state: type: object properties: @@ -17963,6 +18210,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: >- Height is a monotonically increasing data type @@ -18286,6 +18540,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryClientConnectionsResponse is the response type for the Query/ClientConnections RPC method @@ -18505,6 +18766,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryConnectionClientStateResponse is the response type for the Query/ConnectionClientState RPC method @@ -18711,6 +18979,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryConnectionConsensusStateResponse is the response type for the Query/ConnectionConsensusState RPC method @@ -18861,6 +19136,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. description: >- QueryConnectionResponse is the response type for the Query/Connection RPC @@ -19009,6 +19291,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. description: >- QueryConnectionsResponse is the response type for the Query/Connections RPC @@ -19300,6 +19589,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values + for both revision_number and revision_height. timestamp: type: string format: uint64 @@ -19532,6 +19828,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryChannelClientStateResponse is the Response type for the Query/QueryChannelClientState RPC method @@ -19738,6 +20041,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryChannelClientStateResponse is the Response type for the Query/QueryChannelClientState RPC method @@ -19780,6 +20090,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. timestamp: type: string format: uint64 @@ -19916,6 +20233,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. description: >- QueryChannelResponse is the response type for the Query/Channel RPC method. @@ -20070,6 +20394,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. description: >- QueryChannelsResponse is the response type for the Query/Channels RPC method. @@ -20220,6 +20551,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryConnectionChannelsResponse is the Response type for the Query/QueryConnectionChannels RPC method @@ -20262,6 +20600,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QuerySequenceResponse is the response type for the Query/QueryNextSequenceReceiveResponse RPC method @@ -20304,6 +20649,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryNextSequenceSendResponse is the request type for the Query/QueryNextSequenceSend RPC method @@ -20346,6 +20698,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryPacketAcknowledgementResponse defines the client query response for a packet which also includes a proof and the height from which the @@ -20436,6 +20795,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryPacketAcknowledgemetsResponse is the request type for the Query/QueryPacketAcknowledgements RPC method @@ -20478,6 +20844,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: >- QueryPacketCommitmentResponse defines the client query response for a packet @@ -20571,6 +20944,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryPacketCommitmentsResponse is the request type for the Query/QueryPacketCommitments RPC method @@ -20612,6 +20992,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: >- QueryPacketReceiptResponse defines the client query response for a packet @@ -20656,6 +21043,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryUnreceivedAcksResponse is the response type for the Query/UnreceivedAcks RPC method @@ -20696,6 +21090,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: |- QueryUnreceivedPacketsResponse is the response type for the Query/UnreceivedPacketCommitments RPC method @@ -20752,6 +21153,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: >- QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method @@ -20818,6 +21226,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are + overridden to explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero + values for both revision_number and revision_height. timestamp: type: string format: uint64 @@ -20881,6 +21296,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. title: >- QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method @@ -20939,6 +21361,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values for + both revision_number and revision_height. timestamp: type: string format: uint64 @@ -21013,6 +21442,13 @@ definitions: RevisionHeight gets reset + + + Please note that json tags for generated Go code are overridden to + explicitly exclude the omitempty jsontag. + + This enforces the Go json marshaller to always emit zero values + for both revision_number and revision_height. timestamp: type: string format: uint64 diff --git a/docs/docs/02-apps/01-transfer/09-client.md b/docs/docs/02-apps/01-transfer/09-client.md index c3799f2fbcfc..2a5940f46312 100644 --- a/docs/docs/02-apps/01-transfer/09-client.md +++ b/docs/docs/02-apps/01-transfer/09-client.md @@ -45,7 +45,7 @@ The additional flags that can be used with the command are: - `--absolute-timeouts` to interpret the timeout timestamp as an aboslute value (when set to true). The default value is false (and thus the timeout timeout is considered relative to current UTC time). - `--memo` to specify the memo string to be sent along with the transfer packet. If forwarding is used, then the memo string will be carried through the intermediary chains to the final destination. - `--forwarding` to specify forwarding information in the form of a comma separated list of source port ID/channel ID pairs at each intermediary chain (e.g. `transfer/channel-0,transfer/channel-1`). -- `--unwind` to specify if the tokens must be automatically unwound to there origin chain. This option can be used in combination with `--forwarding` to forward the tokens to the final destination after unwinding. When this flag is true, the `coins` option must specify a single coin. +- `--unwind` to specify if the tokens must be automatically unwound to there origin chain. This option can be used in combination with `--forwarding` to forward the tokens to the final destination after unwinding. When this flag is true, the tokens specified in the `coins` option must all have the same denomination trace path (i.e. all tokens must be IBC vouchers sharing exactly the same set of destination port/channel IDs in their denomination trace path). Arguments `[src-port]` and `[src-channel]` must not be passed if the `--unwind` flag is specified. #### `total-escrow` diff --git a/docs/docs/03-light-clients/05-tendermint/01-overview.md b/docs/docs/03-light-clients/05-tendermint/01-overview.md new file mode 100644 index 000000000000..9f94d77980af --- /dev/null +++ b/docs/docs/03-light-clients/05-tendermint/01-overview.md @@ -0,0 +1,167 @@ +--- +title: Overview +sidebar_label: Overview +sidebar_position: 1 +slug: /ibc/light-clients/tendermint/overview +--- + +# `07-tendermint` + +## Overview + +:::note Synopsis +Learn about the 07-tendermint light client module. +::: + +The Tendermint client is the first and most deployed light client in IBC. It implements the IBC [light client module interface](https://github.com/cosmos/ibc-go/blob/v9.0.0-beta.1/modules/core/exported/client.go#L41-L123) to track a counterparty running [CometBFT](https://github.com/cometbft/cometbft) consensus. + +:::note +Tendermint is the old name of CometBFT which has been retained in IBC to avoid expensive migration costs. +::: + +The Tendermint client consists of two important structs that keep track of the state of the counterparty chain and allow for future updates. The `ClientState` struct contains all the parameters necessary for CometBFT header verification. The `ConsensusState`, on the other hand, is a compressed view of a particular header of the counterparty chain. Unlike off chain light clients, IBC does not store full header. Instead it stores only the information it needs to prove verification of key/value pairs in the counterparty state (i.e. the header `AppHash`), and the information necessary to use the consensus state as the next root of trust to add a new consensus state to the client (i.e. the header `NextValidatorsHash` and `Timestamp`). The relayer provides the full trusted header on `UpdateClient`, which will get checked against the compressed root-of-trust consensus state. If the trusted header matches a previous consensus state, and the trusted header and new header pass the CometBFT light client update algorithm, then the new header is compressed into a consensus state and added to the IBC client. + +Each Tendermint Client is composed of a single `ClientState` keyed on the client ID, and multiple consensus states which are keyed on both the clientID and header height. Relayers can use the consensus states to verify merkle proofs of packet commitments, acknowledgements, and receipts against the `AppHash` of the counterparty chain in order to enable verified packet flow. + +If a counterparty chain violates the CometBFT protocol in a way that is detectable to off-chain light clients, this misbehaviour can also be submitted to an IBC client by any off-chain actor. Upon verification of this misbehaviour, the Tendermint IBC Client will freeze, preventing any further packet flow from this malicious chain from occuring. Governance or some other out-of-band protocol may then be used to unwind any damage that has already occurred. + +## Initialization + +The Tendermint light client is initialized with a `ClientState` that contains parameters necessary for CometBFT header verification along with a latest height and `ConsensusState` that encapsulates the application state root of a trusted header that will serve to verify future incoming headers from the counterparty. + +```proto +message ClientState { + // human readable chain-id that will be included in header + // and signed over by the validator set + string chain_id = 1; + // trust level is the fraction of the trusted validator set + // that must sign over a new untrusted header before it is accepted + // it can be a minimum of 1/3 and a maximum of 2/3 + // Note these are the bounds of liveness. 1/3 is the minimum + // honest stake needed to maintain liveness on a chain, + // requiring more than 2/3 to sign over the new header would + // break the BFT threshold of allowing 1/3 malicious validators + Fraction trust_level = 2; + // duration of the period since the LatestTimestamp during which the + // submitted headers are valid for update + google.protobuf.Duration trusting_period = 3; + // duration of the staking unbonding period + google.protobuf.Duration unbonding_period = 4; + // defines how much new (untrusted) header's Time can drift + // into the future relative to our local clock. + google.protobuf.Duration max_clock_drift = 5; + + // Block height when the client was frozen due to a misbehaviour + ibc.core.client.v1.Height frozen_height = 6; + // Latest height the client was updated to + ibc.core.client.v1.Height latest_height = 7; + + // Proof specifications used in verifying counterparty state + repeated cosmos.ics23.v1.ProofSpec proof_specs = 8; + + // Path at which next upgraded client will be committed. + // Each element corresponds to the key for a single CommitmentProof in the + // chained proof. NOTE: ClientState must stored under + // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + // the default upgrade module, upgrade_path should be []string{"upgrade", + // "upgradedIBCState"}` + repeated string upgrade_path = 9; +} +``` + +```proto +message ConsensusState { + // timestamp that corresponds to the block height in which the ConsensusState + // was stored. + google.protobuf.Timestamp timestamp = 1; + // commitment root (i.e app hash) that will be used + // to verify proofs of packet flow messages + ibc.core.commitment.v1.MerkleRoot root = 2; + // hash of the next validator set that will be used as + // a new updated source of trust to verify future updates + bytes next_validators_hash = 3; +} +``` + +## Updates + +Once the initial client state and consensus state are submitted, future consensus states can be added to the client by submitting IBC [headers](https://github.com/cosmos/ibc-go/blob/v9.0.0-beta.1/proto/ibc/lightclients/tendermint/v1/tendermint.proto#L76-L94). These headers contain all necessary information to run the CometBFT light client protocol. + +```proto +message Header { + // this is the new signed header that we want to add + // as a new consensus state to the ibc client. + // the signed header contains the commit signatures of the `validator_set` below + .tendermint.types.SignedHeader signed_header = 1; + + // the validator set which signed the new header + .tendermint.types.ValidatorSet validator_set = 2; + // the trusted height of the consensus state which we are updating from + ibc.core.client.v1.Height trusted_height = 3; + // the trusted validator set, the hash of the trusted validators must be equal to + // `next_validators_hash` of the current consensus state + .tendermint.types.ValidatorSet trusted_validators = 4; +} +``` + +For detailed information on the CometBFT light client protocol and its safety properties please refer to the [original Tendermint whitepaper](https://arxiv.org/abs/1807.04938). + +## Proofs + +As consensus states are added to the client, they can be used for proof verification by relayers wishing to prove packet flow messages against a particular height on the counterparty. This uses the `VerifyMembership` and `VerifyNonMembership` methods on the Tendermint client. + +```go +// VerifyMembership is a generic proof verification method +//which verifies a proof of the existence of a value at a +// given CommitmentPath at the specified height. The caller +// is expected to construct the full CommitmentPath from a +// CommitmentPrefix and a standardized path (as defined in ICS 24). +VerifyMembership( + ctx sdk.Context, + clientID string, + height Height, + delayTimePeriod uint64, + delayBlockPeriod uint64, + proof []byte, + path Path, + value []byte, +) error + +// VerifyNonMembership is a generic proof verification method +// which verifies the absence of a given CommitmentPath at a +// specified height. The caller is expected to construct the +// full CommitmentPath from a CommitmentPrefix and a standardized +// path (as defined in ICS 24). +VerifyNonMembership( + ctx sdk.Context, + clientID string, + height Height, + delayTimePeriod uint64, + delayBlockPeriod uint64, + proof []byte, + path Path, +) error +``` + +The Tendermint client is initialized with an ICS23 proof spec. This allows the Tendermint implementation to support many different merkle tree structures so long as they can be represented in an [`ics23.ProofSpec`](https://github.com/cosmos/ics23/blob/go/v0.10.0/proto/cosmos/ics23/v1/proofs.proto#L145-L170). + +## Misbehaviour + +The Tendermint light client directly tracks consensus of a CometBFT counterparty chain. So long as the counterparty is Byzantine Fault Tolerant, that is to say, the malicious subset of the bonded validators does not exceed the trust level of the client, then the client is secure. + +In case the malicious subset of the validators exceeds the trust level of the client, then the client can be deceived into accepting invalid blocks and the connection is no longer secure. + +The Tendermint client has some mitigations in place to prevent this. If there are two valid blocks signed by the counterparty validator set at the same height [e.g. a valid block signed by an honest subset and an invalid block signed by a malicious one], then these conflicting headers can be submitted to the client as [misbehaviour](https://github.com/cosmos/ibc-go/blob/v9.0.0-beta.1/proto/ibc/lightclients/tendermint/v1/tendermint.proto#L65-L74). The client will verify the headers and freeze the client; preventing any future updates and proof verification from succeeding. This effectively halts communication with the compromised counterparty while out-of-band social consensus can unwind any damage done. + +Similarly, if the timestamps of the headers are not monotonically increasing, this can also be evidence of malicious behaviour and cause the client to freeze. + +Thus, any consensus faults that are detectable by a light client are part of the misbehaviour protocol and can be used to minimize the damage caused by a compromised counterparty chain. + +### Security model + +It is important to note that IBC is not a completely trustless protocol; it is **trust-minimized**. This means that the safety property of bilateral IBC communication between two chains is dependent on the safety properties of the two chains in question. If one of the chains is compromised completely, then the IBC connection to the other chain is liable to receive invalid packets from the malicious chain. For example, if a malicious validator set has taken over more than 2/3 of the validator power on a chain; that malicious validator set can create a single chain of blocks with arbitrary commitment roots and arbitrary commitments to the next validator set. This would seize complete control of the chain and prevent the honest subset from even being able to create a competing honest block. + +In this case, there is no ability for the IBC Tendermint client solely tracking CometBFT consensus to detect the misbehaviour and freeze the client. The IBC protocol would require out-of-band mechanisms to detect and fix such an egregious safety fault on the counterparty chain. Since the Tendermint light client is only tracking consensus and not also verifying the validity of state transitions, malicious behaviour from a validator set that is beyond the BFT fault threshold is an accepted risk of this light client implementation. + +The IBC protocol has principles of fault isolation (e.g. all tokens are prefixed by their channel, so tokens from different chains are not mutually fungible) and fault mitigation (e.g. ability to freeze the client if misbehaviour can be detected before complete malicious takeover) that make this risk as minimal as possible. diff --git a/docs/docs/03-light-clients/05-tendermint/_category_.json b/docs/docs/03-light-clients/05-tendermint/_category_.json new file mode 100644 index 000000000000..e7c0c00613ce --- /dev/null +++ b/docs/docs/03-light-clients/05-tendermint/_category_.json @@ -0,0 +1,5 @@ +{ + "label": "Tendermint", + "position": 5, + "link": null + } diff --git a/docs/docs/05-migrations/13-v8-to-v9.md b/docs/docs/05-migrations/13-v8-to-v9.md index 2d6af42cda7a..ad93bcb1e061 100644 --- a/docs/docs/05-migrations/13-v8-to-v9.md +++ b/docs/docs/05-migrations/13-v8-to-v9.md @@ -140,23 +140,23 @@ func NewMsgConnectionOpenAck( ```diff func (k *Keeper) ChanCloseConfirm( - ctx sdk.Context, - portID, - channelID string, - chanCap *capabilitytypes.Capability, - initProof []byte, - proofHeight exported.Height, + ctx sdk.Context, + portID, + channelID string, + chanCap *capabilitytypes.Capability, + initProof []byte, + proofHeight exported.Height, + counterpartyUpgradeSequence uint64, ) func (k *Keeper) TimeoutOnClose( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - packet types.Packet, - proof, - closedProof []byte, - proofHeight exported.Height, - nextSequenceRecv uint64, + ctx sdk.Context, + chanCap *capabilitytypes.Capability, + packet types.Packet, + proof, + closedProof []byte, + proofHeight exported.Height, + nextSequenceRecv uint64, + counterpartyUpgradeSequence uint64, ) ``` @@ -235,7 +235,7 @@ OnTimeoutPacket func( ```diff type PacketDataUnmarshaler interface { - UnmarshalPacketData( + UnmarshalPacketData( + ctx sdk.Context, + portID, + channelID string, @@ -252,7 +252,7 @@ type PacketDataUnmarshaler interface { ### 24-host -All functions ending with `Path` naming have been removed in favour of their sybling function which ends in `Key`. +All functions ending with `Path` naming have been removed in favour of their sibling function which ends in `Key`. ## IBC Apps @@ -345,59 +345,49 @@ func NewIBCMiddleware( ### Callbacks -The `ContractKeeper` interface has been extended with the base application version. The base application version will be required by contracts to unmarshal the packet data. An example of this is unmarshaling ics20v2 packets which requires knowing the base version of a transfer stack (either v1 or v2). +The `ContractKeeper` interface has been extended with the base application version. The base application version will be required by contracts to unmarshal the packet data. An example of this is unmarshaling ICS20 v2 packets which requires knowing the base version of a transfer stack (either v1 or v2). ```diff - IBCSendPacketCallback( - cachedCtx sdk.Context, - sourcePort string, -@@ -31,6 +34,7 @@ type ContractKeeper interface { - packetData []byte, - contractAddress, - packetSenderAddress string, -+ version string, - ) error - // IBCOnAcknowledgementPacketCallback is called in the source chain when a packet acknowledgement - // is received. The packetSenderAddress is determined by the underlying module, and may be empty if -@@ -43,6 +47,9 @@ type ContractKeeper interface { - // validation on the origin of a given packet. It is recommended to perform the same validation - // on all source chain callbacks (SendPacket, AcknowledgementPacket, TimeoutPacket). This - // defensively guards against exploits due to incorrectly wired SendPacket ordering in IBC stacks. - IBCOnAcknowledgementPacketCallback( - cachedCtx sdk.Context, - packet channeltypes.Packet, -@@ -50,6 +57,7 @@ type ContractKeeper interface { - relayer sdk.AccAddress, - contractAddress, - packetSenderAddress string, -+ version string, - ) error - // IBCOnTimeoutPacketCallback is called in the source chain when a packet is not received before - // the timeout height. The packetSenderAddress is determined by the underlying module, and may be -@@ -62,22 +70,30 @@ type ContractKeeper interface { - // validation on the origin of a given packet. It is recommended to perform the same validation - // on all source chain callbacks (SendPacket, AcknowledgementPacket, TimeoutPacket). This - // defensively guards against exploits due to incorrectly wired SendPacket ordering in IBC stacks. - IBCOnTimeoutPacketCallback( - cachedCtx sdk.Context, - packet channeltypes.Packet, - relayer sdk.AccAddress, - contractAddress, - packetSenderAddress string, -+ version string, - ) error - // IBCReceivePacketCallback is called in the destination chain when a packet acknowledgement is written. - // The contract is expected to handle the callback within the user defined gas limit, and handle any errors, - // out of gas, or panics gracefully. - // This entry point is called with a cached context. If an error is returned, then the changes in - // this context will not be persisted, but the packet lifecycle will not be blocked. - IBCReceivePacketCallback( - cachedCtx sdk.Context, - packet ibcexported.PacketI, - ack ibcexported.Acknowledgement, - contractAddress string, -+ version string, - ) error +type ContractKeeper interface { + IBCSendPacketCallback( + cachedCtx sdk.Context, + sourcePort string, + sourceChannel string, + timeoutHeight clienttypes.Height, + timeoutTimestamp uint64, + packetData []byte, + contractAddress, + packetSenderAddress string, ++ version string, + ) error + + IBCOnAcknowledgementPacketCallback( + cachedCtx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, + contractAddress, + packetSenderAddress string, ++ version string, + ) error + + IBCOnTimeoutPacketCallback( + cachedCtx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, + contractAddress, + packetSenderAddress string, ++ version string, + ) error + + IBCReceivePacketCallback( + cachedCtx sdk.Context, + packet ibcexported.PacketI, + ack ibcexported.Acknowledgement, + contractAddress string, ++ version string, + ) error +} ``` ### IBC testing package diff --git a/docs/docs/05-migrations/14-v9-to-v10.md b/docs/docs/05-migrations/14-v9-to-v10.md new file mode 100644 index 000000000000..f35f15de487e --- /dev/null +++ b/docs/docs/05-migrations/14-v9-to-v10.md @@ -0,0 +1,31 @@ +# Migrating from v9 to v10 + +This guide provides instructions for migrating to a new version of ibc-go. + +There are four sections based on the four potential user groups of this document: + +- [Chains](#chains) +- [IBC Apps](#ibc-apps) + - [ICS27 - Interchain Accounts](#ics27---interchain-accounts) +- [Relayers](#relayers) +- [IBC Light Clients](#ibc-light-clients) + +**Note:** ibc-go supports golang semantic versioning and therefore all imports must be updated on major version releases. + +## Chains + +- No relevant changes were made in this release. + +## IBC Apps + +### ICS27 - Interchain Accounts + +The channel capability migration introduced in v6 has been removed. Chains must upgrade from v6 or higher. + +## Relayers + +- No relevant changes were made in this release. + +## IBC Light Clients + +- No relevant changes were made in this release. diff --git a/docs/requirements/path-unwinding-forwarding-requirements.md b/docs/requirements/path-unwinding-forwarding-requirements.md new file mode 100644 index 000000000000..1c0c7a447a7d --- /dev/null +++ b/docs/requirements/path-unwinding-forwarding-requirements.md @@ -0,0 +1,99 @@ + + +# Business requirements + +The implementation of fungible token path unwinding vastly simplifies token transfers for end users. End users are unlikely to understand IBC denominations in great detail, and the consequences a direct transfer from chain A, to chain B can have on the fungibility of a token at the destination chain B, when the token sent is not a native or originating token from chain A, and is native to another chain, e.g. chain C. + +Path unwinding reduces the complexity of token transfer for the end user; a user simply needs to choose the final destination for their tokens and the complexity of determining the optimal route is abstracted away. This is a huge user experience improvement. + +In addition to unwinding, when a user recieves their token on a destination chain, they then want to use the token in some way. By enabling token forwarding, a user can recieve a token, perform some action with that token, for example a swap, and then send the token onto another chain. We observe that the complexity of IBC is increasingly being abstracted away from end users and automating workflows such as transfer, swap and forward with a single signed transaction significantly enhances usability. + +## Problem + +A fungible token A transferred from chain A to chain B is an IBC denomination at chain B, where the IBC denom trace records the path the token has travelled to reach its destination chain. + +A user now wants to send this IBC denomination of token A, originating from chain A, onto another chain, chain C. If a user transfers token A on chain B directly to chain C, it will not be fungible with token A sent directly from chain A to chain C. This is because the IBC denomination of token A on chain C is different in both cases due to token A travelling along different paths to reach the same destination. This is the most simple case of the problem involving only 3 chains. + +However, this problem is prevalent within the ecosystem and there are cases of IBC denominations on chains with >2 hops in the path. + +Regarding forwarding, if a user wants to transfer tokens between chains, then perform an action with those tokens, without forwarding, a user would have to sign each transaction on every chain and wait for the tokens to arrive at the destination before performing the next action. This is time consuming and a provides a poor user experience, a user also cannot just specify the desired outcome of their workflow in a trivial way. + +## Objectives + +To enable end users to automatically and atomically unwind fungible tokens when they specify a destination chain, so that tokens arrive at the destination chain with only 1 hop in the path and to be able to forward the token to another destination after it has been unwound. + +## Scope + +| Features | Release | +| --------- | ------- | +| Automatic and atomic path unwinding for fungible tokens suitable for end users initiating a transfer | v9.0.0 | +| Token forwarding for fungible tokens for end users initiating a transfer | v9.0.0 | + +# User requirements + +## Use cases + +### 1. Moving non-native assets between DeFi opportunities on different chains + +Users transfer tokens from an origin chain to a DeFi chain to benefit from yield opportunities or other use cases on that chain, different from the origin chain. A better yield opportunity could then arise and a user would want to move the tokens to another chain to take advantage of this opportunity. Rather than having to manually route the tokens back through the originating chain onto the new chain, it would be much simpler if they could only be concerned with the final destination they want the tokens to arrive at. + +For example, ATOM is native to the Cosmos Hub, a user could transfer ATOM to Osmosis and deposit in a liquidity pool to earn yield on this token. After depositing their ATOM into a pool on Osmosis, a better yield opportunity could arise, for example a better pool APY on another Cosmos DEX, e.g. Crescent or a better yield on lending ATOM on Umee. The user would then want to transfer the ATOM from Osmosis to Crescent (or Umee). + +### 2. Transferring liquid staking derivatives + +Liquid staking derivatives are minted on liquid staking zones and represent a staked asset. There is a common misconception from users that these derivatives originate on the chain of the original staked token. This results in users sending derivatives back to the chain of the natively staked token and then onto the next destination. + +For examples, a user has stATOM on Osmosis, they want to move the stATOM to Evmos, instead of going from Osmosis --> Stride --> Evmos, a user tries to unwind themself and routes the tokens Osmosis --> Cosmos Hub --> Evmos. + +### 3. Moving a token that originated from an interoperability zone or chain, or asset issuer + +Tokens that originate from other blockchain ecosystems that don't yet support IBC, flow into the Cosmos ecosystem through interoperability zones. These tokens are then sent onto other chains with a specific use case for these tokens and a user could want to move this token from one chain to another. + +For example, ETH from Ethereum flows into Osmosis via Axelar, where the final step moving ETH from Ethereum to Osmosis uses an ICS-20 transfer from Axelar to Osmosis. A user may then want to move ETH from Osmosis onto another chain, for example Injective. However, the path with 1 hop would be a transfer from Axelar to Injective. + +### 4. Moving a token from one chain to another, swapping the token and transferring it onwards to a new destination + +A user on one chain, for example the Cosmos Hub holds an asset, e.g. ATOM and wants to instead have AKT on Akash. The user must transfer to ATOM to a DEX chain, swap the ATOM for AKT and then send the AKT onwards to Akash. + +# Functional requirements + +## Assumptions and dependencies + +1. A functional relayer implementation is required for this feature. +2. Routing information for the final hop for unwinding or for forwarding is configured for the user through a front end client, or configured by another means using off-chain data. +3. The feature will have no impact on the existing function of a typical ICS-20 transfer where a native token is sent to another chain. +4. Fees are not within the scope of these requirements. +5. The functionality to enable a specific action before forwarding is not in scope of these requirements. +6. If a transfer contains multiple unique tokens, the unwinding and forwarding functionalities only need to support unwinding or forwarding through the same path, i.e. if there is a transfer containing a native token and 1 hop denom being sent from source to destination, both tokens would always go through the same path. In the future, it may be desirable for different tokens to be unwound through different paths, to support actions such as atomic transfer and supply liquidity to a liquidity pool, but it is currently out of scope for the first version of this feature. + +## Features + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 1.01 | When a user initiates a transfer to a destination chain with an IBC denom with > 1 hop, the token shall be sent back to its originating chain before being sent onto the destination as a user selected option | | `Draft` | +| 1.02 | If a user wants to unwind tokens, then they can select this as option for the transfer | | `Draft` | +| 1.03 | The unwinding shall completely succeed or the tokens are recoverable on the chain they were sent from by the user | | `Draft` | +| 1.04 | When unwinding is used in combination with forwarding, both the unwind and forwarding should succeed or the tokens should be recoverable on the sending chain | | `Draft` | +| 1.05 | The forwarding mechanism shall allow a user to transfer tokens beyond the first destination for those tokens | | `Draft` | +| 1.06 | The forwarding mechanism shall allow tokens to have some action performed on them before being sent onto a new destination | | `Draft` | +| 1.07 | The routing information for forwarding or to go from unwound token to destination must be input with the initial transfer | | `Draft` | +| 1.08 | If an intermediate chain does not have the unwinding or forwarding functionality, the tokens must be recoverable on the sending chain | | `Draft` | +| 1.09 | If unwinding or forwarding fails, then the reason for the failure should be returned in an error | | `Draft` | +| 1.10 | When unwinding, it should be possible for the forwarding path to be evaluated implicitly from introspecting the denomination trace or to be explicitly input as forwarding hops by the user | | `Draft` | +| 1.11 | When using unwinding in combination with x/authz, a granter can specify the allowed forwarding paths | | `Draft` | + +# External interface requirements + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 2.01 | There must be a CLI interface to initiate a transfer using path unwinding | | `Draft` | +| 2.02 | There must be a CLI interface to initiate a transfer using forwarding | | `Draft` | +| 2.03 | There must be a CLI interface to initiate a transfer using unwinding and forwarding in combination | | `Draft` | + +# Non-functional requirements + +## Security + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 3.01 | It must not be possible for a users tokens to be intercepted by another actor during path-unwinding or token forwarding | | `Draft` | diff --git a/e2e/go.mod b/e2e/go.mod index 00a3d222c217..50f7d32d1204 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -13,10 +13,10 @@ replace ( require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/x/upgrade v0.1.3 - github.com/cometbft/cometbft v0.38.10 - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.5.0 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cometbft/cometbft v0.38.11 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-00010101000000-000000000000 github.com/cosmos/ibc-go/v9 v9.0.0 github.com/docker/docker v24.0.7+incompatible @@ -25,7 +25,7 @@ require ( github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 - golang.org/x/mod v0.19.0 + golang.org/x/mod v0.20.0 google.golang.org/grpc v1.65.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -38,14 +38,14 @@ require ( cloud.google.com/go/iam v1.1.9 // indirect cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/api v0.7.5 // indirect - cosmossdk.io/client/v2 v2.0.0-beta.2 // indirect + cosmossdk.io/client/v2 v2.0.0-beta.3 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/core v0.11.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/log v1.3.1 // indirect + cosmossdk.io/core v0.11.1 // indirect + cosmossdk.io/depinject v1.0.0 // indirect + cosmossdk.io/log v1.4.1 // indirect cosmossdk.io/store v1.1.0 // indirect cosmossdk.io/x/feegrant v0.1.1 // indirect - cosmossdk.io/x/tx v0.13.3 // indirect + cosmossdk.io/x/tx v0.13.4 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -53,7 +53,7 @@ require ( github.com/ChainSafe/go-schnorrkel v1.1.0 // indirect github.com/ChainSafe/go-schnorrkel/1 v0.0.0-00010101000000-000000000000 // indirect github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420 // indirect - github.com/CosmWasm/wasmvm/v2 v2.1.0 // indirect + github.com/CosmWasm/wasmvm/v2 v2.1.2 // indirect github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect @@ -215,7 +215,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.19.0 // indirect @@ -236,19 +236,19 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.22.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect diff --git a/e2e/go.sum b/e2e/go.sum index 946031aaf670..27883a64447f 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -188,18 +188,18 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.2 h1:jnTKB0PLb7qunQibijAftwmNjUbsIAf1sPjF5HaCW/E= -cosmossdk.io/client/v2 v2.0.0-beta.2/go.mod h1:8QAyewD7rDWeJGqedFBpeqJ9XLIJAkt1TDhCf1gsN9o= +cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= @@ -210,10 +210,10 @@ cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -233,8 +233,8 @@ github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRr github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420 h1:oknQF/iIhf5lVjbwjsVDzDByupRhga8nhA3NAmwyHDA= github.com/ComposableFi/go-subkey/v2 v2.0.0-tm03420/go.mod h1:KYkiMX5AbOlXXYfxkrYPrRPV6EbVUALTQh5ptUOJzu8= -github.com/CosmWasm/wasmvm/v2 v2.1.0 h1:bleLhNA36hM8iPjFJsNRi9RjrQW6MtXafw2+wVjAWAE= -github.com/CosmWasm/wasmvm/v2 v2.1.0/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= +github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20= +github.com/CosmWasm/wasmvm/v2 v2.1.2/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -361,8 +361,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= -github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -377,16 +377,16 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= -github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= @@ -1036,8 +1036,8 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1163,8 +1163,8 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1204,8 +1204,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1265,8 +1265,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1405,13 +1405,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1672,8 +1672,8 @@ google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGr google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= diff --git a/e2e/sample.config.extended.yaml b/e2e/sample.config.extended.yaml index 64b5d7a7da54..034dc396c437 100644 --- a/e2e/sample.config.extended.yaml +++ b/e2e/sample.config.extended.yaml @@ -13,12 +13,12 @@ # | RELAYER_ID | The type of relayer to use (rly/hermes) | hermes | -# see sample.config.yaml for a bare minium configuration example. +# see sample.config.yaml for a bare minimum configuration example. # set env E2E_CONFIG_PATH to point to this file to use it. --- chains: # the entry at index 0 corresponds to CHAIN_A -- chainId: chain-1 +- chainId: chainA-1 numValidators: 4 numFullNodes: 1 image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE @@ -26,7 +26,7 @@ chains: binary: simd # override with CHAIN_BINARY # the entry at index 1 corresponds to CHAIN_B -- chainId: chain-2 +- chainId: chainB-1 numValidators: 4 numFullNodes: 1 image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index 225182db43a9..dbc408db5757 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -147,6 +147,13 @@ func (tc TestConfig) validateChains() error { } } } + + // clienttypes.ParseChainID is used to determine revision heights. If the chainIDs are not in the expected format, + // tests can fail with timeout errors. + if clienttypes.ParseChainID(tc.GetChainAID()) != clienttypes.ParseChainID(tc.GetChainBID()) { + return fmt.Errorf("ensure both chainIDs are in the format {chainID}-{revision} and have the same revision. Got: chainA: %s, chainB: %s", tc.GetChainAID(), tc.GetChainBID()) + } + return nil } @@ -229,19 +236,21 @@ func (tc TestConfig) GetChainNumFullNodes(idx int) int { } // GetChainAID returns the chain-id for chain A. +// NOTE: the default return value will ensure that ParseChainID will return 1 as the revision number. func (tc TestConfig) GetChainAID() string { if tc.ChainConfigs[0].ChainID != "" { return tc.ChainConfigs[0].ChainID } - return "chain-1" + return "chainA-1" } // GetChainBID returns the chain-id for chain B. +// NOTE: the default return value will ensure that ParseChainID will return 1 as the revision number. func (tc TestConfig) GetChainBID() string { if tc.ChainConfigs[1].ChainID != "" { return tc.ChainConfigs[1].ChainID } - return "chain-2" + return "chainB-1" } // GetChainName returns the name of the chain given an index. diff --git a/go.mod b/go.mod index 92b8b89c510a..629fdd2616cf 100644 --- a/go.mod +++ b/go.mod @@ -6,25 +6,25 @@ module github.com/cosmos/ibc-go/v9 require ( cosmossdk.io/api v0.7.5 - cosmossdk.io/client/v2 v2.0.0-beta.2 - cosmossdk.io/core v0.11.0 + cosmossdk.io/client/v2 v2.0.0-beta.3 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 - cosmossdk.io/log v1.3.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 - cosmossdk.io/x/tx v0.13.3 - cosmossdk.io/x/upgrade v0.1.3 - github.com/cometbft/cometbft v0.38.10 + cosmossdk.io/x/tx v0.13.4 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cometbft/cometbft v0.38.11 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.5.0 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/modules/capability v1.0.1 github.com/cosmos/ics23/go v0.10.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-metrics v0.5.3 - github.com/spf13/cast v1.6.0 + github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 @@ -41,7 +41,7 @@ require ( cloud.google.com/go/iam v1.1.9 // indirect cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/depinject v1.0.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -177,18 +177,18 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/go.sum b/go.sum index a1ea8506d9e5..24afccc55ea4 100644 --- a/go.sum +++ b/go.sum @@ -188,26 +188,26 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.2 h1:jnTKB0PLb7qunQibijAftwmNjUbsIAf1sPjF5HaCW/E= -cosmossdk.io/client/v2 v2.0.0-beta.2/go.mod h1:8QAyewD7rDWeJGqedFBpeqJ9XLIJAkt1TDhCf1gsN9o= +cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -327,8 +327,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= -github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -343,15 +343,15 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= -github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= @@ -925,8 +925,8 @@ github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIK github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1037,8 +1037,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1137,8 +1137,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1276,13 +1276,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1542,8 +1542,8 @@ google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGr google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= diff --git a/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go b/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go index 4671b48211dc..11951cbe6553 100644 --- a/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go +++ b/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go @@ -123,10 +123,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { "ICA auth module does not claim channel capability", func() { @@ -140,7 +140,7 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() { return version, nil } - }, true, + }, nil, }, { "ICA auth module modification of channel version is ignored", func() { @@ -152,12 +152,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() { ) (string, error) { return "invalid-version", nil } - }, true, + }, nil, }, { "controller submodule disabled", func() { suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false)) - }, false, + }, types.ErrControllerSubModuleDisabled, }, { "ICA auth module callback fails", func() { @@ -167,12 +167,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() { ) (string, error) { return "", fmt.Errorf("mock ica auth fails") } - }, false, + }, fmt.Errorf("mock ica auth fails"), }, { "nil underlying app", func() { isNilApp = true - }, true, + }, nil, }, { "middleware disabled", func() { @@ -184,7 +184,7 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() { ) (string, error) { return "", fmt.Errorf("error should be unreachable") } - }, true, + }, nil, }, } @@ -243,11 +243,11 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() { path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, chanCap, channel.Counterparty, channel.Version, ) - if tc.expPass { + if tc.expErr == nil { suite.Require().Equal(TestVersion, version) suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expErr.Error()) } }) } @@ -316,20 +316,20 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { "controller submodule disabled", func() { suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false)) - }, false, + }, types.ErrControllerSubModuleDisabled, }, { "ICA OnChanOpenACK fails - invalid version", func() { path.EndpointB.ChannelConfig.Version = invalidVersion - }, false, + }, ibcerrors.ErrInvalidType, }, { "ICA auth module callback fails", func() { @@ -338,12 +338,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() { ) error { return fmt.Errorf("mock ica auth fails") } - }, false, + }, fmt.Errorf("mock ica auth fails"), }, { "nil underlying app", func() { isNilApp = true - }, true, + }, nil, }, { "middleware disabled", func() { @@ -354,7 +354,7 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() { ) error { return fmt.Errorf("error should be unreachable") } - }, true, + }, nil, }, } @@ -389,10 +389,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() { cbs = controller.NewIBCMiddleware(suite.chainA.GetSimApp().ICAControllerKeeper) } - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expErr.Error()) } }) } @@ -485,15 +485,15 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { "nil underlying app", func() { isNilApp = true - }, true, + }, nil, }, } @@ -525,10 +525,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() { err = cbs.OnChanCloseConfirm( suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } @@ -537,9 +537,9 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() { func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() { testCases := []struct { - name string - malleate func() - expPass bool + name string + malleate func() + expSuccess bool }{ { "ICA OnRecvPacket fails with ErrInvalidChannelFlow", func() {}, false, @@ -580,7 +580,7 @@ func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() { ctx := suite.chainA.GetContext() ack := cbs.OnRecvPacket(ctx, path.EndpointA.GetChannel().Version, packet, nil) - suite.Require().Equal(tc.expPass, ack.Success()) + suite.Require().Equal(tc.expSuccess, ack.Success()) expectedEvents := sdk.Events{ sdk.NewEvent( @@ -608,17 +608,17 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "controller submodule disabled", func() { suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false)) - }, false, + }, types.ErrControllerSubModuleDisabled, }, { "ICA auth module callback fails", func() { @@ -627,12 +627,12 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() { ) error { return fmt.Errorf("mock ica auth fails") } - }, false, + }, fmt.Errorf("mock ica auth fails"), }, { "nil underlying app", func() { isNilApp = true - }, true, + }, nil, }, { "middleware disabled", func() { @@ -643,7 +643,7 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() { ) error { return fmt.Errorf("error should be unreachable") } - }, true, + }, nil, }, } @@ -686,10 +686,10 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() { err = cbs.OnAcknowledgementPacket(suite.chainA.GetContext(), path.EndpointA.GetChannel().Version, packet, []byte("ack"), nil) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expErr.Error()) } }) } @@ -705,17 +705,17 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "controller submodule disabled", func() { suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false)) - }, false, + }, types.ErrControllerSubModuleDisabled, }, { "ICA auth module callback fails", func() { @@ -724,12 +724,12 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() { ) error { return fmt.Errorf("mock ica auth fails") } - }, false, + }, fmt.Errorf("mock ica auth fails"), }, { "nil underlying app", func() { isNilApp = true - }, true, + }, nil, }, { "middleware disabled", func() { @@ -740,7 +740,7 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() { ) error { return fmt.Errorf("error should be unreachable") } - }, true, + }, nil, }, } @@ -783,10 +783,10 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() { err = cbs.OnTimeoutPacket(suite.chainA.GetContext(), path.EndpointA.GetChannel().Version, packet, nil) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.expErr.Error()) } }) } @@ -1124,12 +1124,10 @@ func (suite *InterchainAccountsTestSuite) TestSingleHostMultipleControllers() { testCases := []struct { msg string malleate func() - expPass bool }{ { "success", func() {}, - true, }, } diff --git a/modules/apps/27-interchain-accounts/controller/keeper/account_test.go b/modules/apps/27-interchain-accounts/controller/keeper/account_test.go index d8dab0db249e..13196d7314be 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/account_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/account_test.go @@ -18,10 +18,10 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { "port is already bound for owner but capability is claimed by another module", @@ -30,14 +30,14 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount() { err := suite.chainA.GetSimApp().TransferKeeper.ClaimCapability(suite.chainA.GetContext(), capability, host.PortPath(TestPortID)) suite.Require().NoError(err) }, - false, + icatypes.ErrPortAlreadyBound, }, { "fails to generate port-id", func() { owner = "" }, - false, + icatypes.ErrInvalidAccountAddress, }, { "MsgChanOpenInit fails - channel is already active & in state OPEN", @@ -45,6 +45,9 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount() { portID, err := icatypes.NewControllerPortID(TestOwnerAddress) suite.Require().NoError(err) + channelID := channeltypes.FormatChannelIdentifier(suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.GetNextChannelSequence(suite.chainA.GetContext())) + path.EndpointA.ChannelID = channelID + suite.chainA.GetSimApp().ICAControllerKeeper.SetActiveChannelID(suite.chainA.GetContext(), ibctesting.FirstConnectionID, portID, path.EndpointA.ChannelID) counterparty := channeltypes.NewCounterparty(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) @@ -57,7 +60,7 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount() { } suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.SetChannel(suite.chainA.GetContext(), portID, path.EndpointA.ChannelID, channel) }, - false, + icatypes.ErrActiveChannelAlreadySet, }, } @@ -76,10 +79,10 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount() { err = suite.chainA.GetSimApp().ICAControllerKeeper.RegisterInterchainAccount(suite.chainA.GetContext(), path.EndpointA.ConnectionID, owner, TestVersion, ordering) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } diff --git a/modules/apps/27-interchain-accounts/controller/keeper/events.go b/modules/apps/27-interchain-accounts/controller/keeper/events.go index c0fe4518b905..8c894e9e1f03 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/events.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/events.go @@ -13,8 +13,15 @@ import ( // EmitAcknowledgementEvent emits an event signalling a successful or failed acknowledgement and including the error // details if any. +<<<<<<< HEAD func EmitAcknowledgementEvent(ctx context.Context, packet channeltypes.Packet, ack exported.Acknowledgement, err error) { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 +||||||| 2028e9a34 +func EmitAcknowledgementEvent(ctx sdk.Context, packet channeltypes.Packet, ack exported.Acknowledgement, err error) { +======= +func EmitAcknowledgementEvent(ctx context.Context, packet channeltypes.Packet, ack exported.Acknowledgement, err error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 +>>>>>>> main attributes := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, icatypes.ModuleName), sdk.NewAttribute(icatypes.AttributeKeyControllerChannelID, packet.GetDestChannel()), diff --git a/modules/apps/27-interchain-accounts/controller/keeper/grpc_query_test.go b/modules/apps/27-interchain-accounts/controller/keeper/grpc_query_test.go index 71e9eb96bad0..cc2002a25400 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/grpc_query_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/grpc_query_test.go @@ -12,33 +12,33 @@ func (suite *KeeperTestSuite) TestQueryInterchainAccount() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, + "", }, { "empty request", func() { req = nil }, - false, + "empty request", }, { "empty owner address", func() { req.Owner = "" }, - false, + "failed to generate portID from owner address: owner address cannot be empty: invalid account address", }, { "invalid connection, account address not found", func() { req.ConnectionId = "invalid-connection-id" }, - false, + "failed to retrieve account address", }, } @@ -64,14 +64,14 @@ func (suite *KeeperTestSuite) TestQueryInterchainAccount() { res, err := suite.chainA.GetSimApp().ICAControllerKeeper.InterchainAccount(suite.chainA.GetContext(), req) - if tc.expPass { + if tc.errMsg == "" { expAddress, exists := suite.chainB.GetSimApp().ICAHostKeeper.GetInterchainAccountAddress(suite.chainB.GetContext(), path.EndpointB.ConnectionID, path.EndpointA.ChannelConfig.PortID) suite.Require().True(exists) suite.Require().NoError(err) suite.Require().Equal(expAddress, res.Address) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } diff --git a/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go b/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go index 35bac8a80c3b..abc062b16496 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go @@ -294,11 +294,14 @@ func (suite *KeeperTestSuite) TestOnChanOpenInit() { Version: string(versionBytes), } - chanCap, err = suite.chainA.App.GetScopedIBCKeeper().NewCapability(suite.chainA.GetContext(), host.ChannelCapabilityPath(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)) - suite.Require().NoError(err) + channelID := channeltypes.FormatChannelIdentifier(suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.GetNextChannelSequence(suite.chainA.GetContext())) + path.EndpointA.ChannelID = channelID tc.malleate() // malleate mutates test data + chanCap, err = suite.chainA.App.GetScopedIBCKeeper().NewCapability(suite.chainA.GetContext(), host.ChannelCapabilityPath(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)) + suite.Require().NoError(err) + version, err := suite.chainA.GetSimApp().ICAControllerKeeper.OnChanOpenInit(suite.chainA.GetContext(), channel.Ordering, channel.ConnectionHops, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, chanCap, channel.Counterparty, channel.Version, ) @@ -325,31 +328,31 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { "invalid port ID - host chain", func() { path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID }, - false, + icatypes.ErrInvalidControllerPort, }, { "invalid port ID - unexpected prefix", func() { path.EndpointA.ChannelConfig.PortID = "invalid-port-id" }, - false, + icatypes.ErrInvalidControllerPort, }, { "invalid metadata bytestring", func() { path.EndpointA.Counterparty.ChannelConfig.Version = "invalid-metadata-bytestring" }, - false, + ibcerrors.ErrInvalidType, }, { "unsupported encoding format", @@ -361,7 +364,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { path.EndpointA.Counterparty.ChannelConfig.Version = string(versionBytes) }, - false, + icatypes.ErrInvalidCodec, }, { "unsupported transaction type", @@ -373,7 +376,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { path.EndpointA.Counterparty.ChannelConfig.Version = string(versionBytes) }, - false, + icatypes.ErrUnknownDataType, }, { "invalid account address", @@ -385,7 +388,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { path.EndpointA.Counterparty.ChannelConfig.Version = string(versionBytes) }, - false, + icatypes.ErrInvalidAccountAddress, }, { "empty account address", @@ -397,7 +400,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { path.EndpointA.Counterparty.ChannelConfig.Version = string(versionBytes) }, - false, + icatypes.ErrInvalidAccountAddress, }, { "invalid counterparty version", @@ -409,7 +412,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { path.EndpointA.Counterparty.ChannelConfig.Version = string(versionBytes) }, - false, + icatypes.ErrInvalidVersion, }, { "active channel already set", @@ -420,7 +423,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { // set the active channelID in state suite.chainA.GetSimApp().ICAControllerKeeper.SetActiveChannelID(suite.chainA.GetContext(), ibctesting.FirstConnectionID, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) - }, false, + }, icatypes.ErrActiveChannelAlreadySet, }, } @@ -455,7 +458,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, path.EndpointA.Counterparty.ChannelConfig.Version, ) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) activeChannelID, found := suite.chainA.GetSimApp().ICAControllerKeeper.GetActiveChannelID(suite.chainA.GetContext(), ibctesting.FirstConnectionID, path.EndpointA.ChannelConfig.PortID) @@ -468,7 +471,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { suite.Require().Equal(metadata.Address, interchainAccAddress) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } @@ -481,10 +484,10 @@ func (suite *KeeperTestSuite) TestOnChanCloseConfirm() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, } @@ -508,7 +511,7 @@ func (suite *KeeperTestSuite) TestOnChanCloseConfirm() { activeChannelID, found := suite.chainB.GetSimApp().ICAControllerKeeper.GetActiveChannelID(suite.chainB.GetContext(), ibctesting.FirstConnectionID, path.EndpointB.ChannelConfig.PortID) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) suite.Require().False(found) suite.Require().Empty(activeChannelID) diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go index 84535602dbd9..f17f146112e8 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go @@ -81,9 +81,18 @@ func (k Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper { } // Logger returns the application logger, scoped to the associated module +<<<<<<< HEAD func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 return sdkCtx.Logger().With("module", fmt.Sprintf("x/%s-%s", exported.ModuleName, icatypes.ModuleName)) +||||||| 2028e9a34 +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s-%s", exported.ModuleName, icatypes.ModuleName)) +======= +func (Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return sdkCtx.Logger().With("module", fmt.Sprintf("x/%s-%s", exported.ModuleName, icatypes.ModuleName)) +>>>>>>> main } // GetConnectionID returns the connection id for the given port and channelIDs. @@ -112,28 +121,67 @@ func (k Keeper) GetAllPorts(ctx context.Context) []string { } // setPort sets the provided portID in state +<<<<<<< HEAD func (k Keeper) setPort(ctx context.Context, portID string) { store := k.storeService.OpenKVStore(ctx) store.Set(icatypes.KeyPort(portID), []byte{0x01}) +||||||| 2028e9a34 +func (k Keeper) setPort(ctx sdk.Context, portID string) { + store := ctx.KVStore(k.storeKey) + store.Set(icatypes.KeyPort(portID), []byte{0x01}) +======= +func (k Keeper) setPort(ctx context.Context, portID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(icatypes.KeyPort(portID), []byte{0x01}); err != nil { + panic(err) + } +>>>>>>> main } // hasCapability checks if the interchain account controller module owns the port capability for the desired port +<<<<<<< HEAD func (k Keeper) hasCapability(ctx context.Context, portID string) bool { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 _, ok := k.scopedKeeper.GetCapability(sdkCtx, host.PortPath(portID)) +||||||| 2028e9a34 +func (k Keeper) hasCapability(ctx sdk.Context, portID string) bool { + _, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID)) +======= +func (k Keeper) hasCapability(ctx context.Context, portID string) bool { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, ok := k.scopedKeeper.GetCapability(sdkCtx, host.PortPath(portID)) +>>>>>>> main return ok } // AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function +<<<<<<< HEAD func (k Keeper) AuthenticateCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) bool { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 return k.scopedKeeper.AuthenticateCapability(sdkCtx, cap, name) +||||||| 2028e9a34 +func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool { + return k.scopedKeeper.AuthenticateCapability(ctx, cap, name) +======= +func (k Keeper) AuthenticateCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) bool { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return k.scopedKeeper.AuthenticateCapability(sdkCtx, cap, name) +>>>>>>> main } // ClaimCapability wraps the scopedKeeper's ClaimCapability function +<<<<<<< HEAD func (k Keeper) ClaimCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) error { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 return k.scopedKeeper.ClaimCapability(sdkCtx, cap, name) +||||||| 2028e9a34 +func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { + return k.scopedKeeper.ClaimCapability(ctx, cap, name) +======= +func (k Keeper) ClaimCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return k.scopedKeeper.ClaimCapability(sdkCtx, cap, name) +>>>>>>> main } // GetAppVersion calls the ICS4Wrapper GetAppVersion function. @@ -146,12 +194,22 @@ func (k Keeper) GetActiveChannelID(ctx context.Context, connectionID, portID str store := k.storeService.OpenKVStore(ctx) key := icatypes.KeyActiveChannel(portID, connectionID) +<<<<<<< HEAD has, err := store.Has(key) if err != nil { panic(err) } if !has { +||||||| 2028e9a34 + if !store.Has(key) { +======= + bz, err := store.Get(key) + if err != nil { + panic(err) + } + if len(bz) == 0 { +>>>>>>> main return "", false } bz, err := store.Get(key) @@ -159,7 +217,13 @@ func (k Keeper) GetActiveChannelID(ctx context.Context, connectionID, portID str panic(err) } +<<<<<<< HEAD return string(bz), true // todo: why the cast? +||||||| 2028e9a34 + return string(store.Get(key)), true +======= + return string(bz), true +>>>>>>> main } // GetOpenActiveChannel retrieves the active channelID from the store, keyed by the provided connectionID and portID & checks if the channel in question is in state OPEN @@ -217,9 +281,21 @@ func (k Keeper) GetAllActiveChannels(ctx context.Context) []genesistypes.ActiveC } // SetActiveChannelID stores the active channelID, keyed by the provided connectionID and portID +<<<<<<< HEAD func (k Keeper) SetActiveChannelID(ctx context.Context, connectionID, portID, channelID string) { store := k.storeService.OpenKVStore(ctx) store.Set(icatypes.KeyActiveChannel(portID, connectionID), []byte(channelID)) +||||||| 2028e9a34 +func (k Keeper) SetActiveChannelID(ctx sdk.Context, connectionID, portID, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Set(icatypes.KeyActiveChannel(portID, connectionID), []byte(channelID)) +======= +func (k Keeper) SetActiveChannelID(ctx context.Context, connectionID, portID, channelID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(icatypes.KeyActiveChannel(portID, connectionID), []byte(channelID)); err != nil { + panic(err) + } +>>>>>>> main } // IsActiveChannel returns true if there exists an active channel for the provided connectionID and portID, otherwise false @@ -233,20 +309,36 @@ func (k Keeper) GetInterchainAccountAddress(ctx context.Context, connectionID, p store := k.storeService.OpenKVStore(ctx) key := icatypes.KeyOwnerAccount(portID, connectionID) +<<<<<<< HEAD has, err := store.Has(key) if err != nil { panic(err) } if !has { +||||||| 2028e9a34 + if !store.Has(key) { +======= + bz, err := store.Get(key) + if err != nil { + panic(err) + } + if len(bz) == 0 { +>>>>>>> main return "", false } +<<<<<<< HEAD bz, err := store.Get(key) if err != nil { panic(err) } return string(bz), true // todo: why the cast? +||||||| 2028e9a34 + return string(store.Get(key)), true +======= + return string(bz), true +>>>>>>> main } // GetAllInterchainAccounts returns a list of all registered interchain account addresses and their associated connection and controller port identifiers @@ -271,9 +363,21 @@ func (k Keeper) GetAllInterchainAccounts(ctx context.Context) []genesistypes.Reg } // SetInterchainAccountAddress stores the InterchainAccount address, keyed by the associated connectionID and portID +<<<<<<< HEAD func (k Keeper) SetInterchainAccountAddress(ctx context.Context, connectionID, portID, address string) { store := k.storeService.OpenKVStore(ctx) store.Set(icatypes.KeyOwnerAccount(portID, connectionID), []byte(address)) +||||||| 2028e9a34 +func (k Keeper) SetInterchainAccountAddress(ctx sdk.Context, connectionID, portID, address string) { + store := ctx.KVStore(k.storeKey) + store.Set(icatypes.KeyOwnerAccount(portID, connectionID), []byte(address)) +======= +func (k Keeper) SetInterchainAccountAddress(ctx context.Context, connectionID, portID, address string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(icatypes.KeyOwnerAccount(portID, connectionID), []byte(address)); err != nil { + panic(err) + } +>>>>>>> main } // IsMiddlewareEnabled returns true if the underlying application callbacks are enabled for given port and connection identifier pair, otherwise false @@ -297,21 +401,57 @@ func (k Keeper) IsMiddlewareDisabled(ctx context.Context, portID, connectionID s } // SetMiddlewareEnabled stores a flag to indicate that the underlying application callbacks should be enabled for the given port and connection identifier pair +<<<<<<< HEAD func (k Keeper) SetMiddlewareEnabled(ctx context.Context, portID, connectionID string) { store := k.storeService.OpenKVStore(ctx) store.Set(icatypes.KeyIsMiddlewareEnabled(portID, connectionID), icatypes.MiddlewareEnabled) +||||||| 2028e9a34 +func (k Keeper) SetMiddlewareEnabled(ctx sdk.Context, portID, connectionID string) { + store := ctx.KVStore(k.storeKey) + store.Set(icatypes.KeyIsMiddlewareEnabled(portID, connectionID), icatypes.MiddlewareEnabled) +======= +func (k Keeper) SetMiddlewareEnabled(ctx context.Context, portID, connectionID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(icatypes.KeyIsMiddlewareEnabled(portID, connectionID), icatypes.MiddlewareEnabled); err != nil { + panic(err) + } +>>>>>>> main } // SetMiddlewareDisabled stores a flag to indicate that the underlying application callbacks should be disabled for the given port and connection identifier pair +<<<<<<< HEAD func (k Keeper) SetMiddlewareDisabled(ctx context.Context, portID, connectionID string) { store := k.storeService.OpenKVStore(ctx) store.Set(icatypes.KeyIsMiddlewareEnabled(portID, connectionID), icatypes.MiddlewareDisabled) +||||||| 2028e9a34 +func (k Keeper) SetMiddlewareDisabled(ctx sdk.Context, portID, connectionID string) { + store := ctx.KVStore(k.storeKey) + store.Set(icatypes.KeyIsMiddlewareEnabled(portID, connectionID), icatypes.MiddlewareDisabled) +======= +func (k Keeper) SetMiddlewareDisabled(ctx context.Context, portID, connectionID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(icatypes.KeyIsMiddlewareEnabled(portID, connectionID), icatypes.MiddlewareDisabled); err != nil { + panic(err) + } +>>>>>>> main } // DeleteMiddlewareEnabled deletes the middleware enabled flag stored in state +<<<<<<< HEAD func (k Keeper) DeleteMiddlewareEnabled(ctx context.Context, portID, connectionID string) { store := k.storeService.OpenKVStore(ctx) store.Delete(icatypes.KeyIsMiddlewareEnabled(portID, connectionID)) +||||||| 2028e9a34 +func (k Keeper) DeleteMiddlewareEnabled(ctx sdk.Context, portID, connectionID string) { + store := ctx.KVStore(k.storeKey) + store.Delete(icatypes.KeyIsMiddlewareEnabled(portID, connectionID)) +======= +func (k Keeper) DeleteMiddlewareEnabled(ctx context.Context, portID, connectionID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Delete(icatypes.KeyIsMiddlewareEnabled(portID, connectionID)); err != nil { + panic(err) + } +>>>>>>> main } // GetAuthority returns the ica/controller submodule's authority. @@ -349,5 +489,7 @@ func (k Keeper) GetParams(ctx context.Context) types.Params { func (k Keeper) SetParams(ctx context.Context, params types.Params) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(¶ms) - store.Set([]byte(types.ParamsKey), bz) + if err := store.Set([]byte(types.ParamsKey), bz); err != nil { + panic(err) + } } diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go index 966d2ea9ecfd..bffb0a871052 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go @@ -113,7 +113,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { testCases := []struct { name string instantiateFn func() - expPass bool + errMsg string }{ {"success", func() { keeper.NewKeeper( @@ -127,7 +127,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.chainA.GetSimApp().MsgServiceRouter(), suite.chainA.GetSimApp().ICAControllerKeeper.GetAuthority(), ) - }, true}, + }, ""}, {"failure: empty authority", func() { keeper.NewKeeper( suite.chainA.GetSimApp().AppCodec(), @@ -140,7 +140,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.chainA.GetSimApp().MsgServiceRouter(), "", // authority ) - }, false}, + }, "authority must be non-empty"}, } for _, tc := range testCases { @@ -148,12 +148,13 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.SetupTest() suite.Run(tc.name, func() { - if tc.expPass { + if tc.errMsg == "" { suite.Require().NotPanics( tc.instantiateFn, ) } else { - suite.Require().Panics( + suite.Require().PanicsWithError( + tc.errMsg, tc.instantiateFn, ) } @@ -312,7 +313,7 @@ func (suite *KeeperTestSuite) TestSetAndGetParams() { testCases := []struct { name string input types.Params - expPass bool + expPass bool // This is currently always true. }{ // it is not possible to set invalid booleans {"success: set params false", types.NewParams(false), true}, diff --git a/modules/apps/27-interchain-accounts/controller/keeper/migrations.go b/modules/apps/27-interchain-accounts/controller/keeper/migrations.go index ac6e2fb41c75..ad69ceacc65c 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/migrations.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/migrations.go @@ -1,16 +1,9 @@ package keeper import ( - "fmt" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" controllertypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/types" - icatypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/types" - host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ) // Migrator is a struct for handling in-place store migrations. @@ -25,32 +18,6 @@ func NewMigrator(k *Keeper) Migrator { } } -// AssertChannelCapabilityMigrations checks that all channel capabilities generated using the interchain accounts controller port prefix -// are owned by the controller submodule and ibc. -func (m Migrator) AssertChannelCapabilityMigrations(ctx sdk.Context) error { - if m.keeper != nil { - filteredChannels := m.keeper.channelKeeper.GetAllChannelsWithPortPrefix(ctx, icatypes.ControllerPortPrefix) - for _, ch := range filteredChannels { - name := host.ChannelCapabilityPath(ch.PortId, ch.ChannelId) - capability, found := m.keeper.scopedKeeper.GetCapability(ctx, name) - if !found { - m.keeper.Logger(ctx).Error(fmt.Sprintf("failed to find capability: %s", name)) - return errorsmod.Wrapf(capabilitytypes.ErrCapabilityNotFound, "failed to find capability: %s", name) - } - - isAuthenticated := m.keeper.scopedKeeper.AuthenticateCapability(ctx, capability, name) - if !isAuthenticated { - m.keeper.Logger(ctx).Error(fmt.Sprintf("expected capability owner: %s", controllertypes.SubModuleName)) - return errorsmod.Wrapf(capabilitytypes.ErrCapabilityNotOwned, "expected capability owner: %s", controllertypes.SubModuleName) - } - - m.keeper.SetMiddlewareEnabled(ctx, ch.PortId, ch.ConnectionHops[0]) - m.keeper.Logger(ctx).Info("successfully migrated channel capability", "name", name) - } - } - return nil -} - // MigrateParams migrates the controller submodule's parameters from the x/params to self store. func (m Migrator) MigrateParams(ctx sdk.Context) error { if m.keeper != nil { diff --git a/modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go b/modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go index f1b278950c23..6a1999f6a82a 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go @@ -3,83 +3,17 @@ package keeper_test import ( "fmt" +<<<<<<< HEAD "github.com/cosmos/cosmos-sdk/runtime" +||||||| 2028e9a34 +======= + "github.com/cosmos/cosmos-sdk/runtime" + +>>>>>>> main icacontrollerkeeper "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/keeper" icacontrollertypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/types" - icatypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/types" - channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v9/testing" ) -func (suite *KeeperTestSuite) TestAssertChannelCapabilityMigrations() { - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "success", - func() {}, - true, - }, - { - "channel with different port is filtered out", - func() { - portIDWithOutPrefix := ibctesting.MockPort - suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.SetChannel(suite.chainA.GetContext(), portIDWithOutPrefix, ibctesting.FirstChannelID, channeltypes.Channel{ - ConnectionHops: []string{ibctesting.FirstConnectionID}, - }) - }, - true, - }, - { - "capability not found", - func() { - portIDWithPrefix := fmt.Sprintf("%s%s", icatypes.ControllerPortPrefix, "port-without-capability") - suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.SetChannel(suite.chainA.GetContext(), portIDWithPrefix, ibctesting.FirstChannelID, channeltypes.Channel{ - ConnectionHops: []string{ibctesting.FirstConnectionID}, - }) - }, - false, - }, - } - - for _, ordering := range []channeltypes.Order{channeltypes.UNORDERED, channeltypes.ORDERED} { - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - suite.SetupTest() - - path := NewICAPath(suite.chainA, suite.chainB, ordering) - path.SetupConnections() - - err := SetupICAPath(path, ibctesting.TestAccAddress) - suite.Require().NoError(err) - - tc.malleate() - - migrator := icacontrollerkeeper.NewMigrator(&suite.chainA.GetSimApp().ICAControllerKeeper) - err = migrator.AssertChannelCapabilityMigrations(suite.chainA.GetContext()) - - if tc.expPass { - suite.Require().NoError(err) - - isMiddlewareEnabled := suite.chainA.GetSimApp().ICAControllerKeeper.IsMiddlewareEnabled( - suite.chainA.GetContext(), - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ConnectionID, - ) - - suite.Require().True(isMiddlewareEnabled) - } else { - suite.Require().Error(err) - } - }) - } - } -} - func (suite *KeeperTestSuite) TestMigratorMigrateParams() { testCases := []struct { msg string diff --git a/modules/apps/27-interchain-accounts/controller/keeper/msg_server_test.go b/modules/apps/27-interchain-accounts/controller/keeper/msg_server_test.go index 5616904c2dec..d81abf18c005 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/msg_server_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/msg_server_test.go @@ -11,8 +11,10 @@ import ( "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/keeper" "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/types" icatypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/types" + connectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -25,51 +27,51 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount_MsgServer() { testCases := []struct { name string - expPass bool malleate func() + expErr error }{ { "success", - true, func() {}, + nil, }, { "success: ordering falls back to UNORDERED if not specified", - true, func() { msg.Ordering = channeltypes.NONE expectedOrderding = channeltypes.UNORDERED }, + nil, }, { - "invalid connection id", - false, + "success: non-empty owner address is valid", func() { - msg.ConnectionId = "connection-100" + msg.Owner = "" }, + nil, }, { - "non-empty owner address is valid", - true, + "invalid connection id", func() { - msg.Owner = "" + msg.ConnectionId = "connection-100" }, + connectiontypes.ErrConnectionNotFound, }, { "empty address invalid", - false, func() { msg.Owner = "" }, + icatypes.ErrInvalidAccountAddress, }, { "port is already bound for owner but capability is claimed by another module", - false, func() { capability := suite.chainA.GetSimApp().IBCKeeper.PortKeeper.BindPort(suite.chainA.GetContext(), TestPortID) err := suite.chainA.GetSimApp().TransferKeeper.ClaimCapability(suite.chainA.GetContext(), capability, host.PortPath(TestPortID)) suite.Require().NoError(err) }, + icatypes.ErrPortAlreadyBound, }, } @@ -93,7 +95,7 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount_MsgServer() { msgServer := keeper.NewMsgServerImpl(&suite.chainA.GetSimApp().ICAControllerKeeper) res, err := msgServer.RegisterInterchainAccount(ctx, msg) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(expectedChannelID, res.ChannelId) @@ -108,7 +110,7 @@ func (suite *KeeperTestSuite) TestRegisterInterchainAccount_MsgServer() { channel := path.EndpointA.GetChannel() suite.Require().Equal(expectedOrderding, channel.Ordering) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) suite.Require().Nil(res) } }) @@ -125,31 +127,31 @@ func (suite *KeeperTestSuite) TestSubmitTx() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() { }, - true, + nil, }, { "failure - owner address is empty", func() { msg.Owner = "" }, - false, + icatypes.ErrInvalidAccountAddress, }, { "failure - active channel does not exist for connection ID", func() { msg.Owner = TestOwnerAddress msg.ConnectionId = "connection-100" }, - false, + icatypes.ErrActiveChannelNotFound, }, { "failure - active channel does not exist for port ID", func() { msg.Owner = "invalid-owner" }, - false, + icatypes.ErrActiveChannelNotFound, }, { "failure - controller module does not own capability for this channel", func() { @@ -160,7 +162,7 @@ func (suite *KeeperTestSuite) TestSubmitTx() { // set the active channel with the incorrect portID in order to reach the capability check suite.chainA.GetSimApp().ICAControllerKeeper.SetActiveChannelID(suite.chainA.GetContext(), path.EndpointA.ConnectionID, portID, path.EndpointA.ChannelID) }, - false, + icatypes.ErrActiveChannelNotFound, }, } @@ -212,11 +214,11 @@ func (suite *KeeperTestSuite) TestSubmitTx() { msgServer := keeper.NewMsgServerImpl(&suite.chainA.GetSimApp().ICAControllerKeeper) res, err := msgServer.SendTx(ctx, msg) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) suite.Require().NotNil(res) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) suite.Require().Nil(res) } }) @@ -228,34 +230,34 @@ func (suite *KeeperTestSuite) TestSubmitTx() { func (suite *KeeperTestSuite) TestUpdateParams() { signer := suite.chainA.GetSimApp().TransferKeeper.GetAuthority() testCases := []struct { - name string - msg *types.MsgUpdateParams - expPass bool + name string + msg *types.MsgUpdateParams + expErr error }{ { "success: valid signer and default params", types.NewMsgUpdateParams(signer, types.NewParams(!types.DefaultControllerEnabled)), - true, + nil, }, { "failure: malformed signer address", types.NewMsgUpdateParams(ibctesting.InvalidID, types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, { "failure: empty signer address", types.NewMsgUpdateParams("", types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, { "failure: whitespace signer address", types.NewMsgUpdateParams(" ", types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, { "failure: unauthorized signer address", types.NewMsgUpdateParams(ibctesting.TestAccAddress, types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, } @@ -265,12 +267,12 @@ func (suite *KeeperTestSuite) TestUpdateParams() { suite.Run(tc.name, func() { suite.SetupTest() _, err := suite.chainA.GetSimApp().ICAControllerKeeper.UpdateParams(suite.chainA.GetContext(), tc.msg) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) p := suite.chainA.GetSimApp().ICAControllerKeeper.GetParams(suite.chainA.GetContext()) suite.Require().Equal(tc.msg.Params, p) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } diff --git a/modules/apps/27-interchain-accounts/controller/keeper/relay_test.go b/modules/apps/27-interchain-accounts/controller/keeper/relay_test.go index 73c471a439a6..5279bbb27d22 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/relay_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/relay_test.go @@ -23,7 +23,7 @@ func (suite *KeeperTestSuite) TestSendTx() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ { "success", @@ -45,7 +45,7 @@ func (suite *KeeperTestSuite) TestSendTx() { Data: data, } }, - true, + nil, }, { "success with multiple sdk.Msg", @@ -74,7 +74,7 @@ func (suite *KeeperTestSuite) TestSendTx() { Data: data, } }, - true, + nil, }, { "data is nil", @@ -84,35 +84,35 @@ func (suite *KeeperTestSuite) TestSendTx() { Data: nil, } }, - false, + icatypes.ErrInvalidOutgoingData, }, { "active channel not found", func() { path.EndpointA.ChannelConfig.PortID = "invalid-port-id" }, - false, + icatypes.ErrActiveChannelNotFound, }, { "channel in INIT state - optimistic packet sends fail", func() { path.EndpointA.UpdateChannel(func(channel *channeltypes.Channel) { channel.State = channeltypes.INIT }) }, - false, + icatypes.ErrActiveChannelNotFound, }, { "sendPacket fails - channel closed", func() { path.EndpointA.UpdateChannel(func(channel *channeltypes.Channel) { channel.State = channeltypes.CLOSED }) }, - false, + icatypes.ErrActiveChannelNotFound, }, { "controller submodule disabled", func() { suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false)) }, - false, + types.ErrControllerSubModuleDisabled, }, { "timeout timestamp is not in the future", @@ -136,7 +136,7 @@ func (suite *KeeperTestSuite) TestSendTx() { timeoutTimestamp = uint64(suite.chainA.GetContext().BlockTime().UnixNano()) }, - false, + icatypes.ErrInvalidTimeoutTimestamp, }, } @@ -156,13 +156,13 @@ func (suite *KeeperTestSuite) TestSendTx() { tc.malleate() // malleate mutates test data - //nolint: staticcheck // SA1019: ibctesting.FirstConnectionID is deprecated: use path.EndpointA.ConnectionID instead. (staticcheck) + // nolint: staticcheck // SA1019: ibctesting.FirstConnectionID is deprecated: use path.EndpointA.ConnectionID instead. (staticcheck) _, err = suite.chainA.GetSimApp().ICAControllerKeeper.SendTx(suite.chainA.GetContext(), nil, ibctesting.FirstConnectionID, path.EndpointA.ChannelConfig.PortID, packetData, timeoutTimestamp) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } @@ -175,12 +175,12 @@ func (suite *KeeperTestSuite) TestOnTimeoutPacket() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, } @@ -212,7 +212,7 @@ func (suite *KeeperTestSuite) TestOnTimeoutPacket() { err = suite.chainA.GetSimApp().ICAControllerKeeper.OnTimeoutPacket(suite.chainA.GetContext(), packet) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { suite.Require().Error(err) diff --git a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations.go b/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations.go deleted file mode 100644 index 8e2a4f29fb9c..000000000000 --- a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations.go +++ /dev/null @@ -1,78 +0,0 @@ -package v6 - -import ( - "cosmossdk.io/store/prefix" - storetypes "cosmossdk.io/store/types" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - controllertypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/types" - ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported" -) - -// MigrateICS27ChannelCapability performs a search on a prefix store using the provided store key and module name. -// It retrieves the associated channel capability index and reassigns ownership to the ICS27 controller submodule. -func MigrateICS27ChannelCapability( - ctx sdk.Context, - cdc codec.BinaryCodec, - capabilityStoreKey storetypes.StoreKey, - capabilityKeeper *capabilitykeeper.Keeper, - module string, // the name of the scoped keeper for the underlying app module -) error { - // construct a prefix store using the x/capability index prefix: index->capability owners - prefixStore := prefix.NewStore(ctx.KVStore(capabilityStoreKey), capabilitytypes.KeyPrefixIndexCapability) - iterator := storetypes.KVStorePrefixIterator(prefixStore, nil) - defer sdk.LogDeferred(ctx.Logger(), func() error { return iterator.Close() }) - - for ; iterator.Valid(); iterator.Next() { - // unmarshal the capability index value and set of owners - index := capabilitytypes.IndexFromKey(iterator.Key()) - - var owners capabilitytypes.CapabilityOwners - cdc.MustUnmarshal(iterator.Value(), &owners) - - if !hasIBCOwner(owners.GetOwners()) { - continue - } - - for _, owner := range owners.GetOwners() { - if owner.Module == module { - // remove the owner from the set - owners.Remove(owner) - - // reassign the owner module to icacontroller - owner.Module = controllertypes.SubModuleName - - // add the controller submodule to the set of owners - if err := owners.Set(owner); err != nil { - return err - } - - // set the new owners for the current capability index - capabilityKeeper.SetOwners(ctx, index, owners) - } - } - } - - // initialise the x/capability memstore - capabilityKeeper.InitMemStore(ctx) - - return nil -} - -func hasIBCOwner(owners []capabilitytypes.Owner) bool { - if len(owners) != 2 { - return false - } - - for _, owner := range owners { - if owner.Module == ibcexported.ModuleName { - return true - } - } - - return false -} diff --git a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go b/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go deleted file mode 100644 index e7f79b81feda..000000000000 --- a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go +++ /dev/null @@ -1,199 +0,0 @@ -package v6_test - -import ( - "testing" - - testifysuite "github.com/stretchr/testify/suite" - - sdk "github.com/cosmos/cosmos-sdk/types" - - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/migrations/v6" - "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/types" - icatypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/types" - channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v9/modules/core/24-host" - ibctesting "github.com/cosmos/ibc-go/v9/testing" - ibcmock "github.com/cosmos/ibc-go/v9/testing/mock" -) - -type MigrationsTestSuite struct { - testifysuite.Suite - - chainA *ibctesting.TestChain - chainB *ibctesting.TestChain - - coordinator *ibctesting.Coordinator - path *ibctesting.Path -} - -func (suite *MigrationsTestSuite) SetupTest() { - version := icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID) - - suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) - - suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) - suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) - - suite.path = ibctesting.NewPath(suite.chainA, suite.chainB) - suite.path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID - suite.path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID - suite.path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED - suite.path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED - suite.path.EndpointA.ChannelConfig.Version = version - suite.path.EndpointB.ChannelConfig.Version = version -} - -func (suite *MigrationsTestSuite) SetupPath() error { - if err := suite.RegisterInterchainAccount(suite.path.EndpointA, ibctesting.TestAccAddress); err != nil { - return err - } - - if err := suite.path.EndpointB.ChanOpenTry(); err != nil { - return err - } - - if err := suite.path.EndpointA.ChanOpenAck(); err != nil { - return err - } - - return suite.path.EndpointB.ChanOpenConfirm() -} - -func (*MigrationsTestSuite) RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) error { - portID, err := icatypes.NewControllerPortID(owner) - if err != nil { - return err - } - - channelSequence := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextChannelSequence(endpoint.Chain.GetContext()) - - if err := endpoint.Chain.GetSimApp().ICAControllerKeeper.RegisterInterchainAccount(endpoint.Chain.GetContext(), endpoint.ConnectionID, owner, endpoint.ChannelConfig.Version, channeltypes.ORDERED); err != nil { - return err - } - - // commit state changes for proof verification - endpoint.Chain.NextBlock() - - // update port/channel ids - endpoint.ChannelID = channeltypes.FormatChannelIdentifier(channelSequence) - endpoint.ChannelConfig.PortID = portID - - return nil -} - -func TestKeeperTestSuite(t *testing.T) { - testifysuite.Run(t, new(MigrationsTestSuite)) -} - -func (suite *MigrationsTestSuite) TestMigrateICS27ChannelCapability() { - suite.SetupTest() - suite.path.SetupConnections() - - err := suite.SetupPath() - suite.Require().NoError(err) - - // create additional capabilities to cover edge cases - suite.CreateMockCapabilities() - - // create and claim a new capability with ibc/mock for "channel-1" - // note: suite.SetupPath() now claims the channel capability using icacontroller for "channel-0" - capName := host.ChannelCapabilityPath(suite.path.EndpointA.ChannelConfig.PortID, channeltypes.FormatChannelIdentifier(1)) - - capability, err := suite.chainA.GetSimApp().ScopedIBCKeeper.NewCapability(suite.chainA.GetContext(), capName) - suite.Require().NoError(err) - - err = suite.chainA.GetSimApp().ScopedICAMockKeeper.ClaimCapability(suite.chainA.GetContext(), capability, capName) - suite.Require().NoError(err) - - // assert the capability is owned by the mock module - capability, found := suite.chainA.GetSimApp().ScopedICAMockKeeper.GetCapability(suite.chainA.GetContext(), capName) - suite.Require().NotNil(capability) - suite.Require().True(found) - - isAuthenticated := suite.chainA.GetSimApp().ScopedICAMockKeeper.AuthenticateCapability(suite.chainA.GetContext(), capability, capName) - suite.Require().True(isAuthenticated) - - capability, found = suite.chainA.GetSimApp().ScopedICAControllerKeeper.GetCapability(suite.chainA.GetContext(), capName) - suite.Require().Nil(capability) - suite.Require().False(found) - - suite.ResetMemStore() // empty the x/capability in-memory store - - err = v6.MigrateICS27ChannelCapability( - suite.chainA.GetContext(), - suite.chainA.Codec, - suite.chainA.GetSimApp().GetKey(capabilitytypes.StoreKey), - suite.chainA.GetSimApp().CapabilityKeeper, - ibcmock.ModuleName+types.SubModuleName, - ) - - suite.Require().NoError(err) - - // assert the capability is now owned by the ICS27 controller submodule - capability, found = suite.chainA.GetSimApp().ScopedICAControllerKeeper.GetCapability(suite.chainA.GetContext(), capName) - suite.Require().NotNil(capability) - suite.Require().True(found) - - isAuthenticated = suite.chainA.GetSimApp().ScopedICAControllerKeeper.AuthenticateCapability(suite.chainA.GetContext(), capability, capName) - suite.Require().True(isAuthenticated) - - capability, found = suite.chainA.GetSimApp().ScopedICAMockKeeper.GetCapability(suite.chainA.GetContext(), capName) - suite.Require().Nil(capability) - suite.Require().False(found) - - // ensure channel capability for "channel-0" is still owned by the controller - capName = host.ChannelCapabilityPath(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) - capability, found = suite.chainA.GetSimApp().ScopedICAControllerKeeper.GetCapability(suite.chainA.GetContext(), capName) - suite.Require().NotNil(capability) - suite.Require().True(found) - - isAuthenticated = suite.chainA.GetSimApp().ScopedICAControllerKeeper.AuthenticateCapability(suite.chainA.GetContext(), capability, capName) - suite.Require().True(isAuthenticated) - - suite.AssertMockCapabiltiesUnchanged() -} - -// CreateMockCapabilities creates an additional two capabilities used for testing purposes: -// 1. A capability with a single owner -// 2. A capability with two owners, neither of which is "ibc" -func (suite *MigrationsTestSuite) CreateMockCapabilities() { - capability, err := suite.chainA.GetSimApp().ScopedIBCMockKeeper.NewCapability(suite.chainA.GetContext(), "mock_one") - suite.Require().NoError(err) - suite.Require().NotNil(capability) - - capability, err = suite.chainA.GetSimApp().ScopedICAMockKeeper.NewCapability(suite.chainA.GetContext(), "mock_two") - suite.Require().NoError(err) - suite.Require().NotNil(capability) - - err = suite.chainA.GetSimApp().ScopedIBCMockKeeper.ClaimCapability(suite.chainA.GetContext(), capability, "mock_two") - suite.Require().NoError(err) -} - -// AssertMockCapabiltiesUnchanged authenticates the mock capabilities created at the start of the test to ensure they remain unchanged -func (suite *MigrationsTestSuite) AssertMockCapabiltiesUnchanged() { - capability, found := suite.chainA.GetSimApp().ScopedIBCMockKeeper.GetCapability(suite.chainA.GetContext(), "mock_one") - suite.Require().True(found) - suite.Require().NotNil(capability) - - capability, found = suite.chainA.GetSimApp().ScopedIBCMockKeeper.GetCapability(suite.chainA.GetContext(), "mock_two") - suite.Require().True(found) - suite.Require().NotNil(capability) - - isAuthenticated := suite.chainA.GetSimApp().ScopedICAMockKeeper.AuthenticateCapability(suite.chainA.GetContext(), capability, "mock_two") - suite.Require().True(isAuthenticated) -} - -// ResetMemstore removes all existing fwd and rev capability kv pairs and deletes `KeyMemInitialised` from the x/capability memstore. -// This effectively mocks a new chain binary being started. Migration code is run against persisted state only and allows the memstore to be reinitialised. -func (suite *MigrationsTestSuite) ResetMemStore() { - memStore := suite.chainA.GetContext().KVStore(suite.chainA.GetSimApp().GetMemKey(capabilitytypes.MemStoreKey)) - memStore.Delete(capabilitytypes.KeyMemInitialized) - - iterator := memStore.Iterator(nil, nil) - defer sdk.LogDeferred(suite.chainA.GetContext().Logger(), func() error { return iterator.Close() }) - - for ; iterator.Valid(); iterator.Next() { - memStore.Delete(iterator.Key()) - } -} diff --git a/modules/apps/27-interchain-accounts/controller/types/codec_test.go b/modules/apps/27-interchain-accounts/controller/types/codec_test.go index 3a584cb3b950..e45fcb2967f2 100644 --- a/modules/apps/27-interchain-accounts/controller/types/codec_test.go +++ b/modules/apps/27-interchain-accounts/controller/types/codec_test.go @@ -1,6 +1,7 @@ package types_test import ( + "fmt" "testing" "github.com/stretchr/testify/require" @@ -16,27 +17,27 @@ func TestCodecTypeRegistration(t *testing.T) { testCases := []struct { name string typeURL string - expPass bool + expErr error }{ { "success: MsgRegisterInterchainAccount", sdk.MsgTypeURL(&types.MsgRegisterInterchainAccount{}), - true, + nil, }, { "success: MsgSendTx", sdk.MsgTypeURL(&types.MsgSendTx{}), - true, + nil, }, { "success: MsgUpdateParams", sdk.MsgTypeURL(&types.MsgUpdateParams{}), - true, + nil, }, { "type not registered on codec", "ibc.invalid.MsgTypeURL", - false, + fmt.Errorf("unable to resolve type URL"), }, } @@ -47,12 +48,14 @@ func TestCodecTypeRegistration(t *testing.T) { encodingCfg := moduletestutil.MakeTestEncodingConfig(ica.AppModuleBasic{}) msg, err := encodingCfg.Codec.InterfaceRegistry().Resolve(tc.typeURL) - if tc.expPass { + fmt.Printf("%+v\n", err) + + if tc.expErr == nil { require.NotNil(t, msg) require.NoError(t, err) } else { require.Nil(t, msg) - require.Error(t, err) + require.ErrorContains(t, err, tc.expErr.Error()) } }) } diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs_test.go b/modules/apps/27-interchain-accounts/controller/types/msgs_test.go index 929408279b29..602e3a729660 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs_test.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs_test.go @@ -1,6 +1,7 @@ package types_test import ( + "errors" "testing" "github.com/cosmos/gogoproto/proto" @@ -15,6 +16,8 @@ import ( icatypes "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/types" feetypes "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -24,19 +27,19 @@ func TestMsgRegisterInterchainAccountValidateBasic(t *testing.T) { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success: with empty channel version", func() { msg.Version = "" }, - true, + nil, }, { "success: with fee enabled channel version", @@ -49,35 +52,35 @@ func TestMsgRegisterInterchainAccountValidateBasic(t *testing.T) { bz := feetypes.ModuleCdc.MustMarshalJSON(&feeMetadata) msg.Version = string(bz) }, - true, + nil, }, { "connection id is invalid", func() { msg.ConnectionId = "" }, - false, + host.ErrInvalidID, }, { "owner address is empty", func() { msg.Owner = "" }, - false, + ibcerrors.ErrInvalidAddress, }, { "owner address is too long", func() { msg.Owner = ibctesting.GenerateString(types.MaximumOwnerLength + 1) }, - false, + ibcerrors.ErrInvalidAddress, }, { "order is not valid", func() { msg.Ordering = channeltypes.NONE }, - false, + channeltypes.ErrInvalidChannelOrdering, }, } @@ -94,10 +97,10 @@ func TestMsgRegisterInterchainAccountValidateBasic(t *testing.T) { tc.malleate() err := msg.ValidateBasic() - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) } else { - require.Error(t, err, "invalid test case %d passed: %s", i, tc.name) + require.ErrorIs(t, err, tc.expErr, "invalid test case %d passed: %s", i, tc.name) } } } @@ -119,47 +122,47 @@ func TestMsgSendTxValidateBasic(t *testing.T) { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "connection id is invalid", func() { msg.ConnectionId = "" }, - false, + host.ErrInvalidID, }, { "owner address is empty", func() { msg.Owner = "" }, - false, + ibcerrors.ErrInvalidAddress, }, { "owner address is too long", func() { msg.Owner = ibctesting.GenerateString(types.MaximumOwnerLength + 1) }, - false, + ibcerrors.ErrInvalidAddress, }, { "relative timeout is not set", func() { msg.RelativeTimeout = 0 }, - false, + ibcerrors.ErrInvalidRequest, }, { "messages array is empty", func() { msg.PacketData = icatypes.InterchainAccountPacketData{} }, - false, + icatypes.ErrInvalidOutgoingData, }, } @@ -192,10 +195,10 @@ func TestMsgSendTxValidateBasic(t *testing.T) { tc.malleate() err = msg.ValidateBasic() - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) } else { - require.Error(t, err, "invalid test case %d passed: %s", i, tc.name) + require.ErrorIs(t, err, tc.expErr, "invalid test case %d passed: %s", i, tc.name) } } } @@ -234,23 +237,23 @@ func TestMsgSendTxGetSigners(t *testing.T) { // TestMsgUpdateParamsValidateBasic tests ValidateBasic for MsgUpdateParams func TestMsgUpdateParamsValidateBasic(t *testing.T) { testCases := []struct { - name string - msg *types.MsgUpdateParams - expPass bool + name string + msg *types.MsgUpdateParams + expErr error }{ - {"success: valid signer and valid params", types.NewMsgUpdateParams(ibctesting.TestAccAddress, types.DefaultParams()), true}, - {"failure: invalid signer with valid params", types.NewMsgUpdateParams("invalidAddress", types.DefaultParams()), false}, - {"failure: empty signer with valid params", types.NewMsgUpdateParams("", types.DefaultParams()), false}, + {"success: valid signer and valid params", types.NewMsgUpdateParams(ibctesting.TestAccAddress, types.DefaultParams()), nil}, + {"failure: invalid signer with valid params", types.NewMsgUpdateParams("invalidAddress", types.DefaultParams()), ibcerrors.ErrInvalidAddress}, + {"failure: empty signer with valid params", types.NewMsgUpdateParams("", types.DefaultParams()), ibcerrors.ErrInvalidAddress}, } for i, tc := range testCases { i, tc := i, tc err := tc.msg.ValidateBasic() - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) } else { - require.Error(t, err, "invalid test case %d passed: %s", i, tc.name) + require.ErrorIs(t, err, tc.expErr, "invalid test case %d passed: %s", i, tc.name) } } } @@ -260,10 +263,10 @@ func TestMsgUpdateParamsGetSigners(t *testing.T) { testCases := []struct { name string address sdk.AccAddress - expPass bool + expErr error }{ - {"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), true}, - {"failure: nil address", nil, false}, + {"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), nil}, + {"failure: nil address", nil, errors.New("empty address string is not allowed")}, } for _, tc := range testCases { @@ -276,11 +279,11 @@ func TestMsgUpdateParamsGetSigners(t *testing.T) { encodingCfg := moduletestutil.MakeTestEncodingConfig(ica.AppModuleBasic{}) signers, _, err := encodingCfg.Codec.GetMsgV1Signers(&msg) - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err) require.Equal(t, tc.address.Bytes(), signers[0]) } else { - require.Error(t, err) + require.ErrorContains(t, err, tc.expErr.Error()) } } diff --git a/modules/apps/27-interchain-accounts/host/ibc_module_test.go b/modules/apps/27-interchain-accounts/host/ibc_module_test.go index 58c55c407def..ba88fbdd3fa6 100644 --- a/modules/apps/27-interchain-accounts/host/ibc_module_test.go +++ b/modules/apps/27-interchain-accounts/host/ibc_module_test.go @@ -142,10 +142,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { "account address generation is block dependent", func() { @@ -156,12 +156,7 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() { // ensure account registration is simulated in a separate block suite.chainB.NextBlock() - }, true, - }, - { - "host submodule disabled", func() { - suite.chainB.GetSimApp().ICAHostKeeper.SetParams(suite.chainB.GetContext(), types.NewParams(false, []string{})) - }, false, + }, nil, }, { "success: ICA auth module callback returns error", func() { @@ -172,7 +167,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() { ) (string, error) { return "", fmt.Errorf("mock ica auth fails") } - }, true, + }, nil, + }, + { + "host submodule disabled", func() { + suite.chainB.GetSimApp().ICAHostKeeper.SetParams(suite.chainB.GetContext(), types.NewParams(false, []string{})) + }, types.ErrHostSubModuleDisabled, }, } @@ -218,14 +218,14 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() { path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, chanCap, channel.Counterparty, path.EndpointA.ChannelConfig.Version, ) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) addr, exists := suite.chainB.GetSimApp().ICAHostKeeper.GetInterchainAccountAddress(suite.chainB.GetContext(), path.EndpointB.ConnectionID, counterparty.PortId) suite.Require().True(exists) suite.Require().NotNil(addr) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) suite.Require().Equal("", version) } }) @@ -274,15 +274,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenConfirm() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, - }, - { - "host submodule disabled", func() { - suite.chainB.GetSimApp().ICAHostKeeper.SetParams(suite.chainB.GetContext(), types.NewParams(false, []string{})) - }, false, + "success", func() {}, nil, }, { "success: ICA auth module callback returns error", func() { @@ -292,7 +287,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenConfirm() { ) error { return fmt.Errorf("mock ica auth fails") } - }, true, + }, nil, + }, + { + "host submodule disabled", func() { + suite.chainB.GetSimApp().ICAHostKeeper.SetParams(suite.chainB.GetContext(), types.NewParams(false, []string{})) + }, types.ErrHostSubModuleDisabled, }, } @@ -324,10 +324,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenConfirm() { err = cbs.OnChanOpenConfirm(suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } @@ -365,10 +365,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, } @@ -395,10 +395,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() { err = cbs.OnChanCloseConfirm( suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } @@ -549,10 +549,10 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "ICA OnAcknowledgementPacket fails with ErrInvalidChannelFlow", func() {}, false, + "ICA OnAcknowledgementPacket fails with ErrInvalidChannelFlow", func() {}, icatypes.ErrInvalidChannelFlow, }, } @@ -590,10 +590,10 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() { err = cbs.OnAcknowledgementPacket(suite.chainB.GetContext(), path.EndpointB.GetChannel().Version, packet, []byte("ackBytes"), nil) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } @@ -604,10 +604,10 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "ICA OnTimeoutPacket fails with ErrInvalidChannelFlow", func() {}, false, + "ICA OnTimeoutPacket fails with ErrInvalidChannelFlow", func() {}, icatypes.ErrInvalidChannelFlow, }, } @@ -645,10 +645,10 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() { err = cbs.OnTimeoutPacket(suite.chainA.GetContext(), path.EndpointA.GetChannel().Version, packet, nil) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } @@ -854,7 +854,7 @@ func (suite *InterchainAccountsTestSuite) TestControlAccountAfterChannelClose() params := types.NewParams(true, []string{sdk.MsgTypeURL(msg)}) suite.chainB.GetSimApp().ICAHostKeeper.SetParams(suite.chainB.GetContext(), params) - //nolint: staticcheck // SA1019: ibctesting.FirstConnectionID is deprecated: use path.EndpointA.ConnectionID instead. (staticcheck) + // nolint: staticcheck // SA1019: ibctesting.FirstConnectionID is deprecated: use path.EndpointA.ConnectionID instead. (staticcheck) _, err = suite.chainA.GetSimApp().ICAControllerKeeper.SendTx(suite.chainA.GetContext(), nil, ibctesting.FirstConnectionID, path.EndpointA.ChannelConfig.PortID, icaPacketData, ^uint64(0)) suite.Require().NoError(err) err = path.EndpointB.UpdateClient() @@ -880,7 +880,7 @@ func (suite *InterchainAccountsTestSuite) TestControlAccountAfterChannelClose() path.EndpointB.ChannelID = "" path.CreateChannels() - //nolint: staticcheck // SA1019: ibctesting.FirstConnectionID is deprecated: use path.EndpointA.ConnectionID instead. (staticcheck) + // nolint: staticcheck // SA1019: ibctesting.FirstConnectionID is deprecated: use path.EndpointA.ConnectionID instead. (staticcheck) _, err = suite.chainA.GetSimApp().ICAControllerKeeper.SendTx(suite.chainA.GetContext(), nil, ibctesting.FirstConnectionID, path.EndpointA.ChannelConfig.PortID, icaPacketData, ^uint64(0)) suite.Require().NoError(err) err = path.EndpointB.UpdateClient() diff --git a/modules/apps/27-interchain-accounts/host/keeper/events.go b/modules/apps/27-interchain-accounts/host/keeper/events.go index f1563be7d4f5..708505f5d67b 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/events.go +++ b/modules/apps/27-interchain-accounts/host/keeper/events.go @@ -14,8 +14,14 @@ import ( // EmitAcknowledgementEvent emits an event signalling a successful or failed acknowledgement and including the error // details if any. +<<<<<<< HEAD func EmitAcknowledgementEvent(ctx context.Context, packet channeltypes.Packet, ack exported.Acknowledgement, err error) { +||||||| 2028e9a34 +func EmitAcknowledgementEvent(ctx sdk.Context, packet channeltypes.Packet, ack exported.Acknowledgement, err error) { +======= +func EmitAcknowledgementEvent(ctx context.Context, packet channeltypes.Packet, ack exported.Acknowledgement, err error) { +>>>>>>> main attributes := []sdk.Attribute{ sdk.NewAttribute(sdk.AttributeKeyModule, icatypes.ModuleName), sdk.NewAttribute(icatypes.AttributeKeyHostChannelID, packet.GetDestChannel()), @@ -25,8 +31,16 @@ func EmitAcknowledgementEvent(ctx context.Context, packet channeltypes.Packet, a if err != nil { attributes = append(attributes, sdk.NewAttribute(icatypes.AttributeKeyAckError, err.Error())) } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC sdkCtx.EventManager().EmitEvent( +||||||| 2028e9a34 + + ctx.EventManager().EmitEvent( +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + sdkCtx.EventManager().EmitEvent( +>>>>>>> main sdk.NewEvent( icatypes.EventTypePacket, attributes..., @@ -35,9 +49,18 @@ func EmitAcknowledgementEvent(ctx context.Context, packet channeltypes.Packet, a } // EmitHostDisabledEvent emits an event signalling that the host submodule is disabled. +<<<<<<< HEAD func EmitHostDisabledEvent(ctx context.Context, packet channeltypes.Packet) { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC sdkCtx.EventManager().EmitEvent( +||||||| 2028e9a34 +func EmitHostDisabledEvent(ctx sdk.Context, packet channeltypes.Packet) { + ctx.EventManager().EmitEvent( +======= +func EmitHostDisabledEvent(ctx context.Context, packet channeltypes.Packet) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + sdkCtx.EventManager().EmitEvent( +>>>>>>> main sdk.NewEvent( icatypes.EventTypePacket, sdk.NewAttribute(sdk.AttributeKeyModule, icatypes.ModuleName), diff --git a/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go b/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go index 109fb3d24497..101ea1eb8c8a 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go @@ -54,15 +54,15 @@ func (suite *KeeperTestSuite) TestInitGenesis() { func (suite *KeeperTestSuite) TestGenesisParams() { testCases := []struct { - name string - input types.Params - expPass bool + name string + input types.Params + expPanicMsg string }{ - {"success: set default params", types.DefaultParams(), true}, - {"success: non-default params", types.NewParams(!types.DefaultHostEnabled, []string{"/cosmos.staking.v1beta1.MsgDelegate"}), true}, - {"success: set empty byte for allow messages", types.NewParams(true, nil), true}, - {"failure: set empty string for allow messages", types.NewParams(true, []string{""}), false}, - {"failure: set space string for allow messages", types.NewParams(true, []string{" "}), false}, + {"success: set default params", types.DefaultParams(), ""}, + {"success: non-default params", types.NewParams(!types.DefaultHostEnabled, []string{"/cosmos.staking.v1beta1.MsgDelegate"}), ""}, + {"success: set empty byte for allow messages", types.NewParams(true, nil), ""}, + {"failure: set empty string for allow messages", types.NewParams(true, []string{""}), "could not set ica host params at genesis: parameter must not contain empty strings: []"}, + {"failure: set space string for allow messages", types.NewParams(true, []string{" "}), "could not set ica host params at genesis: parameter must not contain empty strings: [ ]"}, } for _, tc := range testCases { @@ -89,7 +89,7 @@ func (suite *KeeperTestSuite) TestGenesisParams() { Port: icatypes.HostPortID, Params: tc.input, } - if tc.expPass { + if tc.expPanicMsg == "" { keeper.InitGenesis(suite.chainA.GetContext(), suite.chainA.GetSimApp().ICAHostKeeper, genesisState) channelID, found := suite.chainA.GetSimApp().ICAHostKeeper.GetActiveChannelID(suite.chainA.GetContext(), ibctesting.FirstConnectionID, TestPortID) @@ -104,7 +104,7 @@ func (suite *KeeperTestSuite) TestGenesisParams() { params := suite.chainA.GetSimApp().ICAHostKeeper.GetParams(suite.chainA.GetContext()) suite.Require().Equal(expParams, params) } else { - suite.Require().Panics(func() { + suite.PanicsWithError(tc.expPanicMsg, func() { keeper.InitGenesis(suite.chainA.GetContext(), suite.chainA.GetSimApp().ICAHostKeeper, genesisState) }) } diff --git a/modules/apps/27-interchain-accounts/host/keeper/handshake.go b/modules/apps/27-interchain-accounts/host/keeper/handshake.go index 5beec992a3da..b095addac932 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/handshake.go +++ b/modules/apps/27-interchain-accounts/host/keeper/handshake.go @@ -72,8 +72,15 @@ func (k Keeper) OnChanOpenTry( // On the host chain the capability may only be claimed during the OnChanOpenTry // The capability being claimed in OpenInit is for a controller chain (the port is different) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if err = k.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +||||||| 2028e9a34 + if err = k.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if err = k.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +>>>>>>> main return "", errorsmod.Wrapf(err, "failed to claim capability for channel %s on port %s", channelID, portID) } diff --git a/modules/apps/27-interchain-accounts/host/keeper/handshake_test.go b/modules/apps/27-interchain-accounts/host/keeper/handshake_test.go index 9140d948695f..ab70bcb85b1c 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/handshake_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/handshake_test.go @@ -55,12 +55,12 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success - reopening closed active channel", @@ -73,7 +73,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { suite.openAndCloseChannel(path) }, - true, + nil, }, { "success - reopening account with new address", @@ -94,7 +94,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { _, found := suite.chainB.GetSimApp().ICAHostKeeper.GetInterchainAccountAddress(suite.chainB.GetContext(), path.EndpointB.ConnectionID, path.EndpointA.ChannelConfig.PortID) suite.Require().False(found) }, - true, + nil, }, { "success - empty host connection ID", @@ -106,7 +106,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { path.EndpointA.ChannelConfig.Version = string(versionBytes) }, - true, + nil, }, { "success - previous metadata is different", @@ -125,7 +125,15 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { channel.Version = string(versionBytes) path.EndpointB.SetChannel(*channel) - }, true, + }, nil, + }, + { + "invalid metadata bytestring", + func() { + // the try step will propose a new valid version + path.EndpointA.ChannelConfig.Version = "invalid-metadata-bytestring" + }, + nil, }, { "reopening account fails - no existing account", @@ -145,7 +153,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { acc := suite.chainB.GetSimApp().AccountKeeper.GetAccount(suite.chainB.GetContext(), sdk.MustAccAddressFromBech32(addr)) suite.chainB.GetSimApp().AccountKeeper.RemoveAccount(suite.chainB.GetContext(), acc) }, - false, + icatypes.ErrInvalidAccountReopening, }, { "reopening account fails - existing account is not interchain account type", @@ -170,7 +178,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { // overwrite existing account with only base account type, not intercahin account type suite.chainB.GetSimApp().AccountKeeper.SetAccount(suite.chainB.GetContext(), icaAcc.BaseAccount) }, - false, + icatypes.ErrInvalidAccountReopening, }, { "account already exists", @@ -180,14 +188,14 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { suite.Require().NoError(err) suite.Require().True(suite.chainB.GetSimApp().AccountKeeper.HasAccount(suite.chainB.GetContext(), interchainAccAddr)) }, - false, + icatypes.ErrAccountAlreadyExist, }, { "invalid port ID", func() { path.EndpointB.ChannelConfig.PortID = "invalid-port-id" //nolint:goconst }, - false, + icatypes.ErrInvalidHostPort, }, { "connection not found", @@ -195,15 +203,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { channel.ConnectionHops = []string{"invalid-connnection-id"} path.EndpointB.SetChannel(*channel) }, - false, - }, - { - "invalid metadata bytestring", - func() { - // the try step will propose a new valid version - path.EndpointA.ChannelConfig.Version = "invalid-metadata-bytestring" - }, - true, + connectiontypes.ErrConnectionNotFound, }, { "unsupported encoding format", @@ -215,7 +215,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { path.EndpointA.ChannelConfig.Version = string(versionBytes) }, - false, + icatypes.ErrInvalidCodec, }, { "unsupported transaction type", @@ -227,7 +227,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { path.EndpointA.ChannelConfig.Version = string(versionBytes) }, - false, + icatypes.ErrUnknownDataType, }, { "invalid controller connection ID", @@ -239,7 +239,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { path.EndpointA.ChannelConfig.Version = string(versionBytes) }, - false, + connectiontypes.ErrInvalidConnection, }, { "invalid counterparty version", @@ -251,7 +251,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { path.EndpointA.ChannelConfig.Version = string(versionBytes) }, - false, + icatypes.ErrInvalidVersion, }, { "capability already claimed", @@ -260,7 +260,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { err := suite.chainB.GetSimApp().ScopedICAHostKeeper.ClaimCapability(suite.chainB.GetContext(), chanCap, host.ChannelCapabilityPath(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID)) suite.Require().NoError(err) }, - false, + capabilitytypes.ErrOwnerClaimed, }, { "active channel already set (OPEN state)", @@ -272,7 +272,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { // set the active channelID in state suite.chainB.GetSimApp().ICAHostKeeper.SetActiveChannelID(suite.chainB.GetContext(), ibctesting.FirstConnectionID, path.EndpointA.ChannelConfig.PortID, path.EndpointB.ChannelID) }, - false, + icatypes.ErrActiveChannelAlreadySet, }, { "channel is already active (FLUSHING state)", @@ -289,7 +289,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { } suite.chainB.GetSimApp().IBCKeeper.ChannelKeeper.SetChannel(suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, channel) }, - false, + icatypes.ErrActiveChannelAlreadySet, }, } @@ -334,7 +334,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, chanCap, channel.Counterparty, path.EndpointA.ChannelConfig.Version, ) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) storedAddr, found := suite.chainB.GetSimApp().ICAHostKeeper.GetInterchainAccountAddress(suite.chainB.GetContext(), path.EndpointB.ConnectionID, path.EndpointA.ChannelConfig.PortID) @@ -353,7 +353,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { suite.Require().Equal(string(expectedVersionBytes), version) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) suite.Require().Equal("", version) } }) @@ -367,10 +367,10 @@ func (suite *KeeperTestSuite) TestOnChanOpenConfirm() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { "channel not found", @@ -378,7 +378,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenConfirm() { path.EndpointB.ChannelID = "invalid-channel-id" path.EndpointB.ChannelConfig.PortID = "invalid-port-id" }, - false, + channeltypes.ErrChannelNotFound, }, } @@ -406,10 +406,10 @@ func (suite *KeeperTestSuite) TestOnChanOpenConfirm() { err = suite.chainB.GetSimApp().ICAHostKeeper.OnChanOpenConfirm(suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } @@ -422,10 +422,10 @@ func (suite *KeeperTestSuite) TestOnChanCloseConfirm() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, } @@ -445,10 +445,10 @@ func (suite *KeeperTestSuite) TestOnChanCloseConfirm() { err = suite.chainB.GetSimApp().ICAHostKeeper.OnChanCloseConfirm(suite.chainB.GetContext(), path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper.go b/modules/apps/27-interchain-accounts/host/keeper/keeper.go index cc2961cd1d5f..45fca34b2a3b 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper.go @@ -102,9 +102,18 @@ func (k Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper { } // Logger returns the application logger, scoped to the associated module +<<<<<<< HEAD func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after context.Context is removed from core IBC return sdkCtx.Logger().With("module", fmt.Sprintf("x/%s-%s", exported.ModuleName, icatypes.ModuleName)) +||||||| 2028e9a34 +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s-%s", exported.ModuleName, icatypes.ModuleName)) +======= +func (Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: remove after context.Context is removed from core IBC + return sdkCtx.Logger().With("module", fmt.Sprintf("x/%s-%s", exported.ModuleName, icatypes.ModuleName)) +>>>>>>> main } // getConnectionID returns the connection id for the given port and channelIDs. @@ -117,28 +126,67 @@ func (k Keeper) getConnectionID(ctx context.Context, portID, channelID string) ( } // setPort sets the provided portID in state. +<<<<<<< HEAD func (k Keeper) setPort(ctx context.Context, portID string) { store := k.storeService.OpenKVStore(ctx) store.Set(icatypes.KeyPort(portID), []byte{0x01}) +||||||| 2028e9a34 +func (k Keeper) setPort(ctx sdk.Context, portID string) { + store := ctx.KVStore(k.storeKey) + store.Set(icatypes.KeyPort(portID), []byte{0x01}) +======= +func (k Keeper) setPort(ctx context.Context, portID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(icatypes.KeyPort(portID), []byte{0x01}); err != nil { + panic(err) + } +>>>>>>> main } // hasCapability checks if the interchain account host module owns the port capability for the desired port +<<<<<<< HEAD func (k Keeper) hasCapability(ctx context.Context, portID string) bool { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC _, ok := k.scopedKeeper.GetCapability(sdkCtx, host.PortPath(portID)) +||||||| 2028e9a34 +func (k Keeper) hasCapability(ctx sdk.Context, portID string) bool { + _, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID)) +======= +func (k Keeper) hasCapability(ctx context.Context, portID string) bool { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, ok := k.scopedKeeper.GetCapability(sdkCtx, host.PortPath(portID)) +>>>>>>> main return ok } // AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function +<<<<<<< HEAD func (k Keeper) AuthenticateCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) bool { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return k.scopedKeeper.AuthenticateCapability(sdkCtx, cap, name) +||||||| 2028e9a34 +func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool { + return k.scopedKeeper.AuthenticateCapability(ctx, cap, name) +======= +func (k Keeper) AuthenticateCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) bool { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return k.scopedKeeper.AuthenticateCapability(sdkCtx, cap, name) +>>>>>>> main } // ClaimCapability wraps the scopedKeeper's ClaimCapability function +<<<<<<< HEAD func (k Keeper) ClaimCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) error { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return k.scopedKeeper.ClaimCapability(sdkCtx, cap, name) +||||||| 2028e9a34 +func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { + return k.scopedKeeper.ClaimCapability(ctx, cap, name) +======= +func (k Keeper) ClaimCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return k.scopedKeeper.ClaimCapability(sdkCtx, cap, name) +>>>>>>> main } // GetAppVersion calls the ICS4Wrapper GetAppVersion function. @@ -161,20 +209,36 @@ func (k Keeper) GetActiveChannelID(ctx context.Context, connectionID, portID str store := k.storeService.OpenKVStore(ctx) key := icatypes.KeyActiveChannel(portID, connectionID) +<<<<<<< HEAD has, err := store.Has(key) if err != nil { panic(err) } if !has { +||||||| 2028e9a34 + if !store.Has(key) { +======= + bz, err := store.Get(key) + if err != nil { + panic(err) + } + if len(bz) == 0 { +>>>>>>> main return "", false } +<<<<<<< HEAD bz, err := store.Get(key) if err != nil { panic(err) } return string(bz), true +||||||| 2028e9a34 + return string(store.Get(key)), true +======= + return string(bz), true +>>>>>>> main } // GetOpenActiveChannel retrieves the active channelID from the store, keyed by the provided connectionID and portID & checks if the channel in question is in state OPEN @@ -216,9 +280,21 @@ func (k Keeper) GetAllActiveChannels(ctx context.Context) []genesistypes.ActiveC } // SetActiveChannelID stores the active channelID, keyed by the provided connectionID and portID +<<<<<<< HEAD func (k Keeper) SetActiveChannelID(ctx context.Context, connectionID, portID, channelID string) { store := k.storeService.OpenKVStore(ctx) store.Set(icatypes.KeyActiveChannel(portID, connectionID), []byte(channelID)) +||||||| 2028e9a34 +func (k Keeper) SetActiveChannelID(ctx sdk.Context, connectionID, portID, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Set(icatypes.KeyActiveChannel(portID, connectionID), []byte(channelID)) +======= +func (k Keeper) SetActiveChannelID(ctx context.Context, connectionID, portID, channelID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(icatypes.KeyActiveChannel(portID, connectionID), []byte(channelID)); err != nil { + panic(err) + } +>>>>>>> main } // IsActiveChannel returns true if there exists an active channel for the provided connectionID and portID, otherwise false @@ -232,20 +308,36 @@ func (k Keeper) GetInterchainAccountAddress(ctx context.Context, connectionID, p store := k.storeService.OpenKVStore(ctx) key := icatypes.KeyOwnerAccount(portID, connectionID) +<<<<<<< HEAD has, err := store.Has(key) if err != nil { panic(err) } if !has { +||||||| 2028e9a34 + if !store.Has(key) { +======= + bz, err := store.Get(key) + if len(bz) == 0 { +>>>>>>> main return "", false } + if err != nil { + panic(err) + } +<<<<<<< HEAD bz, err := store.Get(key) if err != nil { panic(err) } return string(bz), true +||||||| 2028e9a34 + return string(store.Get(key)), true +======= + return string(bz), true +>>>>>>> main } // GetAllInterchainAccounts returns a list of all registered interchain account addresses and their associated connection and controller port identifiers @@ -270,9 +362,21 @@ func (k Keeper) GetAllInterchainAccounts(ctx context.Context) []genesistypes.Reg } // SetInterchainAccountAddress stores the InterchainAccount address, keyed by the associated connectionID and portID +<<<<<<< HEAD func (k Keeper) SetInterchainAccountAddress(ctx context.Context, connectionID, portID, address string) { store := k.storeService.OpenKVStore(ctx) store.Set(icatypes.KeyOwnerAccount(portID, connectionID), []byte(address)) +||||||| 2028e9a34 +func (k Keeper) SetInterchainAccountAddress(ctx sdk.Context, connectionID, portID, address string) { + store := ctx.KVStore(k.storeKey) + store.Set(icatypes.KeyOwnerAccount(portID, connectionID), []byte(address)) +======= +func (k Keeper) SetInterchainAccountAddress(ctx context.Context, connectionID, portID, address string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(icatypes.KeyOwnerAccount(portID, connectionID), []byte(address)); err != nil { + panic(err) + } +>>>>>>> main } // GetAuthority returns the 27-interchain-accounts host submodule's authority. @@ -300,7 +404,9 @@ func (k Keeper) GetParams(ctx context.Context) types.Params { func (k Keeper) SetParams(ctx context.Context, params types.Params) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(¶ms) - store.Set([]byte(types.ParamsKey), bz) + if err := store.Set([]byte(types.ParamsKey), bz); err != nil { + panic(err) + } } // newModuleQuerySafeAllowList returns a list of all query paths labeled with module_query_safe in the proto files. diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go index 23828769cbaf..4a4e000bfd5b 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go @@ -137,7 +137,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { testCases := []struct { name string instantiateFn func() - expPass bool + panicMsg string }{ {"success", func() { keeper.NewKeeper( @@ -153,7 +153,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.chainA.GetSimApp().GRPCQueryRouter(), suite.chainA.GetSimApp().ICAHostKeeper.GetAuthority(), ) - }, true}, + }, ""}, {"failure: interchain accounts module account does not exist", func() { keeper.NewKeeper( suite.chainA.GetSimApp().AppCodec(), @@ -168,7 +168,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.chainA.GetSimApp().GRPCQueryRouter(), suite.chainA.GetSimApp().ICAHostKeeper.GetAuthority(), ) - }, false}, + }, "the Interchain Accounts module account has not been set"}, {"failure: empty mock staking keeper", func() { keeper.NewKeeper( suite.chainA.GetSimApp().AppCodec(), @@ -183,7 +183,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.chainA.GetSimApp().GRPCQueryRouter(), "", // authority ) - }, false}, + }, "authority must be non-empty"}, } for _, tc := range testCases { @@ -191,12 +191,13 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.SetupTest() suite.Run(tc.name, func() { - if tc.expPass { + if tc.panicMsg == "" { suite.Require().NotPanics( tc.instantiateFn, ) } else { - suite.Require().Panics( + suite.Require().PanicsWithError( + tc.panicMsg, tc.instantiateFn, ) } @@ -370,15 +371,15 @@ func (suite *KeeperTestSuite) TestParams() { suite.Require().Equal(expParams, params) testCases := []struct { - name string - input types.Params - expPass bool + name string + input types.Params + errMsg string }{ - {"success: set default params", types.DefaultParams(), true}, - {"success: non-default params", types.NewParams(!types.DefaultHostEnabled, []string{"/cosmos.staking.v1beta1.MsgDelegate"}), true}, - {"success: set empty byte for allow messages", types.NewParams(true, nil), true}, - {"failure: set empty string for allow messages", types.NewParams(true, []string{""}), false}, - {"failure: set space string for allow messages", types.NewParams(true, []string{" "}), false}, + {"success: set default params", types.DefaultParams(), ""}, + {"success: non-default params", types.NewParams(!types.DefaultHostEnabled, []string{"/cosmos.staking.v1beta1.MsgDelegate"}), ""}, + {"success: set empty byte for allow messages", types.NewParams(true, nil), ""}, + {"failure: set empty string for allow messages", types.NewParams(true, []string{""}), "parameter must not contain empty strings"}, + {"failure: set space string for allow messages", types.NewParams(true, []string{" "}), "parameter must not contain empty strings"}, } for _, tc := range testCases { @@ -389,13 +390,13 @@ func (suite *KeeperTestSuite) TestParams() { ctx := suite.chainA.GetContext() err := tc.input.Validate() suite.chainA.GetSimApp().ICAHostKeeper.SetParams(ctx, tc.input) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) expected := tc.input p := suite.chainA.GetSimApp().ICAHostKeeper.GetParams(ctx) suite.Require().Equal(expected, p) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } diff --git a/modules/apps/27-interchain-accounts/host/keeper/msg_server_test.go b/modules/apps/27-interchain-accounts/host/keeper/msg_server_test.go index 2af40712f3cd..476bf5bf00a7 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/msg_server_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/msg_server_test.go @@ -154,19 +154,19 @@ func (suite *KeeperTestSuite) TestModuleQuerySafe() { func (suite *KeeperTestSuite) TestUpdateParams() { testCases := []struct { - name string - msg *types.MsgUpdateParams - expPass bool + name string + msg *types.MsgUpdateParams + expErr error }{ { "success", types.NewMsgUpdateParams(suite.chainA.GetSimApp().ICAHostKeeper.GetAuthority(), types.DefaultParams()), - true, + nil, }, { "invalid signer address", types.NewMsgUpdateParams("signer", types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, } @@ -180,11 +180,11 @@ func (suite *KeeperTestSuite) TestUpdateParams() { msgServer := keeper.NewMsgServerImpl(&suite.chainA.GetSimApp().ICAHostKeeper) res, err := msgServer.UpdateParams(ctx, tc.msg) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) suite.Require().NotNil(res) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) suite.Require().Nil(res) } }) diff --git a/modules/apps/27-interchain-accounts/host/keeper/relay.go b/modules/apps/27-interchain-accounts/host/keeper/relay.go index 775424edf16c..55a2b57b5b31 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/relay.go +++ b/modules/apps/27-interchain-accounts/host/keeper/relay.go @@ -68,8 +68,15 @@ func (k Keeper) executeTx(ctx context.Context, sourcePort, destPort, destChannel // CacheContext returns a new context with the multi-store branched into a cached storage object // writeCache is called only if all msgs succeed, performing state transitions atomically +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC cacheCtx, writeCache := sdkCtx.CacheContext() +||||||| 2028e9a34 + cacheCtx, writeCache := ctx.CacheContext() +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + cacheCtx, writeCache := sdkCtx.CacheContext() +>>>>>>> main for i, msg := range msgs { if m, ok := msg.(sdk.HasValidateBasic); ok { if err := m.ValidateBasic(); err != nil { diff --git a/modules/apps/27-interchain-accounts/host/types/codec_test.go b/modules/apps/27-interchain-accounts/host/types/codec_test.go index c334b3034d3e..4cc6423d284f 100644 --- a/modules/apps/27-interchain-accounts/host/types/codec_test.go +++ b/modules/apps/27-interchain-accounts/host/types/codec_test.go @@ -16,22 +16,22 @@ func TestCodecTypeRegistration(t *testing.T) { testCases := []struct { name string typeURL string - expPass bool + errMsg string }{ { "success: MsgUpdateParams", sdk.MsgTypeURL(&types.MsgUpdateParams{}), - true, + "", }, { "success: MsgModuleQuerySafe", sdk.MsgTypeURL(&types.MsgModuleQuerySafe{}), - true, + "", }, { "type not registered on codec", "ibc.invalid.MsgTypeURL", - false, + "unable to resolve type URL", }, } @@ -42,12 +42,12 @@ func TestCodecTypeRegistration(t *testing.T) { encodingCfg := moduletestutil.MakeTestEncodingConfig(ica.AppModuleBasic{}) msg, err := encodingCfg.Codec.InterfaceRegistry().Resolve(tc.typeURL) - if tc.expPass { + if tc.errMsg == "" { require.NotNil(t, msg) require.NoError(t, err) } else { require.Nil(t, msg) - require.Error(t, err) + require.ErrorContains(t, err, tc.errMsg) } }) } diff --git a/modules/apps/27-interchain-accounts/host/types/msgs_test.go b/modules/apps/27-interchain-accounts/host/types/msgs_test.go index dae632245da1..59ec90dc6a22 100644 --- a/modules/apps/27-interchain-accounts/host/types/msgs_test.go +++ b/modules/apps/27-interchain-accounts/host/types/msgs_test.go @@ -16,26 +16,26 @@ import ( func TestMsgUpdateParamsValidateBasic(t *testing.T) { testCases := []struct { - name string - msg *types.MsgUpdateParams - expPass bool + name string + msg *types.MsgUpdateParams + expErr error }{ { "success: valid signer address", types.NewMsgUpdateParams(sdk.AccAddress(ibctesting.TestAccAddress).String(), types.DefaultParams()), - true, + nil, }, { "failure: invalid signer address", types.NewMsgUpdateParams("signer", types.DefaultParams()), - false, + ibcerrors.ErrInvalidAddress, }, { "failure: invalid allowed message", types.NewMsgUpdateParams("signer", types.Params{ AllowMessages: []string{""}, }), - false, + ibcerrors.ErrInvalidAddress, }, } @@ -43,10 +43,10 @@ func TestMsgUpdateParamsValidateBasic(t *testing.T) { tc := tc err := tc.msg.ValidateBasic() - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err) } else { - require.Error(t, err) + require.ErrorIs(t, err, tc.expErr) } } } @@ -55,10 +55,10 @@ func TestMsgUpdateParamsGetSigners(t *testing.T) { testCases := []struct { name string address sdk.AccAddress - expPass bool + errMsg string }{ - {"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), true}, - {"failure: nil address", nil, false}, + {"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), ""}, + {"failure: nil address", nil, "empty address string is not allowed"}, } for _, tc := range testCases { @@ -67,11 +67,11 @@ func TestMsgUpdateParamsGetSigners(t *testing.T) { msg := types.NewMsgUpdateParams(tc.address.String(), types.DefaultParams()) encodingCfg := moduletestutil.MakeTestEncodingConfig(ica.AppModuleBasic{}) signers, _, err := encodingCfg.Codec.GetMsgV1Signers(msg) - if tc.expPass { + if tc.errMsg == "" { require.NoError(t, err) require.Equal(t, tc.address.Bytes(), signers[0]) } else { - require.Error(t, err) + require.ErrorContains(t, err, tc.errMsg) } } } @@ -125,10 +125,10 @@ func TestMsgModuleQuerySafeGetSigners(t *testing.T) { testCases := []struct { name string address sdk.AccAddress - expPass bool + errMsg string }{ - {"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), true}, - {"failure: nil address", nil, false}, + {"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), ""}, + {"failure: nil address", nil, "empty address string is not allowed"}, } for _, tc := range testCases { @@ -138,11 +138,11 @@ func TestMsgModuleQuerySafeGetSigners(t *testing.T) { msg := types.NewMsgModuleQuerySafe(tc.address.String(), []types.QueryRequest{}) encodingCfg := moduletestutil.MakeTestEncodingConfig(ica.AppModuleBasic{}) signers, _, err := encodingCfg.Codec.GetMsgV1Signers(msg) - if tc.expPass { + if tc.errMsg == "" { require.NoError(t, err) require.Equal(t, tc.address.Bytes(), signers[0]) } else { - require.Error(t, err) + require.ErrorContains(t, err, tc.errMsg) } }) } diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index ede08eaa29d9..293be361b510 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -134,10 +134,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { } controllerMigrator := controllerkeeper.NewMigrator(am.controllerKeeper) - if err := cfg.RegisterMigration(types.ModuleName, 1, controllerMigrator.AssertChannelCapabilityMigrations); err != nil { - panic(fmt.Errorf("failed to migrate interchainaccounts app from version 1 to 2 (channel capabilities owned by controller submodule check): %v", err)) - } - hostMigrator := hostkeeper.NewMigrator(am.hostKeeper) if err := cfg.RegisterMigration(types.ModuleName, 2, func(ctx sdk.Context) error { if err := hostMigrator.MigrateParams(ctx); err != nil { diff --git a/modules/apps/27-interchain-accounts/types/account.go b/modules/apps/27-interchain-accounts/types/account.go index 55354e9cd240..99bea7da1363 100644 --- a/modules/apps/27-interchain-accounts/types/account.go +++ b/modules/apps/27-interchain-accounts/types/account.go @@ -46,8 +46,15 @@ type interchainAccountPretty struct { // the current block app hash, and the current block data hash. The sdk.AccAddress returned is a sub-address of the host module account. func GenerateAddress(ctx context.Context, connectionID, portID string) sdk.AccAddress { hostModuleAcc := sdkaddress.Module(ModuleName, []byte(hostAccountsKey)) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC header := sdkCtx.BlockHeader() +||||||| 2028e9a34 + header := ctx.BlockHeader() +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + header := sdkCtx.BlockHeader() +>>>>>>> main buf := []byte(connectionID + portID) buf = append(buf, header.AppHash...) diff --git a/modules/apps/29-fee/ibc_middleware_test.go b/modules/apps/29-fee/ibc_middleware_test.go index 9ec4c7c415ec..780d62732ea4 100644 --- a/modules/apps/29-fee/ibc_middleware_test.go +++ b/modules/apps/29-fee/ibc_middleware_test.go @@ -3,6 +3,7 @@ package fee_test import ( "context" "encoding/json" + "errors" "fmt" errorsmod "cosmossdk.io/errors" @@ -18,6 +19,7 @@ import ( channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/v9/modules/core/05-port/types" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" "github.com/cosmos/ibc-go/v9/modules/core/exported" ibctesting "github.com/cosmos/ibc-go/v9/testing" ibcmock "github.com/cosmos/ibc-go/v9/testing/mock" @@ -34,44 +36,44 @@ func (suite *FeeTestSuite) TestOnChanOpenInit() { testCases := []struct { name string version string - expPass bool isFeeEnabled bool + expErr error }{ { "success - valid fee middleware and mock version", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})), true, - true, + nil, }, { "success - fee version not included, only perform mock logic", ibcmock.Version, - true, false, + nil, + }, + { + "passing an empty string returns default version", + "", + true, + nil, }, { "invalid fee middleware version", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: "invalid-ics29-1", AppVersion: ibcmock.Version})), false, - false, + types.ErrInvalidVersion, }, { "invalid mock version", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: "invalid-mock-version"})), false, - false, + errors.New("incorrect mock version"), }, { "mock version not wrapped", types.Version, false, - false, - }, - { - "passing an empty string returns default version", - "", - true, - true, + errors.New("incorrect mock version"), }, } @@ -118,7 +120,7 @@ func (suite *FeeTestSuite) TestOnChanOpenInit() { version, err := cbs.OnChanOpenInit(suite.chainA.GetContext(), channel.Ordering, channel.ConnectionHops, suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, chanCap, counterparty, channel.Version) - if tc.expPass { + if tc.expErr == nil { // check if the channel is fee enabled. If so version string should include metaData if tc.isFeeEnabled { versionMetadata := types.Metadata{ @@ -136,7 +138,7 @@ func (suite *FeeTestSuite) TestOnChanOpenInit() { suite.Require().NoError(err, "unexpected error from version: %s", tc.version) } else { - suite.Require().Error(err, "error not returned for version: %s", tc.version) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, "error not returned for version: %s or error %s is not %s", tc.version, err, tc.expErr) suite.Require().Equal("", version) } }) @@ -149,27 +151,27 @@ func (suite *FeeTestSuite) TestOnChanOpenTry() { testCases := []struct { name string cpVersion string - expPass bool + expErr error }{ { "success - valid fee middleware version", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})), - true, + nil, }, { "success - valid mock version", ibcmock.Version, - true, + nil, }, { "invalid fee middleware version", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: "invalid-ics29-1", AppVersion: ibcmock.Version})), - false, + types.ErrInvalidVersion, }, { "invalid mock version", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: "invalid-mock-version"})), - false, + errors.New("incorrect mock version"), }, } @@ -223,10 +225,10 @@ func (suite *FeeTestSuite) TestOnChanOpenTry() { _, err = cbs.OnChanOpenTry(suite.chainA.GetContext(), channel.Ordering, channel.ConnectionHops, suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, chanCap, counterparty, tc.cpVersion) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } }) } @@ -239,31 +241,31 @@ func (suite *FeeTestSuite) TestOnChanOpenAck() { name string cpVersion string malleate func(suite *FeeTestSuite) - expPass bool + expErr error }{ { "success", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})), func(suite *FeeTestSuite) {}, - true, + nil, }, { "invalid fee version", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: "invalid-ics29-1", AppVersion: ibcmock.Version})), func(suite *FeeTestSuite) {}, - false, + types.ErrInvalidVersion, }, { "invalid mock version", string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: "invalid-mock-version"})), func(suite *FeeTestSuite) {}, - false, + errors.New("incorrect mock version"), }, { "invalid version fails to unmarshal metadata", ibctesting.InvalidID, func(suite *FeeTestSuite) {}, - false, + errors.New("incorrect mock version"), }, { "previous INIT set without fee, however counterparty set fee version", // note this can only happen with incompetent or malicious counterparty chain @@ -273,7 +275,7 @@ func (suite *FeeTestSuite) TestOnChanOpenAck() { suite.path.EndpointA.ChannelConfig.Version = ibcmock.Version suite.path.EndpointB.ChannelConfig.Version = ibcmock.Version }, - false, + errors.New("incorrect mock version"), }, } @@ -308,10 +310,10 @@ func (suite *FeeTestSuite) TestOnChanOpenAck() { suite.Require().True(ok) err = cbs.OnChanOpenAck(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, suite.path.EndpointA.Counterparty.ChannelID, tc.cpVersion) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err, "unexpected error for case: %s", tc.name) } else { - suite.Require().Error(err, "%s expected error but returned none", tc.name) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } }) } @@ -326,12 +328,13 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { +<<<<<<< HEAD "application callback fails", func() { suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanCloseInit = func( ctx context.Context, portID, channelID string, @@ -339,6 +342,20 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { return fmt.Errorf("application callback fails") } }, false, +||||||| 2028e9a34 + "application callback fails", func() { + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanCloseInit = func( + ctx sdk.Context, portID, channelID string, + ) error { + return fmt.Errorf("application callback fails") + } + }, false, +======= + "fee module is not enabled", func() { + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + }, + nil, +>>>>>>> main }, { "RefundFeesOnChannelClosure continues - invalid refund address", func() { @@ -350,19 +367,22 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) suite.Require().NoError(err) }, - true, + nil, }, { - "fee module locked", func() { - lockFeeModule(suite.chainA) - }, - false, + "application callback fails", func() { + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanCloseInit = func( + ctx context.Context, portID, channelID string, + ) error { + return fmt.Errorf("application callback fails") + } + }, errors.New("application callback fails"), }, { - "fee module is not enabled", func() { - suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + "fee module locked", func() { + lockFeeModule(suite.chainA) }, - true, + types.ErrFeeModuleLocked, }, } @@ -396,10 +416,10 @@ func (suite *FeeTestSuite) TestOnChanCloseInit() { err = cbs.OnChanCloseInit(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } }) } @@ -415,12 +435,13 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { - "success", func() {}, true, + "success", func() {}, nil, }, { +<<<<<<< HEAD "application callback fails", func() { suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanCloseConfirm = func( ctx context.Context, portID, channelID string, @@ -428,6 +449,20 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { return fmt.Errorf("application callback fails") } }, false, +||||||| 2028e9a34 + "application callback fails", func() { + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanCloseConfirm = func( + ctx sdk.Context, portID, channelID string, + ) error { + return fmt.Errorf("application callback fails") + } + }, false, +======= + "fee module is not enabled", func() { + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + }, + nil, +>>>>>>> main }, { "RefundChannelFeesOnClosure continues - refund address is invalid", func() { @@ -439,19 +474,22 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) suite.Require().NoError(err) }, - true, + nil, }, { - "fee module locked", func() { - lockFeeModule(suite.chainA) - }, - false, + "application callback fails", func() { + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanCloseConfirm = func( + ctx context.Context, portID, channelID string, + ) error { + return fmt.Errorf("application callback fails") + } + }, errors.New("application callback fails"), }, { - "fee module is not enabled", func() { - suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + "fee module locked", func() { + lockFeeModule(suite.chainA) }, - true, + types.ErrFeeModuleLocked, }, } @@ -486,10 +524,10 @@ func (suite *FeeTestSuite) TestOnChanCloseConfirm() { err = cbs.OnChanCloseConfirm(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } }) } @@ -620,7 +658,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { testCases := []struct { name string malleate func() - expPass bool + expErr error expResult func() }{ { @@ -630,7 +668,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { relayerAccBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), relayerAddr, sdk.DefaultBondDenom)) expPayeeAccBalance = relayerAccBalance.Add(packetFee.Fee.RecvFee...).Add(packetFee.Fee.AckFee...) }, - true, + nil, func() { // assert that the packet fees have been distributed found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) @@ -655,7 +693,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { relayerAccBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), relayerAddr, sdk.DefaultBondDenom)) expPayeeAccBalance = relayerAccBalance.Add(packetFee.Fee.RecvFee...).Add(packetFee.Fee.AckFee...) }, - true, + nil, func() { // assert that the packet fees have been distributed found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) @@ -689,7 +727,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { payeeAccBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), payeeAddr, sdk.DefaultBondDenom)) expPayeeAccBalance = payeeAccBalance.Add(packetFee.Fee.RecvFee...).Add(packetFee.Fee.AckFee...) }, - true, + nil, func() { // assert that the packet fees have been distributed found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) @@ -714,7 +752,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { ForwardRelayerAddress: "", }.Acknowledgement() }, - true, + nil, func() { found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) suite.Require().False(found) @@ -726,7 +764,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) ack = ibcmock.MockAcknowledgement.Acknowledgement() }, - true, + nil, func() {}, }, { @@ -734,7 +772,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { func() { lockFeeModule(suite.chainA) }, - true, + nil, func() { suite.Require().Equal(true, suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(suite.chainA.GetContext())) }, @@ -751,7 +789,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { relayerAccBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), relayerAddr, sdk.DefaultBondDenom)) expPayeeAccBalance = relayerAccBalance.Add(packetFee.Fee.AckFee...) }, - true, + nil, func() { // assert that the packet fees have been distributed found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) @@ -771,7 +809,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { func() { escrowAmount = sdk.NewCoins() }, - true, + nil, func() { suite.Require().Equal(true, suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(suite.chainA.GetContext())) }, @@ -781,7 +819,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { func() { ack = []byte("unsupported acknowledgement format") }, - false, + ibcerrors.ErrInvalidType, func() {}, }, { @@ -795,7 +833,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { suite.path.EndpointA.ChannelID, ) }, - false, + errors.New("failed to create sdk.Address from payee"), func() {}, }, { @@ -805,7 +843,7 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { return fmt.Errorf("mock fee app callback fails") } }, - false, + errors.New("mock fee app callback fails"), func() {}, }, } @@ -844,10 +882,10 @@ func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { err = cbs.OnAcknowledgementPacket(suite.chainA.GetContext(), suite.path.EndpointA.GetChannel().Version, packet, ack, relayerAddr) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } tc.expResult() @@ -870,7 +908,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { testCases := []struct { name string malleate func() - expPass bool + expErr error expResult func() }{ { @@ -880,7 +918,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { refundAccBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAddr, sdk.DefaultBondDenom)) expRefundAccBalance = refundAccBalance }, - true, + nil, func() { // assert that the packet fees have been distributed found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) @@ -907,7 +945,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { refundAccBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAddr, sdk.DefaultBondDenom)) expRefundAccBalance = refundAccBalance.Add(refundCoins...) }, - true, + nil, func() { // assert that the packet fees have been distributed found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) @@ -940,7 +978,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { refundAccBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAddr, sdk.DefaultBondDenom)) expRefundAccBalance = refundAccBalance }, - true, + nil, func() { // assert that the packet fees have been distributed found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) @@ -959,7 +997,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { func() { suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) }, - true, + nil, func() {}, }, { @@ -967,7 +1005,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { func() { lockFeeModule(suite.chainA) }, - true, + nil, func() { suite.Require().Equal(true, suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(suite.chainA.GetContext())) }, @@ -977,7 +1015,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { func() { suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetID) }, - true, + nil, func() {}, }, { @@ -985,7 +1023,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { func() { relayerAddr = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress() }, - true, + nil, func() {}, }, { @@ -993,7 +1031,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { func() { escrowAmount = sdk.NewCoins() }, - true, + nil, func() { suite.Require().Equal(true, suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(suite.chainA.GetContext())) }, @@ -1009,7 +1047,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { suite.path.EndpointA.ChannelID, ) }, - false, + errors.New("failed to create sdk.Address from payee"), func() {}, }, { @@ -1019,7 +1057,7 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { return fmt.Errorf("mock fee app callback fails") } }, - false, + errors.New("mock fee app callback fails"), func() {}, }, } @@ -1055,10 +1093,10 @@ func (suite *FeeTestSuite) TestOnTimeoutPacket() { err = cbs.OnTimeoutPacket(suite.chainA.GetContext(), suite.path.EndpointA.GetChannel().Version, packet, relayerAddr) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } tc.expResult() diff --git a/modules/apps/29-fee/keeper/escrow.go b/modules/apps/29-fee/keeper/escrow.go index 91e01eea0903..64883f4e91fa 100644 --- a/modules/apps/29-fee/keeper/escrow.go +++ b/modules/apps/29-fee/keeper/escrow.go @@ -50,8 +50,15 @@ func (k Keeper) escrowPacketFee(ctx context.Context, packetID channeltypes.Packe func (k Keeper) DistributePacketFeesOnAcknowledgement(ctx context.Context, forwardRelayer string, reverseRelayer sdk.AccAddress, packetFees []types.PacketFee, packetID channeltypes.PacketId) { // cache context before trying to distribute fees // if the escrow account has insufficient balance then we want to avoid partially distributing fees +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 cacheCtx, writeFn := sdkCtx.CacheContext() +||||||| 2028e9a34 + cacheCtx, writeFn := ctx.CacheContext() +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + cacheCtx, writeFn := sdkCtx.CacheContext() +>>>>>>> main // forward relayer address will be empty if conversion fails forwardAddr, _ := sdk.AccAddressFromBech32(forwardRelayer) @@ -108,8 +115,15 @@ func (k Keeper) distributePacketFeeOnAcknowledgement(ctx context.Context, refund func (k Keeper) DistributePacketFeesOnTimeout(ctx context.Context, timeoutRelayer sdk.AccAddress, packetFees []types.PacketFee, packetID channeltypes.PacketId) { // cache context before trying to distribute fees // if the escrow account has insufficient balance then we want to avoid partially distributing fees +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 cacheCtx, writeFn := sdkCtx.CacheContext() +||||||| 2028e9a34 + cacheCtx, writeFn := ctx.CacheContext() +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + cacheCtx, writeFn := sdkCtx.CacheContext() +>>>>>>> main for _, packetFee := range packetFees { if !k.EscrowAccountHasBalance(cacheCtx, packetFee.Fee.Total()) { @@ -190,8 +204,15 @@ func (k Keeper) RefundFeesOnChannelClosure(ctx context.Context, portID, channelI // cache context before trying to distribute fees // if the escrow account has insufficient balance then we want to avoid partially distributing fees +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 cacheCtx, writeFn := sdkCtx.CacheContext() +||||||| 2028e9a34 + cacheCtx, writeFn := ctx.CacheContext() +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + cacheCtx, writeFn := sdkCtx.CacheContext() +>>>>>>> main for _, identifiedPacketFee := range identifiedPacketFees { var unRefundedFees []types.PacketFee diff --git a/modules/apps/29-fee/keeper/grpc_query_test.go b/modules/apps/29-fee/keeper/grpc_query_test.go index bf93096744ea..3732be86f015 100644 --- a/modules/apps/29-fee/keeper/grpc_query_test.go +++ b/modules/apps/29-fee/keeper/grpc_query_test.go @@ -24,7 +24,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", @@ -50,22 +50,22 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { QueryHeight: 0, } }, - true, + "", }, { - "empty request", + "empty pagination", func() { - req = nil + expectedPackets = nil + req = &types.QueryIncentivizedPacketsRequest{} }, - false, + "", }, { - "empty pagination", + "empty request", func() { - expectedPackets = nil - req = &types.QueryIncentivizedPacketsRequest{} + req = nil }, - true, + "InvalidArgument", }, } @@ -81,12 +81,12 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { res, err := suite.chainA.GetSimApp().IBCFeeKeeper.IncentivizedPackets(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(expectedPackets, res.IncentivizedPackets) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } @@ -98,19 +98,19 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacket() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, + "", }, { "empty request", func() { req = nil }, - false, + "InvalidArgument", }, { "fees not found for packet id", @@ -120,7 +120,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacket() { QueryHeight: 0, } }, - false, + "NotFound", }, } @@ -149,12 +149,12 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacket() { ctx := suite.chainA.GetContext() res, err := suite.chainA.GetSimApp().IBCFeeKeeper.IncentivizedPacket(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(types.NewIdentifiedPacketFees(packetID, []types.PacketFee{packetFee, packetFee, packetFee}), res.IncentivizedPacket) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } @@ -177,7 +177,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { testCases := []struct { msg string malleate func() - expPass bool + errMsg string }{ { "empty pagination", @@ -192,7 +192,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { QueryHeight: 0, } }, - true, + "", }, { "success", @@ -215,14 +215,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), identifiedPacketFees.PacketId, types.NewPacketFees(identifiedPacketFees.PacketFees)) } }, - true, - }, - { - "empty request", - func() { - req = nil - }, - false, + "", }, { "no packets for specified channel", @@ -240,7 +233,14 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { QueryHeight: 0, } }, - true, + "", + }, + { + "empty request", + func() { + req = nil + }, + "InvalidArgument", }, { "channel not found", @@ -250,7 +250,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { ChannelId: ibctesting.InvalidID, } }, - false, + "NotFound", }, { "invalid ID", @@ -260,7 +260,7 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { ChannelId: "test-channel-id", } }, - false, + "InvalidArgument", }, } @@ -294,12 +294,12 @@ func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { res, err := suite.chainA.GetSimApp().IBCFeeKeeper.IncentivizedPacketsForChannel(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(expIdentifiedPacketFees, res.IncentivizedPackets) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } @@ -311,26 +311,26 @@ func (suite *KeeperTestSuite) TestQueryTotalRecvFees() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, + "", }, { "empty request", func() { req = nil }, - false, + "InvalidArgument", }, { "packet not found", func() { req.PacketId = channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 100) }, - false, + "NotFound", }, } @@ -359,7 +359,7 @@ func (suite *KeeperTestSuite) TestQueryTotalRecvFees() { ctx := suite.chainA.GetContext() res, err := suite.chainA.GetSimApp().IBCFeeKeeper.TotalRecvFees(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().NotNil(res) @@ -367,7 +367,7 @@ func (suite *KeeperTestSuite) TestQueryTotalRecvFees() { expectedFees := defaultRecvFee.Add(defaultRecvFee...).Add(defaultRecvFee...) suite.Require().Equal(expectedFees, res.RecvFees) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } @@ -379,26 +379,26 @@ func (suite *KeeperTestSuite) TestQueryTotalAckFees() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, + "", }, { "empty request", func() { req = nil }, - false, + "InvalidArgument", }, { "packet not found", func() { req.PacketId = channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 100) }, - false, + "NotFound", }, } @@ -427,7 +427,7 @@ func (suite *KeeperTestSuite) TestQueryTotalAckFees() { ctx := suite.chainA.GetContext() res, err := suite.chainA.GetSimApp().IBCFeeKeeper.TotalAckFees(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().NotNil(res) @@ -435,7 +435,7 @@ func (suite *KeeperTestSuite) TestQueryTotalAckFees() { expectedFees := defaultAckFee.Add(defaultAckFee...).Add(defaultAckFee...) suite.Require().Equal(expectedFees, res.AckFees) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } @@ -447,26 +447,26 @@ func (suite *KeeperTestSuite) TestQueryTotalTimeoutFees() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, + "", }, { "empty request", func() { req = nil }, - false, + "InvalidArgument", }, { "packet not found", func() { req.PacketId = channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 100) }, - false, + "NotFound", }, } @@ -495,7 +495,7 @@ func (suite *KeeperTestSuite) TestQueryTotalTimeoutFees() { ctx := suite.chainA.GetContext() res, err := suite.chainA.GetSimApp().IBCFeeKeeper.TotalTimeoutFees(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().NotNil(res) @@ -503,7 +503,7 @@ func (suite *KeeperTestSuite) TestQueryTotalTimeoutFees() { expectedFees := defaultTimeoutFee.Add(defaultTimeoutFee...).Add(defaultTimeoutFee...) suite.Require().Equal(expectedFees, res.TimeoutFees) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } @@ -515,33 +515,33 @@ func (suite *KeeperTestSuite) TestQueryPayee() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, + "", }, { "empty request", func() { req = nil }, - false, + "InvalidArgument", }, { "payee address not found: invalid channel", func() { req.ChannelId = "invalid-channel-id" //nolint:goconst }, - false, + "NotFound", }, { "payee address not found: invalid relayer address", func() { req.Relayer = "invalid-addr" //nolint:goconst }, - false, + "NotFound", }, } @@ -571,11 +571,11 @@ func (suite *KeeperTestSuite) TestQueryPayee() { ctx := suite.chainA.GetContext() res, err := suite.chainA.GetSimApp().IBCFeeKeeper.Payee(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().Equal(expPayeeAddr.String(), res.PayeeAddress) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } @@ -587,33 +587,33 @@ func (suite *KeeperTestSuite) TestQueryCounterpartyPayee() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, + "", }, { "empty request", func() { req = nil }, - false, + "InvalidArgument", }, { "counterparty address not found: invalid channel", func() { req.ChannelId = "invalid-channel-id" }, - false, + "NotFound", }, { "counterparty address not found: invalid address", func() { req.Relayer = "invalid-addr" }, - false, + "NotFound", }, } @@ -643,16 +643,61 @@ func (suite *KeeperTestSuite) TestQueryCounterpartyPayee() { ctx := suite.chainA.GetContext() res, err := suite.chainA.GetSimApp().IBCFeeKeeper.CounterpartyPayee(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().Equal(expCounterpartyPayeeAddr.String(), res.CounterpartyPayee) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } } +func (suite *KeeperTestSuite) TestQueryFeeEnabledChannelsWithPagination() { + suite.SetupTest() // reset + + suite.path.Setup() + + expChannel := types.FeeEnabledChannel{ + PortId: suite.path.EndpointA.ChannelConfig.PortID, + ChannelId: suite.path.EndpointA.ChannelID, + } + + expFeeEnabledChannels := []types.FeeEnabledChannel{expChannel} + + req := &types.QueryFeeEnabledChannelsRequest{ + Pagination: &query.PageRequest{ + Limit: 5, + CountTotal: false, + }, + QueryHeight: 0, + } + + // Extract the next available sequence number for channel IDs. + nextSeq := suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.GetNextChannelSequence(suite.chainA.GetContext()) + for i := 0; i < 8; i++ { + channelID := channeltypes.FormatChannelIdentifier(uint64(i + int(nextSeq))) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, channelID) + + expChannel := types.FeeEnabledChannel{ + PortId: ibctesting.MockFeePort, + ChannelId: channelID, + } + + if i < 4 { // add only the first 5 channels, as our default pagination limit is 5 + expFeeEnabledChannels = append(expFeeEnabledChannels, expChannel) + } + } + + suite.chainA.NextBlock() + + ctx := suite.chainA.GetContext() + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.FeeEnabledChannels(ctx, req) + + suite.Require().NoError(err) + suite.Require().Equal(expFeeEnabledChannels, res.FeeEnabledChannels) +} + func (suite *KeeperTestSuite) TestQueryFeeEnabledChannels() { var ( req *types.QueryFeeEnabledChannelsRequest @@ -662,26 +707,19 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannels() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, - }, - { - "empty request", - func() { - req = nil - }, - false, + "", }, { "success: empty pagination", func() { req = &types.QueryFeeEnabledChannelsRequest{} }, - true, + "", }, { "success: with multiple fee enabled channels", @@ -695,30 +733,14 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannels() { expFeeEnabledChannels = append(expFeeEnabledChannels, expChannel) }, - true, + "", }, { - "success: pagination with multiple fee enabled channels", + "failure: empty request", func() { - // Extract the next available sequence number for channel IDs. - nextSeq := suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.GetNextChannelSequence(suite.chainA.GetContext()) - for i := 0; i < 9; i++ { - channelID := channeltypes.FormatChannelIdentifier(uint64(i + int(nextSeq))) - suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, channelID) - - expChannel := types.FeeEnabledChannel{ - PortId: ibctesting.MockFeePort, - ChannelId: channelID, - } - - if i < 4 { // add only the first 5 channels, as our default pagination limit is 5 - expFeeEnabledChannels = append(expFeeEnabledChannels, expChannel) - } - } - - suite.chainA.NextBlock() + req = nil }, - true, + "InvalidArgument", }, { "empty response", @@ -728,7 +750,7 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannels() { suite.chainA.NextBlock() }, - true, + "", }, } @@ -760,11 +782,11 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannels() { ctx := suite.chainA.GetContext() res, err := suite.chainA.GetSimApp().IBCFeeKeeper.FeeEnabledChannels(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().Equal(expFeeEnabledChannels, res.FeeEnabledChannels) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } @@ -780,20 +802,12 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannel() { testCases := []struct { name string malleate func() - expPass bool + errMsg string }{ { "success", func() {}, - true, - }, - { - "empty request", - func() { - req = nil - expEnabled = false - }, - false, + "", }, { "fee not enabled on channel", @@ -807,14 +821,22 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannel() { ChannelId: path.EndpointA.ChannelID, } }, - true, + "", + }, + { + "empty request", + func() { + req = nil + expEnabled = false + }, + "InvalidArgument", }, { "channel not found", func() { req.ChannelId = ibctesting.InvalidID }, - false, + "NotFound", }, { "invalid ID", @@ -824,7 +846,7 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannel() { ChannelId: "test-channel-id", } }, - false, + "InvalidArgument", }, } @@ -848,11 +870,11 @@ func (suite *KeeperTestSuite) TestQueryFeeEnabledChannel() { ctx := suite.chainA.GetContext() res, err := suite.chainA.GetSimApp().IBCFeeKeeper.FeeEnabledChannel(ctx, req) - if tc.expPass { + if tc.errMsg == "" { suite.Require().NoError(err) suite.Require().Equal(expEnabled, res.FeeEnabled) } else { - suite.Require().Error(err) + suite.Require().ErrorContains(err, tc.errMsg) } }) } diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go index 3fcdc7edf7f0..9956ae3d12e3 100644 --- a/modules/apps/29-fee/keeper/keeper.go +++ b/modules/apps/29-fee/keeper/keeper.go @@ -39,13 +39,25 @@ type Keeper struct { // NewKeeper creates a new 29-fee Keeper instance func NewKeeper( +<<<<<<< HEAD cdc codec.BinaryCodec, key corestore.KVStoreService, +||||||| 2028e9a34 + cdc codec.BinaryCodec, key storetypes.StoreKey, +======= + cdc codec.BinaryCodec, storeService corestore.KVStoreService, +>>>>>>> main ics4Wrapper porttypes.ICS4Wrapper, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, ) Keeper { return Keeper{ cdc: cdc, +<<<<<<< HEAD storeService: key, +||||||| 2028e9a34 + storeKey: key, +======= + storeService: storeService, +>>>>>>> main ics4Wrapper: ics4Wrapper, channelKeeper: channelKeeper, portKeeper: portKeeper, @@ -67,9 +79,18 @@ func (k Keeper) GetICS4Wrapper() porttypes.ICS4Wrapper { } // Logger returns a module-specific logger. +<<<<<<< HEAD func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when Upgrading to 52 return sdkCtx.Logger().With("module", "x/"+ibcexported.ModuleName+"-"+types.ModuleName) +||||||| 2028e9a34 +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+ibcexported.ModuleName+"-"+types.ModuleName) +======= +func (Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return sdkCtx.Logger().With("module", "x/"+ibcexported.ModuleName+"-"+types.ModuleName) +>>>>>>> main } // BindPort defines a wrapper function for the port Keeper's function in @@ -117,9 +138,21 @@ func (k Keeper) EscrowAccountHasBalance(ctx context.Context, coins sdk.Coins) bo // lockFeeModule sets a flag to determine if fee handling logic should run for the given channel // identified by channel and port identifiers. // Please see ADR 004 for more information. +<<<<<<< HEAD func (k Keeper) lockFeeModule(ctx context.Context) { store := k.storeService.OpenKVStore(ctx) store.Set(types.KeyLocked(), []byte{1}) +||||||| 2028e9a34 +func (k Keeper) lockFeeModule(ctx sdk.Context) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyLocked(), []byte{1}) +======= +func (k Keeper) lockFeeModule(ctx context.Context) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(types.KeyLocked(), []byte{1}); err != nil { + panic(err) + } +>>>>>>> main } // IsLocked indicates if the fee module is locked @@ -135,15 +168,39 @@ func (k Keeper) IsLocked(ctx context.Context) bool { // SetFeeEnabled sets a flag to determine if fee handling logic should run for the given channel // identified by channel and port identifiers. +<<<<<<< HEAD func (k Keeper) SetFeeEnabled(ctx context.Context, portID, channelID string) { store := k.storeService.OpenKVStore(ctx) store.Set(types.KeyFeeEnabled(portID, channelID), []byte{1}) +||||||| 2028e9a34 +func (k Keeper) SetFeeEnabled(ctx sdk.Context, portID, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyFeeEnabled(portID, channelID), []byte{1}) +======= +func (k Keeper) SetFeeEnabled(ctx context.Context, portID, channelID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(types.KeyFeeEnabled(portID, channelID), []byte{1}); err != nil { + panic(err) + } +>>>>>>> main } // DeleteFeeEnabled deletes the fee enabled flag for a given portID and channelID +<<<<<<< HEAD func (k Keeper) DeleteFeeEnabled(ctx context.Context, portID, channelID string) { store := k.storeService.OpenKVStore(ctx) store.Delete(types.KeyFeeEnabled(portID, channelID)) +||||||| 2028e9a34 +func (k Keeper) DeleteFeeEnabled(ctx sdk.Context, portID, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.KeyFeeEnabled(portID, channelID)) +======= +func (k Keeper) DeleteFeeEnabled(ctx context.Context, portID, channelID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Delete(types.KeyFeeEnabled(portID, channelID)); err != nil { + panic(err) + } +>>>>>>> main } // IsFeeEnabled returns whether fee handling logic should be run for the given port. It will check the @@ -185,26 +242,55 @@ func (k Keeper) GetPayeeAddress(ctx context.Context, relayerAddr, channelID stri store := k.storeService.OpenKVStore(ctx) key := types.KeyPayee(relayerAddr, channelID) +<<<<<<< HEAD has, err := store.Has(key) if err != nil { panic(err) } if !has { +||||||| 2028e9a34 + if !store.Has(key) { +======= + bz, err := store.Get(key) + if err != nil { + panic(err) + } + + if len(bz) == 0 { +>>>>>>> main return "", false } +<<<<<<< HEAD bz, err := store.Get(key) if err != nil { panic(err) } return string(bz), true +||||||| 2028e9a34 + return string(store.Get(key)), true +======= + return string(bz), true +>>>>>>> main } // SetPayeeAddress stores the fee payee address in state keyed by the provided channel identifier and relayer address +<<<<<<< HEAD func (k Keeper) SetPayeeAddress(ctx context.Context, relayerAddr, payeeAddr, channelID string) { store := k.storeService.OpenKVStore(ctx) store.Set(types.KeyPayee(relayerAddr, channelID), []byte(payeeAddr)) +||||||| 2028e9a34 +func (k Keeper) SetPayeeAddress(ctx sdk.Context, relayerAddr, payeeAddr, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyPayee(relayerAddr, channelID), []byte(payeeAddr)) +======= +func (k Keeper) SetPayeeAddress(ctx context.Context, relayerAddr, payeeAddr, channelID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(types.KeyPayee(relayerAddr, channelID), []byte(payeeAddr)); err != nil { + panic(err) + } +>>>>>>> main } // GetAllPayees returns all registered payees addresses @@ -234,9 +320,21 @@ func (k Keeper) GetAllPayees(ctx context.Context) []types.RegisteredPayee { // SetCounterpartyPayeeAddress maps the destination chain counterparty payee address to the source relayer address // The receiving chain must store the mapping from: address -> counterpartyPayeeAddress for the given channel +<<<<<<< HEAD func (k Keeper) SetCounterpartyPayeeAddress(ctx context.Context, address, counterpartyAddress, channelID string) { store := k.storeService.OpenKVStore(ctx) store.Set(types.KeyCounterpartyPayee(address, channelID), []byte(counterpartyAddress)) +||||||| 2028e9a34 +func (k Keeper) SetCounterpartyPayeeAddress(ctx sdk.Context, address, counterpartyAddress, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyCounterpartyPayee(address, channelID), []byte(counterpartyAddress)) +======= +func (k Keeper) SetCounterpartyPayeeAddress(ctx context.Context, address, counterpartyAddress, channelID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(types.KeyCounterpartyPayee(address, channelID), []byte(counterpartyAddress)); err != nil { + panic(err) + } +>>>>>>> main } // GetCounterpartyPayeeAddress gets the counterparty payee address given a destination relayer address @@ -244,19 +342,38 @@ func (k Keeper) GetCounterpartyPayeeAddress(ctx context.Context, address, channe store := k.storeService.OpenKVStore(ctx) key := types.KeyCounterpartyPayee(address, channelID) +<<<<<<< HEAD has, err := store.Has(key) if err != nil { panic(err) } if !has { return "", false +||||||| 2028e9a34 + if !store.Has(key) { + return "", false +======= + addr, err := store.Get(key) + if err != nil { + panic(err) +>>>>>>> main } +<<<<<<< HEAD addr, err := store.Get(key) if err != nil { panic(err) } return string(addr), true // TODO: why this cast? +||||||| 2028e9a34 + addr := string(store.Get(key)) + return addr, true +======= + if len(addr) == 0 { + return "", false + } + return string(addr), true +>>>>>>> main } // GetAllCounterpartyPayees returns all registered counterparty payee addresses @@ -285,30 +402,61 @@ func (k Keeper) GetAllCounterpartyPayees(ctx context.Context) []types.Registered } // SetRelayerAddressForAsyncAck sets the forward relayer address during OnRecvPacket in case of async acknowledgement +<<<<<<< HEAD func (k Keeper) SetRelayerAddressForAsyncAck(ctx context.Context, packetID channeltypes.PacketId, address string) { store := k.storeService.OpenKVStore(ctx) store.Set(types.KeyRelayerAddressForAsyncAck(packetID), []byte(address)) +||||||| 2028e9a34 +func (k Keeper) SetRelayerAddressForAsyncAck(ctx sdk.Context, packetID channeltypes.PacketId, address string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyRelayerAddressForAsyncAck(packetID), []byte(address)) +======= +func (k Keeper) SetRelayerAddressForAsyncAck(ctx context.Context, packetID channeltypes.PacketId, address string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(types.KeyRelayerAddressForAsyncAck(packetID), []byte(address)); err != nil { + panic(err) + } +>>>>>>> main } // GetRelayerAddressForAsyncAck gets forward relayer address for a particular packet func (k Keeper) GetRelayerAddressForAsyncAck(ctx context.Context, packetID channeltypes.PacketId) (string, bool) { store := k.storeService.OpenKVStore(ctx) key := types.KeyRelayerAddressForAsyncAck(packetID) +<<<<<<< HEAD has, err := store.Has(key) if err != nil { panic(err) } if !has { +||||||| 2028e9a34 + if !store.Has(key) { +======= + + addr, err := store.Get(key) + if err != nil { + panic(err) + } + + if len(addr) == 0 { +>>>>>>> main return "", false } +<<<<<<< HEAD addr, err := store.Get(key) if err != nil { panic(err) } return string(addr), true +||||||| 2028e9a34 + addr := string(store.Get(key)) + return addr, true +======= + return string(addr), true +>>>>>>> main } // GetAllForwardRelayerAddresses returns all forward relayer addresses stored for async acknowledgements @@ -339,7 +487,9 @@ func (k Keeper) GetAllForwardRelayerAddresses(ctx context.Context) []types.Forwa func (k Keeper) DeleteForwardRelayerAddress(ctx context.Context, packetID channeltypes.PacketId) { store := k.storeService.OpenKVStore(ctx) key := types.KeyRelayerAddressForAsyncAck(packetID) - store.Delete(key) + if err := store.Delete(key); err != nil { + panic(err) + } } // GetFeesInEscrow returns all escrowed packet fees for a given packetID @@ -372,14 +522,18 @@ func (k Keeper) HasFeesInEscrow(ctx context.Context, packetID channeltypes.Packe func (k Keeper) SetFeesInEscrow(ctx context.Context, packetID channeltypes.PacketId, fees types.PacketFees) { store := k.storeService.OpenKVStore(ctx) bz := k.MustMarshalFees(fees) - store.Set(types.KeyFeesInEscrow(packetID), bz) + if err := store.Set(types.KeyFeesInEscrow(packetID), bz); err != nil { + panic(err) + } } // DeleteFeesInEscrow deletes the fee associated with the given packetID func (k Keeper) DeleteFeesInEscrow(ctx context.Context, packetID channeltypes.PacketId) { store := k.storeService.OpenKVStore(ctx) key := types.KeyFeesInEscrow(packetID) - store.Delete(key) + if err := store.Delete(key); err != nil { + panic(err) + } } // GetIdentifiedPacketFeesForChannel returns all the currently escrowed fees on a given channel. diff --git a/modules/apps/29-fee/keeper/msg_server_test.go b/modules/apps/29-fee/keeper/msg_server_test.go index ee1658f16ab9..c2c629e95cc7 100644 --- a/modules/apps/29-fee/keeper/msg_server_test.go +++ b/modules/apps/29-fee/keeper/msg_server_test.go @@ -1,17 +1,20 @@ package keeper_test import ( + "errors" "fmt" sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" transfertypes "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" ibcmock "github.com/cosmos/ibc-go/v9/testing/mock" ) @@ -21,90 +24,92 @@ func (suite *KeeperTestSuite) TestRegisterPayee() { testCases := []struct { name string - expPass bool malleate func() + expErr error }{ { "success", - true, func() {}, + nil, }, { "channel does not exist", - false, func() { msg.ChannelId = "channel-100" //nolint:goconst }, + channeltypes.ErrChannelNotFound, }, { "channel is not fee enabled", - false, func() { suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) }, + types.ErrFeeNotEnabled, }, { "given payee is not an sdk address", - false, func() { msg.Payee = "invalid-addr" }, + errors.New("decoding bech32 failed: invalid separator index -1"), }, { "payee is a blocked address", - false, func() { msg.Payee = suite.chainA.GetSimApp().AccountKeeper.GetModuleAddress(transfertypes.ModuleName).String() }, + ibcerrors.ErrUnauthorized, }, } for _, tc := range testCases { tc := tc - suite.SetupTest() - suite.path.Setup() + suite.Run(tc.name, func() { + suite.SetupTest() + suite.path.Setup() - msg = types.NewMsgRegisterPayee( - suite.path.EndpointA.ChannelConfig.PortID, - suite.path.EndpointA.ChannelID, - suite.chainA.SenderAccounts[0].SenderAccount.GetAddress().String(), - suite.chainA.SenderAccounts[1].SenderAccount.GetAddress().String(), - ) + msg = types.NewMsgRegisterPayee( + suite.path.EndpointA.ChannelConfig.PortID, + suite.path.EndpointA.ChannelID, + suite.chainA.SenderAccounts[0].SenderAccount.GetAddress().String(), + suite.chainA.SenderAccounts[1].SenderAccount.GetAddress().String(), + ) - tc.malleate() + tc.malleate() - ctx := suite.chainA.GetContext() - res, err := suite.chainA.GetSimApp().IBCFeeKeeper.RegisterPayee(ctx, msg) + ctx := suite.chainA.GetContext() + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.RegisterPayee(ctx, msg) - if tc.expPass { - suite.Require().NoError(err) - suite.Require().NotNil(res) + if tc.expErr == nil { + suite.Require().NoError(err) + suite.Require().NotNil(res) - payeeAddr, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetPayeeAddress( - suite.chainA.GetContext(), - suite.chainA.SenderAccount.GetAddress().String(), - suite.path.EndpointA.ChannelID, - ) + payeeAddr, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetPayeeAddress( + suite.chainA.GetContext(), + suite.chainA.SenderAccount.GetAddress().String(), + suite.path.EndpointA.ChannelID, + ) - suite.Require().True(found) - suite.Require().Equal(suite.chainA.SenderAccounts[1].SenderAccount.GetAddress().String(), payeeAddr) + suite.Require().True(found) + suite.Require().Equal(suite.chainA.SenderAccounts[1].SenderAccount.GetAddress().String(), payeeAddr) - expectedEvents := sdk.Events{ - sdk.NewEvent( - types.EventTypeRegisterPayee, - sdk.NewAttribute(types.AttributeKeyRelayer, suite.chainA.SenderAccount.GetAddress().String()), - sdk.NewAttribute(types.AttributeKeyPayee, payeeAddr), - sdk.NewAttribute(types.AttributeKeyChannelID, suite.path.EndpointA.ChannelID), - ), - }.ToABCIEvents() + expectedEvents := sdk.Events{ + sdk.NewEvent( + types.EventTypeRegisterPayee, + sdk.NewAttribute(types.AttributeKeyRelayer, suite.chainA.SenderAccount.GetAddress().String()), + sdk.NewAttribute(types.AttributeKeyPayee, payeeAddr), + sdk.NewAttribute(types.AttributeKeyChannelID, suite.path.EndpointA.ChannelID), + ), + }.ToABCIEvents() - expectedEvents = sdk.MarkEventsToIndex(expectedEvents, map[string]struct{}{}) - ibctesting.AssertEvents(&suite.Suite, expectedEvents, ctx.EventManager().Events().ToABCIEvents()) + expectedEvents = sdk.MarkEventsToIndex(expectedEvents, map[string]struct{}{}) + ibctesting.AssertEvents(&suite.Suite, expectedEvents, ctx.EventManager().Events().ToABCIEvents()) - } else { - suite.Require().Error(err) - } + } else { + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) + } + }) } } @@ -116,85 +121,87 @@ func (suite *KeeperTestSuite) TestRegisterCounterpartyPayee() { testCases := []struct { name string - expPass bool malleate func() + expErr error }{ { "success", - true, func() {}, + nil, }, { "counterparty payee is an arbitrary string", - true, func() { msg.CounterpartyPayee = "arbitrary-string" expCounterpartyPayee = "arbitrary-string" }, + nil, }, { "channel does not exist", - false, func() { msg.ChannelId = "channel-100" }, + channeltypes.ErrChannelNotFound, }, { "channel is not fee enabled", - false, func() { suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) }, + types.ErrFeeNotEnabled, }, } for _, tc := range testCases { tc := tc - suite.SetupTest() - suite.path.Setup() // setup channel + suite.Run(tc.name, func() { + suite.SetupTest() + suite.path.Setup() // setup channel - expCounterpartyPayee = suite.chainA.SenderAccounts[1].SenderAccount.GetAddress().String() - msg = types.NewMsgRegisterCounterpartyPayee( - suite.path.EndpointA.ChannelConfig.PortID, - suite.path.EndpointA.ChannelID, - suite.chainA.SenderAccounts[0].SenderAccount.GetAddress().String(), - expCounterpartyPayee, - ) + expCounterpartyPayee = suite.chainA.SenderAccounts[1].SenderAccount.GetAddress().String() + msg = types.NewMsgRegisterCounterpartyPayee( + suite.path.EndpointA.ChannelConfig.PortID, + suite.path.EndpointA.ChannelID, + suite.chainA.SenderAccounts[0].SenderAccount.GetAddress().String(), + expCounterpartyPayee, + ) - tc.malleate() + tc.malleate() - ctx := suite.chainA.GetContext() - res, err := suite.chainA.GetSimApp().IBCFeeKeeper.RegisterCounterpartyPayee(ctx, msg) + ctx := suite.chainA.GetContext() + res, err := suite.chainA.GetSimApp().IBCFeeKeeper.RegisterCounterpartyPayee(ctx, msg) - if tc.expPass { - suite.Require().NoError(err) - suite.Require().NotNil(res) + if tc.expErr == nil { + suite.Require().NoError(err) + suite.Require().NotNil(res) - counterpartyPayee, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetCounterpartyPayeeAddress( - suite.chainA.GetContext(), - suite.chainA.SenderAccount.GetAddress().String(), - suite.path.EndpointA.ChannelID, - ) + counterpartyPayee, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetCounterpartyPayeeAddress( + suite.chainA.GetContext(), + suite.chainA.SenderAccount.GetAddress().String(), + suite.path.EndpointA.ChannelID, + ) - suite.Require().True(found) - suite.Require().Equal(expCounterpartyPayee, counterpartyPayee) + suite.Require().True(found) + suite.Require().Equal(expCounterpartyPayee, counterpartyPayee) - expectedEvents := sdk.Events{ - sdk.NewEvent( - types.EventTypeRegisterCounterpartyPayee, - sdk.NewAttribute(types.AttributeKeyRelayer, suite.chainA.SenderAccount.GetAddress().String()), - sdk.NewAttribute(types.AttributeKeyCounterpartyPayee, counterpartyPayee), - sdk.NewAttribute(types.AttributeKeyChannelID, suite.path.EndpointA.ChannelID), - ), - }.ToABCIEvents() + expectedEvents := sdk.Events{ + sdk.NewEvent( + types.EventTypeRegisterCounterpartyPayee, + sdk.NewAttribute(types.AttributeKeyRelayer, suite.chainA.SenderAccount.GetAddress().String()), + sdk.NewAttribute(types.AttributeKeyCounterpartyPayee, counterpartyPayee), + sdk.NewAttribute(types.AttributeKeyChannelID, suite.path.EndpointA.ChannelID), + ), + }.ToABCIEvents() - expectedEvents = sdk.MarkEventsToIndex(expectedEvents, map[string]struct{}{}) - ibctesting.AssertEvents(&suite.Suite, expectedEvents, ctx.EventManager().Events().ToABCIEvents()) + expectedEvents = sdk.MarkEventsToIndex(expectedEvents, map[string]struct{}{}) + ibctesting.AssertEvents(&suite.Suite, expectedEvents, ctx.EventManager().Events().ToABCIEvents()) - } else { - suite.Require().Error(err) - } + } else { + suite.Require().ErrorIs(err, tc.expErr) + } + }) } } @@ -210,12 +217,12 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success with existing packet fees in escrow", @@ -235,7 +242,17 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { eventFee = types.NewFee(defaultRecvFee.Add(escrowFee.RecvFee...), defaultAckFee.Add(escrowFee.AckFee...), defaultTimeoutFee.Add(escrowFee.TimeoutFee...)) }, - true, + nil, + }, + { + "refund account is module account", + func() { + suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibcmock.ModuleName, fee.Total()) //nolint:errcheck // ignore error for testing + msg.Signer = suite.chainA.GetSimApp().AccountKeeper.GetModuleAddress(ibcmock.ModuleName).String() + expPacketFee := types.NewPacketFee(fee, msg.Signer, nil) + expFeesInEscrow = []types.PacketFee{expPacketFee} + }, + nil, }, { "bank send enabled for fee denom", @@ -247,24 +264,14 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { ) suite.Require().NoError(err) }, - true, - }, - { - "refund account is module account", - func() { - suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibcmock.ModuleName, fee.Total()) //nolint:errcheck // ignore error for testing - msg.Signer = suite.chainA.GetSimApp().AccountKeeper.GetModuleAddress(ibcmock.ModuleName).String() - expPacketFee := types.NewPacketFee(fee, msg.Signer, nil) - expFeesInEscrow = []types.PacketFee{expPacketFee} - }, - true, + nil, }, { "fee module is locked", func() { lockFeeModule(suite.chainA) }, - false, + types.ErrFeeModuleLocked, }, { "fee module disabled on channel", @@ -272,21 +279,21 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { msg.SourcePortId = "invalid-port" msg.SourceChannelId = "invalid-channel" }, - false, + types.ErrFeeNotEnabled, }, { "invalid refund address", func() { msg.Signer = "invalid-address" }, - false, + errors.New("decoding bech32 failed"), }, { "refund account does not exist", func() { msg.Signer = suite.chainB.SenderAccount.GetAddress().String() }, - false, + types.ErrRefundAccNotFound, }, { "refund account is a blocked address", @@ -294,7 +301,7 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { blockedAddr := suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress() msg.Signer = blockedAddr.String() }, - false, + ibcerrors.ErrUnauthorized, }, { "bank send disabled for fee denom", @@ -306,28 +313,28 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { ) suite.Require().NoError(err) }, - false, + banktypes.ErrSendDisabled, }, { "acknowledgement fee balance not found", func() { msg.Fee.AckFee = invalidCoins }, - false, + sdkerrors.ErrInsufficientFunds, }, { "receive fee balance not found", func() { msg.Fee.RecvFee = invalidCoins }, - false, + sdkerrors.ErrInsufficientFunds, }, { "timeout fee balance not found", func() { msg.Fee.TimeoutFee = invalidCoins }, - false, + sdkerrors.ErrInsufficientFunds, }, } @@ -357,7 +364,7 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { ctx := suite.chainA.GetContext() _, err := suite.chainA.GetSimApp().IBCFeeKeeper.PayPacketFee(ctx, msg) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) // message committed packetID := channeltypes.NewPacketID(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) @@ -384,7 +391,7 @@ func (suite *KeeperTestSuite) TestPayPacketFee() { ibctesting.AssertEvents(&suite.Suite, expectedEvents, ctx.EventManager().Events().ToABCIEvents()) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) escrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) suite.Require().Equal(sdkmath.NewInt(0), escrowBalance.Amount) @@ -404,12 +411,12 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success with existing packet fees in escrow", @@ -427,7 +434,7 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { expEscrowBalance = expEscrowBalance.Add(fee.Total()...) expFeesInEscrow = append(expFeesInEscrow, packetFee) }, - true, + nil, }, { "bank send enabled for fee denom", @@ -439,14 +446,14 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { ) suite.Require().NoError(err) }, - true, + nil, }, { "fee module is locked", func() { lockFeeModule(suite.chainA) }, - false, + types.ErrFeeModuleLocked, }, { "fee module disabled on channel", @@ -454,7 +461,7 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { msg.PacketId.PortId = "invalid-port" msg.PacketId.ChannelId = "invalid-channel" }, - false, + types.ErrFeeNotEnabled, }, { "channel does not exist", @@ -465,14 +472,14 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { // NOTE: the channel doesn't exist in 04-channel keeper, but we will add a mapping within ics29 anyways suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), msg.PacketId.PortId, msg.PacketId.ChannelId) }, - false, + channeltypes.ErrSequenceSendNotFound, }, { "packet not sent", func() { msg.PacketId.Sequence++ }, - false, + channeltypes.ErrPacketNotSent, }, { "packet already acknowledged", @@ -480,7 +487,7 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { err := suite.path.RelayPacket(packet) suite.Require().NoError(err) }, - false, + channeltypes.ErrPacketCommitmentNotFound, }, { "packet already timed out", @@ -502,21 +509,21 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { packetID := channeltypes.NewPacketID(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, sequence) msg.PacketId = packetID }, - false, + channeltypes.ErrPacketCommitmentNotFound, }, { "invalid refund address", func() { msg.PacketFee.RefundAddress = "invalid-address" }, - false, + errors.New("decoding bech32 failed"), }, { "refund account does not exist", func() { msg.PacketFee.RefundAddress = suite.chainB.SenderAccount.GetAddress().String() }, - false, + types.ErrRefundAccNotFound, }, { "refund account is a blocked address", @@ -524,7 +531,7 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { blockedAddr := suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress() msg.PacketFee.RefundAddress = blockedAddr.String() }, - false, + ibcerrors.ErrUnauthorized, }, { "bank send disabled for fee denom", @@ -536,28 +543,28 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { ) suite.Require().NoError(err) }, - false, + banktypes.ErrSendDisabled, }, { "acknowledgement fee balance not found", func() { msg.PacketFee.Fee.AckFee = invalidCoins }, - false, + sdkerrors.ErrInsufficientFunds, }, { "receive fee balance not found", func() { msg.PacketFee.Fee.RecvFee = invalidCoins }, - false, + sdkerrors.ErrInsufficientFunds, }, { "timeout fee balance not found", func() { msg.PacketFee.Fee.TimeoutFee = invalidCoins }, - false, + sdkerrors.ErrInsufficientFunds, }, } @@ -587,7 +594,7 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { _, err = suite.chainA.GetSimApp().IBCFeeKeeper.PayPacketFeeAsync(suite.chainA.GetContext(), msg) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) // message committed feesInEscrow, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeesInEscrow(suite.chainA.GetContext(), packetID) @@ -597,7 +604,7 @@ func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { escrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) suite.Require().Equal(expEscrowBalance.AmountOf(sdk.DefaultBondDenom), escrowBalance.Amount) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) escrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) suite.Require().Equal(sdkmath.NewInt(0), escrowBalance.Amount) diff --git a/modules/apps/29-fee/keeper/relay_test.go b/modules/apps/29-fee/keeper/relay_test.go index 7b98c66b5cc6..1902c3fa5f5a 100644 --- a/modules/apps/29-fee/keeper/relay_test.go +++ b/modules/apps/29-fee/keeper/relay_test.go @@ -12,7 +12,7 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgementAsync() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", @@ -20,12 +20,12 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgementAsync() { suite.chainB.GetSimApp().IBCFeeKeeper.SetRelayerAddressForAsyncAck(suite.chainB.GetContext(), channeltypes.NewPacketID(suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID, 1), suite.chainA.SenderAccount.GetAddress().String()) suite.chainB.GetSimApp().IBCFeeKeeper.SetCounterpartyPayeeAddress(suite.chainB.GetContext(), suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), suite.path.EndpointB.ChannelID) }, - true, + nil, }, { "relayer address not set for async WriteAcknowledgement", func() {}, - false, + types.ErrRelayerNotFoundForAsyncAck, }, } @@ -61,7 +61,7 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgementAsync() { err := suite.chainB.GetSimApp().IBCFeeKeeper.WriteAcknowledgement(suite.chainB.GetContext(), chanCap, packet, ack) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) _, found := suite.chainB.GetSimApp().IBCFeeKeeper.GetRelayerAddressForAsyncAck(suite.chainB.GetContext(), channeltypes.NewPacketID(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1)) suite.Require().False(found) @@ -70,7 +70,7 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgementAsync() { committedAck, _ := suite.chainB.GetSimApp().GetIBCKeeper().ChannelKeeper.GetPacketAcknowledgement(suite.chainB.GetContext(), packet.DestinationPort, packet.DestinationChannel, 1) suite.Require().Equal(committedAck, channeltypes.CommitAcknowledgement(expectedAck.Acknowledgement())) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } diff --git a/modules/apps/29-fee/types/codec_test.go b/modules/apps/29-fee/types/codec_test.go index 1e435f472a6a..56666abab648 100644 --- a/modules/apps/29-fee/types/codec_test.go +++ b/modules/apps/29-fee/types/codec_test.go @@ -1,6 +1,7 @@ package types_test import ( + "errors" "testing" "github.com/stretchr/testify/require" @@ -10,38 +11,39 @@ import ( fee "github.com/cosmos/ibc-go/v9/modules/apps/29-fee" "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" + ibctesting "github.com/cosmos/ibc-go/v9/testing" ) func TestCodecTypeRegistration(t *testing.T) { testCases := []struct { name string typeURL string - expPass bool + expErr error }{ { "success: MsgPayPacketFee", sdk.MsgTypeURL(&types.MsgPayPacketFee{}), - true, + nil, }, { "success: MsgPayPacketFeeAsync", sdk.MsgTypeURL(&types.MsgPayPacketFeeAsync{}), - true, + nil, }, { "success: MsgRegisterPayee", sdk.MsgTypeURL(&types.MsgRegisterPayee{}), - true, + nil, }, { "success: MsgRegisterCounterpartyPayee", sdk.MsgTypeURL(&types.MsgRegisterCounterpartyPayee{}), - true, + nil, }, { "type not registered on codec", "ibc.invalid.MsgTypeURL", - false, + errors.New("unable to resolve type URL ibc.invalid.MsgTypeURL"), }, } @@ -52,12 +54,12 @@ func TestCodecTypeRegistration(t *testing.T) { encodingCfg := moduletestutil.MakeTestEncodingConfig(fee.AppModuleBasic{}) msg, err := encodingCfg.Codec.InterfaceRegistry().Resolve(tc.typeURL) - if tc.expPass { + if tc.expErr == nil { require.NotNil(t, msg) require.NoError(t, err) } else { require.Nil(t, msg) - require.Error(t, err) + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) } }) } diff --git a/modules/apps/29-fee/types/fee_test.go b/modules/apps/29-fee/types/fee_test.go index fc3e712e1b85..0168b0e22757 100644 --- a/modules/apps/29-fee/types/fee_test.go +++ b/modules/apps/29-fee/types/fee_test.go @@ -1,6 +1,7 @@ package types_test import ( + "errors" "testing" "github.com/stretchr/testify/require" @@ -12,6 +13,8 @@ import ( "github.com/cometbft/cometbft/crypto/secp256k1" "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" + ibctesting "github.com/cosmos/ibc-go/v9/testing" ) var ( @@ -131,26 +134,26 @@ func TestPacketFeeValidation(t *testing.T) { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success with empty slice for Relayers", func() { packetFee.Relayers = []string{} }, - true, + nil, }, { "should fail when refund address is invalid", func() { packetFee.RefundAddress = invalidAddress }, - false, + errors.New("failed to convert RefundAddress into sdk.AccAddress"), }, { "should fail when all fees are invalid", @@ -159,14 +162,14 @@ func TestPacketFeeValidation(t *testing.T) { packetFee.Fee.RecvFee = invalidFee packetFee.Fee.TimeoutFee = invalidFee }, - false, + ibcerrors.ErrInvalidCoins, }, { "should fail with single invalid fee", func() { packetFee.Fee.AckFee = invalidFee }, - false, + ibcerrors.ErrInvalidCoins, }, { "should fail with two invalid fees", @@ -174,7 +177,7 @@ func TestPacketFeeValidation(t *testing.T) { packetFee.Fee.TimeoutFee = invalidFee packetFee.Fee.AckFee = invalidFee }, - false, + ibcerrors.ErrInvalidCoins, }, { "should pass with two empty fees", @@ -182,14 +185,14 @@ func TestPacketFeeValidation(t *testing.T) { packetFee.Fee.TimeoutFee = sdk.Coins{} packetFee.Fee.AckFee = sdk.Coins{} }, - true, + nil, }, { "should pass with one empty fee", func() { packetFee.Fee.TimeoutFee = sdk.Coins{} }, - true, + nil, }, { "should fail if all fees are empty", @@ -198,31 +201,33 @@ func TestPacketFeeValidation(t *testing.T) { packetFee.Fee.RecvFee = sdk.Coins{} packetFee.Fee.TimeoutFee = sdk.Coins{} }, - false, + ibcerrors.ErrInvalidCoins, }, { "should fail with non empty Relayers", func() { packetFee.Relayers = []string{"relayer"} }, - false, + types.ErrRelayersNotEmpty, }, } for _, tc := range testCases { tc := tc - fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) - packetFee = types.NewPacketFee(fee, defaultAccAddress, nil) + t.Run(tc.name, func(t *testing.T) { + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee = types.NewPacketFee(fee, defaultAccAddress, nil) - tc.malleate() // malleate mutates test data + tc.malleate() // malleate mutates test data - err := packetFee.Validate() + err := packetFee.Validate() - if tc.expPass { - require.NoError(t, err, tc.name) - } else { - require.Error(t, err, tc.name) - } + if tc.expErr == nil { + require.NoError(t, err, tc.name) + } else { + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) + } + }) } } diff --git a/modules/apps/29-fee/types/genesis_test.go b/modules/apps/29-fee/types/genesis_test.go index 633a3e80c00a..93e063745b9d 100644 --- a/modules/apps/29-fee/types/genesis_test.go +++ b/modules/apps/29-fee/types/genesis_test.go @@ -1,6 +1,7 @@ package types_test import ( + "errors" "testing" "github.com/stretchr/testify/require" @@ -11,6 +12,8 @@ import ( "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -25,159 +28,160 @@ func TestValidateGenesis(t *testing.T) { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success - valid genesis", func() {}, - true, + nil, }, { "invalid packetID: invalid port ID", func() { genState.IdentifiedFees[0].PacketId = channeltypes.NewPacketID("", ibctesting.FirstChannelID, 1) }, - false, + host.ErrInvalidID, }, { "invalid packetID: invalid channel ID", func() { genState.IdentifiedFees[0].PacketId = channeltypes.NewPacketID(ibctesting.MockFeePort, "", 1) }, - false, + host.ErrInvalidID, }, { "invalid packetID: invalid sequence", func() { genState.IdentifiedFees[0].PacketId = channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 0) }, - false, + host.ErrInvalidPacket, }, { "invalid packet fee: invalid fee", func() { genState.IdentifiedFees[0].PacketFees[0].Fee = types.NewFee(sdk.Coins{}, sdk.Coins{}, sdk.Coins{}) }, - false, + ibcerrors.ErrInvalidCoins, }, { "invalid packet fee: invalid refund address", func() { genState.IdentifiedFees[0].PacketFees[0].RefundAddress = "" }, - false, + errors.New("failed to convert RefundAddress into sdk.AccAddress"), }, { "invalid fee enabled channel: invalid port ID", func() { genState.FeeEnabledChannels[0].PortId = "" }, - false, + host.ErrInvalidID, }, { "invalid fee enabled channel: invalid channel ID", func() { genState.FeeEnabledChannels[0].ChannelId = "" }, - false, + host.ErrInvalidID, }, { "invalid registered payee: invalid relayer address", func() { genState.RegisteredPayees[0].Relayer = "" }, - false, + errors.New("failed to convert relayer address into sdk.AccAddress"), }, { "invalid registered payee: invalid payee address", func() { genState.RegisteredPayees[0].Payee = "" }, - false, + errors.New("failed to convert payee address into sdk.AccAddress"), }, { "invalid registered payee: invalid channel ID", func() { genState.RegisteredPayees[0].ChannelId = "" }, - false, + host.ErrInvalidID, }, { "invalid registered counterparty payees: invalid relayer address", func() { genState.RegisteredCounterpartyPayees[0].Relayer = "" }, - false, + errors.New("failed to convert relayer address into sdk.AccAddress"), }, { "invalid registered counterparty payees: invalid counterparty payee", func() { genState.RegisteredCounterpartyPayees[0].CounterpartyPayee = "" }, - false, + types.ErrCounterpartyPayeeEmpty, }, { "invalid forward relayer address: invalid forward address", func() { genState.ForwardRelayers[0].Address = "" }, - false, + errors.New("failed to convert forward relayer address into sdk.AccAddress"), }, { "invalid forward relayer address: invalid packet", func() { genState.ForwardRelayers[0].PacketId = channeltypes.PacketId{} }, - false, + host.ErrInvalidID, }, } for _, tc := range testCases { tc := tc - - genState = &types.GenesisState{ - IdentifiedFees: []types.IdentifiedPacketFees{ - { - PacketId: channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1), - PacketFees: []types.PacketFee{types.NewPacketFee(types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee), defaultAccAddress, nil)}, + t.Run(tc.name, func(t *testing.T) { + genState = &types.GenesisState{ + IdentifiedFees: []types.IdentifiedPacketFees{ + { + PacketId: channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1), + PacketFees: []types.PacketFee{types.NewPacketFee(types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee), defaultAccAddress, nil)}, + }, }, - }, - FeeEnabledChannels: []types.FeeEnabledChannel{ - { - PortId: ibctesting.MockFeePort, - ChannelId: ibctesting.FirstChannelID, + FeeEnabledChannels: []types.FeeEnabledChannel{ + { + PortId: ibctesting.MockFeePort, + ChannelId: ibctesting.FirstChannelID, + }, }, - }, - RegisteredCounterpartyPayees: []types.RegisteredCounterpartyPayee{ - { - Relayer: defaultAccAddress, - CounterpartyPayee: defaultAccAddress, - ChannelId: ibctesting.FirstChannelID, + RegisteredCounterpartyPayees: []types.RegisteredCounterpartyPayee{ + { + Relayer: defaultAccAddress, + CounterpartyPayee: defaultAccAddress, + ChannelId: ibctesting.FirstChannelID, + }, }, - }, - ForwardRelayers: []types.ForwardRelayerAddress{ - { - Address: defaultAccAddress, - PacketId: channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1), + ForwardRelayers: []types.ForwardRelayerAddress{ + { + Address: defaultAccAddress, + PacketId: channeltypes.NewPacketID(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1), + }, }, - }, - RegisteredPayees: []types.RegisteredPayee{ - { - Relayer: sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String(), - Payee: sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String(), - ChannelId: ibctesting.FirstChannelID, + RegisteredPayees: []types.RegisteredPayee{ + { + Relayer: sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String(), + Payee: sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String(), + ChannelId: ibctesting.FirstChannelID, + }, }, - }, - } + } - tc.malleate() + tc.malleate() - err := genState.Validate() + err := genState.Validate() - if tc.expPass { - require.NoError(t, err, tc.name) - } else { - require.Error(t, err, tc.name) - } + if tc.expErr == nil { + require.NoError(t, err, tc.name) + } else { + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) + } + }) } } diff --git a/modules/apps/29-fee/types/keys_test.go b/modules/apps/29-fee/types/keys_test.go index edefc87c83df..ec95afab64be 100644 --- a/modules/apps/29-fee/types/keys_test.go +++ b/modules/apps/29-fee/types/keys_test.go @@ -1,6 +1,7 @@ package types_test import ( + "errors" "fmt" "testing" @@ -8,6 +9,7 @@ import ( "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -20,19 +22,19 @@ func TestKeyPayee(t *testing.T) { func TestParseKeyPayee(t *testing.T) { testCases := []struct { - name string - key string - expPass bool + name string + key string + expErr error }{ { "success", string(types.KeyPayee("relayer-address", ibctesting.FirstChannelID)), - true, + nil, }, { "incorrect key - key split has incorrect length", "payeeAddress/relayer_address/transfer/channel-0", - false, + ibcerrors.ErrLogic, }, } @@ -41,12 +43,12 @@ func TestParseKeyPayee(t *testing.T) { address, channelID, err := types.ParseKeyPayeeAddress(tc.key) - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err) require.Equal(t, "relayer-address", address) require.Equal(t, ibctesting.FirstChannelID, channelID) } else { - require.Error(t, err) + require.ErrorIs(t, err, tc.expErr) } } } @@ -68,64 +70,66 @@ func TestKeyFeesInEscrow(t *testing.T) { func TestParseKeyFeeEnabled(t *testing.T) { testCases := []struct { - name string - key string - expPass bool + name string + key string + expErr error }{ { "success", string(types.KeyFeeEnabled(ibctesting.MockPort, ibctesting.FirstChannelID)), - true, + nil, }, { "incorrect key - key split has incorrect length", string(types.KeyFeesInEscrow(validPacketID)), - false, + ibcerrors.ErrLogic, }, { "incorrect key - key split has incorrect length", fmt.Sprintf("%s/%s/%s", "fee", ibctesting.MockPort, ibctesting.FirstChannelID), - false, + ibcerrors.ErrLogic, }, } for _, tc := range testCases { tc := tc - portID, channelID, err := types.ParseKeyFeeEnabled(tc.key) - - if tc.expPass { - require.NoError(t, err) - require.Equal(t, ibctesting.MockPort, portID) - require.Equal(t, ibctesting.FirstChannelID, channelID) - } else { - require.Error(t, err) - require.Empty(t, portID) - require.Empty(t, channelID) - } + t.Run(tc.name, func(t *testing.T) { + portID, channelID, err := types.ParseKeyFeeEnabled(tc.key) + + if tc.expErr == nil { + require.NoError(t, err) + require.Equal(t, ibctesting.MockPort, portID) + require.Equal(t, ibctesting.FirstChannelID, channelID) + } else { + require.ErrorIs(t, err, tc.expErr) + require.Empty(t, portID) + require.Empty(t, channelID) + } + }) } } func TestParseKeyFeesInEscrow(t *testing.T) { testCases := []struct { - name string - key string - expPass bool + name string + key string + expErr error }{ { "success", string(types.KeyFeesInEscrow(validPacketID)), - true, + nil, }, { "incorrect key - key split has incorrect length", string(types.KeyFeeEnabled(validPacketID.PortId, validPacketID.ChannelId)), - false, + ibcerrors.ErrLogic, }, { "incorrect key - sequence cannot be parsed", fmt.Sprintf("%s/%s", types.KeyFeesInEscrowChannelPrefix(validPacketID.PortId, validPacketID.ChannelId), "sequence"), - false, + errors.New("invalid syntax"), }, } @@ -134,35 +138,35 @@ func TestParseKeyFeesInEscrow(t *testing.T) { packetID, err := types.ParseKeyFeesInEscrow(tc.key) - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err) require.Equal(t, validPacketID, packetID) } else { - require.Error(t, err) + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) } } } func TestParseKeyForwardRelayerAddress(t *testing.T) { testCases := []struct { - name string - key string - expPass bool + name string + key string + expErr error }{ { "success", string(types.KeyRelayerAddressForAsyncAck(validPacketID)), - true, + nil, }, { "incorrect key - key split has incorrect length", "forwardRelayer/transfer/channel-0", - false, + ibcerrors.ErrLogic, }, { "incorrect key - sequence is not correct", "forwardRelayer/transfer/channel-0/sequence", - false, + errors.New("invalid syntax"), }, } @@ -171,11 +175,11 @@ func TestParseKeyForwardRelayerAddress(t *testing.T) { packetID, err := types.ParseKeyRelayerAddressForAsyncAck(tc.key) - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err) require.Equal(t, validPacketID, packetID) } else { - require.Error(t, err) + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) } } } @@ -184,19 +188,19 @@ func TestParseKeyCounterpartyPayee(t *testing.T) { relayerAddress := "relayer_address" testCases := []struct { - name string - key string - expPass bool + name string + key string + expErr error }{ { "success", string(types.KeyCounterpartyPayee(relayerAddress, ibctesting.FirstChannelID)), - true, + nil, }, { "incorrect key - key split has incorrect length", "relayerAddress/relayer_address/transfer/channel-0", - false, + ibcerrors.ErrLogic, }, } @@ -205,12 +209,12 @@ func TestParseKeyCounterpartyPayee(t *testing.T) { address, channelID, err := types.ParseKeyCounterpartyPayee(tc.key) - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err) require.Equal(t, relayerAddress, address) require.Equal(t, ibctesting.FirstChannelID, channelID) } else { - require.Error(t, err) + require.ErrorIs(t, err, tc.expErr) } } } diff --git a/modules/apps/29-fee/types/msgs_test.go b/modules/apps/29-fee/types/msgs_test.go index e952ee80907e..7699b94e990f 100644 --- a/modules/apps/29-fee/types/msgs_test.go +++ b/modules/apps/29-fee/types/msgs_test.go @@ -1,6 +1,7 @@ package types_test import ( + "errors" "testing" "github.com/stretchr/testify/require" @@ -13,6 +14,8 @@ import ( modulefee "github.com/cosmos/ibc-go/v9/modules/apps/29-fee" "github.com/cosmos/ibc-go/v9/modules/apps/29-fee/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -22,12 +25,12 @@ func TestMsgRegisterPayeeValidation(t *testing.T) { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success: relayer and payee are equal", @@ -35,55 +38,57 @@ func TestMsgRegisterPayeeValidation(t *testing.T) { msg.Relayer = defaultAccAddress msg.Payee = defaultAccAddress }, - true, + nil, }, { "invalid portID", func() { msg.PortId = "" }, - false, + host.ErrInvalidID, }, { "invalid channelID", func() { msg.ChannelId = "" }, - false, + host.ErrInvalidID, }, { "invalid relayer address", func() { msg.Relayer = invalidAddress }, - false, + errors.New("failed to create sdk.AccAddress from relayer address"), }, { "invalid payee address", func() { msg.Payee = invalidAddress }, - false, + errors.New("failed to create sdk.AccAddress from payee address"), }, } for i, tc := range testCases { tc := tc - relayerAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - payeeAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) + t.Run(tc.name, func(t *testing.T) { + relayerAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) + payeeAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) - msg = types.NewMsgRegisterPayee(ibctesting.MockPort, ibctesting.FirstChannelID, relayerAddr.String(), payeeAddr.String()) + msg = types.NewMsgRegisterPayee(ibctesting.MockPort, ibctesting.FirstChannelID, relayerAddr.String(), payeeAddr.String()) - tc.malleate() + tc.malleate() - err := msg.ValidateBasic() + err := msg.ValidateBasic() - if tc.expPass { - require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) - } else { - require.Error(t, err, "invalid test case %d passed: %s", i, tc.name) - } + if tc.expErr == nil { + require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) + } else { + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) + } + }) } } @@ -103,73 +108,75 @@ func TestMsgRegisterCountepartyPayeeValidation(t *testing.T) { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "invalid portID", func() { msg.PortId = "" }, - false, + host.ErrInvalidID, }, { "invalid channelID", func() { msg.ChannelId = "" }, - false, + host.ErrInvalidID, }, { "validate with incorrect destination relayer address", func() { msg.Relayer = invalidAddress }, - false, + errors.New("failed to create sdk.AccAddress from relayer address"), }, { "invalid counterparty payee address", func() { msg.CounterpartyPayee = "" }, - false, + types.ErrCounterpartyPayeeEmpty, }, { "invalid counterparty payee address: whitespaced empty string", func() { msg.CounterpartyPayee = " " }, - false, + types.ErrCounterpartyPayeeEmpty, }, { "invalid counterparty payee address: too long", func() { msg.CounterpartyPayee = ibctesting.GenerateString(types.MaximumCounterpartyPayeeLength + 1) }, - false, + ibcerrors.ErrInvalidAddress, }, } for i, tc := range testCases { i, tc := i, tc - payeeAddr, err := sdk.AccAddressFromBech32(ibctesting.TestAccAddress) - require.NoError(t, err) - msg = types.NewMsgRegisterCounterpartyPayee(ibctesting.MockPort, ibctesting.FirstChannelID, defaultAccAddress, payeeAddr.String()) + t.Run(tc.name, func(t *testing.T) { + payeeAddr, err := sdk.AccAddressFromBech32(ibctesting.TestAccAddress) + require.NoError(t, err) + msg = types.NewMsgRegisterCounterpartyPayee(ibctesting.MockPort, ibctesting.FirstChannelID, defaultAccAddress, payeeAddr.String()) - tc.malleate() + tc.malleate() - err = msg.ValidateBasic() + err = msg.ValidateBasic() - if tc.expPass { - require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) - } else { - require.Error(t, err, "invalid test case %d passed: %s", i, tc.name) - } + if tc.expErr == nil { + require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) + } else { + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) + } + }) } } @@ -189,47 +196,47 @@ func TestMsgPayPacketFeeValidation(t *testing.T) { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success with empty relayers", func() { msg.Relayers = []string{} }, - true, + nil, }, { "invalid channelID", func() { msg.SourceChannelId = "" }, - false, + host.ErrInvalidID, }, { "invalid portID", func() { msg.SourcePortId = "" }, - false, + host.ErrInvalidID, }, { "relayers is not nil", func() { msg.Relayers = []string{defaultAccAddress} }, - false, + types.ErrRelayersNotEmpty, }, { "invalid signer address", func() { msg.Signer = invalidAddress }, - false, + errors.New("failed to convert msg.Signer into sdk.AccAddress"), }, } @@ -243,10 +250,10 @@ func TestMsgPayPacketFeeValidation(t *testing.T) { err := msg.ValidateBasic() - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err, tc.name) } else { - require.Error(t, err, tc.name) + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) } } } @@ -268,54 +275,69 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success with empty relayers", func() { msg.PacketFee.Relayers = []string{} }, - true, + nil, + }, + { + "should pass with two empty fees", + func() { + msg.PacketFee.Fee.AckFee = sdk.Coins{} + msg.PacketFee.Fee.TimeoutFee = sdk.Coins{} + }, + nil, + }, + { + "should pass with one empty fee", + func() { + msg.PacketFee.Fee.TimeoutFee = sdk.Coins{} + }, + nil, }, { "invalid channelID", func() { msg.PacketId.ChannelId = "" }, - false, + host.ErrInvalidID, }, { "invalid portID", func() { msg.PacketId.PortId = "" }, - false, + host.ErrInvalidID, }, { "invalid sequence", func() { msg.PacketId.Sequence = 0 }, - false, + channeltypes.ErrInvalidPacket, }, { "relayers is not nil", func() { msg.PacketFee.Relayers = []string{defaultAccAddress} }, - false, + types.ErrRelayersNotEmpty, }, { "invalid signer address", func() { msg.PacketFee.RefundAddress = "invalid-addr" }, - false, + errors.New("failed to convert RefundAddress into sdk.AccAddress"), }, { "should fail when all fees are invalid", @@ -324,14 +346,14 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { msg.PacketFee.Fee.RecvFee = invalidFee msg.PacketFee.Fee.TimeoutFee = invalidFee }, - false, + ibcerrors.ErrInvalidCoins, }, { "should fail with single invalid fee", func() { msg.PacketFee.Fee.AckFee = invalidFee }, - false, + ibcerrors.ErrInvalidCoins, }, { "should fail with two invalid fees", @@ -339,22 +361,7 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { msg.PacketFee.Fee.AckFee = invalidFee msg.PacketFee.Fee.TimeoutFee = invalidFee }, - false, - }, - { - "should pass with two empty fees", - func() { - msg.PacketFee.Fee.AckFee = sdk.Coins{} - msg.PacketFee.Fee.TimeoutFee = sdk.Coins{} - }, - true, - }, - { - "should pass with one empty fee", - func() { - msg.PacketFee.Fee.TimeoutFee = sdk.Coins{} - }, - true, + ibcerrors.ErrInvalidCoins, }, { "should fail if all fees are empty", @@ -363,7 +370,7 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { msg.PacketFee.Fee.RecvFee = sdk.Coins{} msg.PacketFee.Fee.TimeoutFee = sdk.Coins{} }, - false, + ibcerrors.ErrInvalidCoins, }, } @@ -380,10 +387,10 @@ func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { err := msg.ValidateBasic() - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err, tc.name) } else { - require.Error(t, err, tc.name) + ibctesting.RequireErrorIsOrContains(t, err, tc.expErr, err.Error()) } } } diff --git a/modules/apps/callbacks/CHANGELOG.md b/modules/apps/callbacks/CHANGELOG.md index 8b76e98bda73..b2c50b901905 100644 --- a/modules/apps/callbacks/CHANGELOG.md +++ b/modules/apps/callbacks/CHANGELOG.md @@ -38,7 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies -* [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump Cosmos SDK to v0.50.6. +* [\#6828](https://github.com/cosmos/ibc-go/pull/6828) Bump Cosmos SDK to v0.50.9. * [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump `cosmossdk.io/store` to v1.1.0. * [\#6848](https://github.com/cosmos/ibc-go/pull/6848) Bump CometBFT to v0.38.10. diff --git a/modules/apps/callbacks/go.mod b/modules/apps/callbacks/go.mod index 4c9c6ee12c68..94c37bf511d2 100644 --- a/modules/apps/callbacks/go.mod +++ b/modules/apps/callbacks/go.mod @@ -10,25 +10,25 @@ replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.2021 require ( cosmossdk.io/api v0.7.5 - cosmossdk.io/client/v2 v2.0.0-beta.2 - cosmossdk.io/core v0.11.0 + cosmossdk.io/client/v2 v2.0.0-beta.3 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 - cosmossdk.io/log v1.3.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 - cosmossdk.io/tools/confix v0.1.1 + cosmossdk.io/tools/confix v0.1.2 cosmossdk.io/x/circuit v0.1.1 cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 - cosmossdk.io/x/tx v0.13.3 - cosmossdk.io/x/upgrade v0.1.3 - github.com/cometbft/cometbft v0.38.10 + cosmossdk.io/x/tx v0.13.4 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cometbft/cometbft v0.38.11 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.5.0 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/modules/capability v1.0.1 github.com/cosmos/ibc-go/v9 v9.0.0 - github.com/spf13/cast v1.6.0 + github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 @@ -42,7 +42,7 @@ require ( cloud.google.com/go/iam v1.1.9 // indirect cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/depinject v1.0.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -184,19 +184,19 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/sys v0.23.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/modules/apps/callbacks/go.sum b/modules/apps/callbacks/go.sum index 834a6d797e48..b14e3de91115 100644 --- a/modules/apps/callbacks/go.sum +++ b/modules/apps/callbacks/go.sum @@ -188,34 +188,34 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.2 h1:jnTKB0PLb7qunQibijAftwmNjUbsIAf1sPjF5HaCW/E= -cosmossdk.io/client/v2 v2.0.0-beta.2/go.mod h1:8QAyewD7rDWeJGqedFBpeqJ9XLIJAkt1TDhCf1gsN9o= +cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= -cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -335,8 +335,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= -github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -351,15 +351,15 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= -github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= @@ -937,8 +937,8 @@ github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIK github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1049,8 +1049,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1149,8 +1149,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1288,13 +1288,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1554,8 +1554,8 @@ google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGr google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= diff --git a/modules/apps/callbacks/ibc_middleware.go b/modules/apps/callbacks/ibc_middleware.go index 2fb1065fb58a..6f921750fe5f 100644 --- a/modules/apps/callbacks/ibc_middleware.go +++ b/modules/apps/callbacks/ibc_middleware.go @@ -1,6 +1,7 @@ package ibccallbacks import ( + "context" "errors" "fmt" @@ -86,7 +87,7 @@ func (im *IBCMiddleware) GetICS4Wrapper() porttypes.ICS4Wrapper { // If the contract callback returns an error, panics, or runs out of gas, then // the packet send is rejected. func (im IBCMiddleware) SendPacket( - ctx sdk.Context, + ctx context.Context, chanCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, @@ -102,7 +103,8 @@ func (im IBCMiddleware) SendPacket( // packet is created without destination information present, GetSourceCallbackData does not use these. packet := channeltypes.NewPacket(data, seq, sourcePort, sourceChannel, "", "", timeoutHeight, timeoutTimestamp) - callbackData, err := types.GetSourceCallbackData(ctx, im.app, packet, im.maxCallbackGas) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + callbackData, err := types.GetSourceCallbackData(sdkCtx, im.app, packet, im.maxCallbackGas) // SendPacket is not blocked if the packet does not opt-in to callbacks if err != nil { return seq, nil @@ -114,13 +116,13 @@ func (im IBCMiddleware) SendPacket( ) } - err = im.processCallback(ctx, types.CallbackTypeSendPacket, callbackData, callbackExecutor) + err = im.processCallback(sdkCtx, types.CallbackTypeSendPacket, callbackData, callbackExecutor) // contract keeper is allowed to reject the packet send. if err != nil { return 0, err } - types.EmitCallbackEvent(ctx, sourcePort, sourceChannel, seq, types.CallbackTypeSendPacket, callbackData, nil) + types.EmitCallbackEvent(sdkCtx, sourcePort, sourceChannel, seq, types.CallbackTypeSendPacket, callbackData, nil) return seq, nil } @@ -129,7 +131,7 @@ func (im IBCMiddleware) SendPacket( // If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are // reverted via a panic. func (im IBCMiddleware) OnAcknowledgementPacket( - ctx sdk.Context, + ctx context.Context, channelVersion string, packet channeltypes.Packet, acknowledgement []byte, @@ -141,8 +143,10 @@ func (im IBCMiddleware) OnAcknowledgementPacket( return err } + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + callbackData, err := types.GetSourceCallbackData( - ctx, im.app, packet, im.maxCallbackGas, + sdkCtx, im.app, packet, im.maxCallbackGas, ) // OnAcknowledgementPacket is not blocked if the packet does not opt-in to callbacks if err != nil { @@ -156,9 +160,9 @@ func (im IBCMiddleware) OnAcknowledgementPacket( } // callback execution errors are not allowed to block the packet lifecycle, they are only used in event emissions - err = im.processCallback(ctx, types.CallbackTypeAcknowledgementPacket, callbackData, callbackExecutor) + err = im.processCallback(sdkCtx, types.CallbackTypeAcknowledgementPacket, callbackData, callbackExecutor) types.EmitCallbackEvent( - ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence(), + sdkCtx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence(), types.CallbackTypeAcknowledgementPacket, callbackData, err, ) @@ -169,14 +173,16 @@ func (im IBCMiddleware) OnAcknowledgementPacket( // It defers to the underlying application and then calls the contract callback. // If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are // reverted via a panic. -func (im IBCMiddleware) OnTimeoutPacket(ctx sdk.Context, channelVersion string, packet channeltypes.Packet, relayer sdk.AccAddress) error { +func (im IBCMiddleware) OnTimeoutPacket(ctx context.Context, channelVersion string, packet channeltypes.Packet, relayer sdk.AccAddress) error { err := im.app.OnTimeoutPacket(ctx, channelVersion, packet, relayer) if err != nil { return err } + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + callbackData, err := types.GetSourceCallbackData( - ctx, im.app, packet, im.maxCallbackGas, + sdkCtx, im.app, packet, im.maxCallbackGas, ) // OnTimeoutPacket is not blocked if the packet does not opt-in to callbacks if err != nil { @@ -188,9 +194,9 @@ func (im IBCMiddleware) OnTimeoutPacket(ctx sdk.Context, channelVersion string, } // callback execution errors are not allowed to block the packet lifecycle, they are only used in event emissions - err = im.processCallback(ctx, types.CallbackTypeTimeoutPacket, callbackData, callbackExecutor) + err = im.processCallback(sdkCtx, types.CallbackTypeTimeoutPacket, callbackData, callbackExecutor) types.EmitCallbackEvent( - ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence(), + sdkCtx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence(), types.CallbackTypeTimeoutPacket, callbackData, err, ) @@ -202,7 +208,7 @@ func (im IBCMiddleware) OnTimeoutPacket(ctx sdk.Context, channelVersion string, // It defers to the underlying application and then calls the contract callback. // If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are // reverted via a panic. -func (im IBCMiddleware) OnRecvPacket(ctx sdk.Context, channelVersion string, packet channeltypes.Packet, relayer sdk.AccAddress) ibcexported.Acknowledgement { +func (im IBCMiddleware) OnRecvPacket(ctx context.Context, channelVersion string, packet channeltypes.Packet, relayer sdk.AccAddress) ibcexported.Acknowledgement { ack := im.app.OnRecvPacket(ctx, channelVersion, packet, relayer) // if ack is nil (asynchronous acknowledgements), then the callback will be handled in WriteAcknowledgement // if ack is not successful, all state changes are reverted. If a packet cannot be received, then there is @@ -211,8 +217,9 @@ func (im IBCMiddleware) OnRecvPacket(ctx sdk.Context, channelVersion string, pac return ack } + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 callbackData, err := types.GetDestCallbackData( - ctx, im.app, packet, im.maxCallbackGas, + sdkCtx, im.app, packet, im.maxCallbackGas, ) // OnRecvPacket is not blocked if the packet does not opt-in to callbacks if err != nil { @@ -224,9 +231,9 @@ func (im IBCMiddleware) OnRecvPacket(ctx sdk.Context, channelVersion string, pac } // callback execution errors are not allowed to block the packet lifecycle, they are only used in event emissions - err = im.processCallback(ctx, types.CallbackTypeReceivePacket, callbackData, callbackExecutor) + err = im.processCallback(sdkCtx, types.CallbackTypeReceivePacket, callbackData, callbackExecutor) types.EmitCallbackEvent( - ctx, packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence(), + sdkCtx, packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence(), types.CallbackTypeReceivePacket, callbackData, err, ) @@ -239,7 +246,7 @@ func (im IBCMiddleware) OnRecvPacket(ctx sdk.Context, channelVersion string, pac // If the contract callback runs out of gas and may be retried with a higher gas limit then the state changes are // reverted via a panic. func (im IBCMiddleware) WriteAcknowledgement( - ctx sdk.Context, + ctx context.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, ack ibcexported.Acknowledgement, @@ -254,8 +261,9 @@ func (im IBCMiddleware) WriteAcknowledgement( panic(fmt.Errorf("expected type %T, got %T", &channeltypes.Packet{}, packet)) } + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 callbackData, err := types.GetDestCallbackData( - ctx, im.app, chanPacket, im.maxCallbackGas, + sdkCtx, im.app, chanPacket, im.maxCallbackGas, ) // WriteAcknowledgement is not blocked if the packet does not opt-in to callbacks if err != nil { @@ -267,9 +275,9 @@ func (im IBCMiddleware) WriteAcknowledgement( } // callback execution errors are not allowed to block the packet lifecycle, they are only used in event emissions - err = im.processCallback(ctx, types.CallbackTypeReceivePacket, callbackData, callbackExecutor) + err = im.processCallback(sdkCtx, types.CallbackTypeReceivePacket, callbackData, callbackExecutor) types.EmitCallbackEvent( - ctx, packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence(), + sdkCtx, packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence(), types.CallbackTypeReceivePacket, callbackData, err, ) @@ -327,7 +335,7 @@ func (IBCMiddleware) processCallback( // OnChanOpenInit defers to the underlying application func (im IBCMiddleware) OnChanOpenInit( - ctx sdk.Context, + ctx context.Context, channelOrdering channeltypes.Order, connectionHops []string, portID, @@ -341,7 +349,7 @@ func (im IBCMiddleware) OnChanOpenInit( // OnChanOpenTry defers to the underlying application func (im IBCMiddleware) OnChanOpenTry( - ctx sdk.Context, + ctx context.Context, channelOrdering channeltypes.Order, connectionHops []string, portID, channelID string, @@ -354,7 +362,7 @@ func (im IBCMiddleware) OnChanOpenTry( // OnChanOpenAck defers to the underlying application func (im IBCMiddleware) OnChanOpenAck( - ctx sdk.Context, + ctx context.Context, portID, channelID, counterpartyChannelID, @@ -364,22 +372,22 @@ func (im IBCMiddleware) OnChanOpenAck( } // OnChanOpenConfirm defers to the underlying application -func (im IBCMiddleware) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error { +func (im IBCMiddleware) OnChanOpenConfirm(ctx context.Context, portID, channelID string) error { return im.app.OnChanOpenConfirm(ctx, portID, channelID) } // OnChanCloseInit defers to the underlying application -func (im IBCMiddleware) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error { +func (im IBCMiddleware) OnChanCloseInit(ctx context.Context, portID, channelID string) error { return im.app.OnChanCloseInit(ctx, portID, channelID) } // OnChanCloseConfirm defers to the underlying application -func (im IBCMiddleware) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error { +func (im IBCMiddleware) OnChanCloseConfirm(ctx context.Context, portID, channelID string) error { return im.app.OnChanCloseConfirm(ctx, portID, channelID) } // OnChanUpgradeInit implements the IBCModule interface -func (im IBCMiddleware) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string) (string, error) { +func (im IBCMiddleware) OnChanUpgradeInit(ctx context.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string) (string, error) { cbs, ok := im.app.(porttypes.UpgradableModule) if !ok { return "", errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack") @@ -389,7 +397,7 @@ func (im IBCMiddleware) OnChanUpgradeInit(ctx sdk.Context, portID, channelID str } // OnChanUpgradeTry implements the IBCModule interface -func (im IBCMiddleware) OnChanUpgradeTry(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, counterpartyVersion string) (string, error) { +func (im IBCMiddleware) OnChanUpgradeTry(ctx context.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, counterpartyVersion string) (string, error) { cbs, ok := im.app.(porttypes.UpgradableModule) if !ok { return "", errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack") @@ -399,7 +407,7 @@ func (im IBCMiddleware) OnChanUpgradeTry(ctx sdk.Context, portID, channelID stri } // OnChanUpgradeAck implements the IBCModule interface -func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counterpartyVersion string) error { +func (im IBCMiddleware) OnChanUpgradeAck(ctx context.Context, portID, channelID, counterpartyVersion string) error { cbs, ok := im.app.(porttypes.UpgradableModule) if !ok { return errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack") @@ -409,7 +417,7 @@ func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, cou } // OnChanUpgradeOpen implements the IBCModule interface -func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string) { +func (im IBCMiddleware) OnChanUpgradeOpen(ctx context.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string) { cbs, ok := im.app.(porttypes.UpgradableModule) if !ok { panic(errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack")) @@ -420,12 +428,12 @@ func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID str // GetAppVersion implements the ICS4Wrapper interface. Callbacks has no version, // so the call is deferred to the underlying application. -func (im IBCMiddleware) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { +func (im IBCMiddleware) GetAppVersion(ctx context.Context, portID, channelID string) (string, bool) { return im.ics4Wrapper.GetAppVersion(ctx, portID, channelID) } // UnmarshalPacketData defers to the underlying app to unmarshal the packet data. // This function implements the optional PacketDataUnmarshaler interface. -func (im IBCMiddleware) UnmarshalPacketData(ctx sdk.Context, portID string, channelID string, bz []byte) (interface{}, string, error) { +func (im IBCMiddleware) UnmarshalPacketData(ctx context.Context, portID string, channelID string, bz []byte) (interface{}, string, error) { return im.app.UnmarshalPacketData(ctx, portID, channelID, bz) } diff --git a/modules/apps/callbacks/testing/simapp/app.go b/modules/apps/callbacks/testing/simapp/app.go index 931a51ce690e..aa361c812638 100644 --- a/modules/apps/callbacks/testing/simapp/app.go +++ b/modules/apps/callbacks/testing/simapp/app.go @@ -405,7 +405,7 @@ func NewSimApp( app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibcexported.StoreKey], app.GetSubspace(ibcexported.ModuleName), app.UpgradeKeeper, scopedIBCKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, runtime.NewKVStoreService(keys[ibcexported.StoreKey]), app.GetSubspace(ibcexported.ModuleName), app.UpgradeKeeper, scopedIBCKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // NOTE: The mock ContractKeeper is only created for testing. @@ -430,7 +430,7 @@ func NewSimApp( // IBC Fee Module keeper app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( - appCodec, keys[ibcfeetypes.StoreKey], + appCodec, runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, @@ -438,7 +438,7 @@ func NewSimApp( // ICA Controller keeper app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( - appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), + appCodec, runtime.NewKVStoreService(keys[icacontrollertypes.StoreKey]), app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), @@ -447,7 +447,7 @@ func NewSimApp( // ICA Host keeper app.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), + appCodec, runtime.NewKVStoreService(keys[icahosttypes.StoreKey]), app.GetSubspace(icahosttypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), @@ -464,7 +464,7 @@ func NewSimApp( // since fee middleware will wrap the IBCKeeper for underlying application. // NOTE: the Transfer Keeper's ICS4Wrapper can later be replaced. app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), + appCodec, runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]), app.GetSubspace(ibctransfertypes.ModuleName), app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, diff --git a/modules/apps/transfer/client/cli/tx.go b/modules/apps/transfer/client/cli/tx.go index 1805375031f3..2e80f249f885 100644 --- a/modules/apps/transfer/client/cli/tx.go +++ b/modules/apps/transfer/client/cli/tx.go @@ -43,18 +43,24 @@ packet if the coins list is a comma-separated string (e.g. 100uatom,100uosmo). T Timeout height can be set by passing in the height string in the form {revision}-{height} using the {packet-timeout-height} flag. Note, relative timeout height is not supported. Relative timeout timestamp is added to the value of the user's local system clock time using the {packet-timeout-timestamp} flag. If no timeout value is set then a default relative timeout value of 10 minutes is used. IBC tokens -can be automatically unwound to their native chain using the {unwind} flag. Please note that if the {unwind} flag is used, then the transfer should contain only -a single token. Tokens can also be automatically forwarded through multiple chains using the {fowarding} flag and specifying -a comma-separated list of source portID/channelID pairs for each intermediary chain. {unwind} and {forwarding} flags can be used together -to first unwind IBC tokens to their native chain and then forward them to the final destination.`), +can be automatically unwound to their native chain using the {unwind} flag. Please note that if the {unwind} flag is used, then all coins must +be IBC vouchers and share exactly the same denomination trace path, and the src-port and src-channel arguments must not be specified. Tokens can also be +automatically forwarded through multiple chains using the {fowarding} flag and specifying a comma-separated list of source portID/channelID pairs for +each intermediary chain. {unwind} and {forwarding} flags can be used together to first unwind IBC tokens to their native chain and then forward them to the final destination.`), Example: fmt.Sprintf("%s tx ibc-transfer transfer [src-port] [src-channel] [receiver] [coins]", version.AppName), - Args: cobra.ExactArgs(4), + Args: cobra.RangeArgs(2, 4), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } sender := clientCtx.GetFromAddress().String() + + args, err = normalizeArgs(cmd, args) + if err != nil { + return err + } + srcPort := args[0] srcChannel := args[1] receiver := args[2] @@ -146,12 +152,20 @@ to first unwind IBC tokens to their native chain and then forward them to the fi func parseForwarding(cmd *cobra.Command) (*types.Forwarding, error) { var hops []types.Hop + unwind, err := cmd.Flags().GetBool(flagUnwind) + if err != nil { + return nil, err + } + forwarding := types.NewForwarding(unwind) + forwardingString, err := cmd.Flags().GetString(flagForwarding) if err != nil { return nil, err } + if strings.TrimSpace(forwardingString) == "" { - return nil, nil + // If forwarding not specified, we might have unwind set + return forwarding, nil } pairs := strings.Split(forwardingString, ",") @@ -165,10 +179,34 @@ func parseForwarding(cmd *cobra.Command) (*types.Forwarding, error) { hops = append(hops, hop) } + forwarding.Hops = hops + return forwarding, nil +} + +// normalizeArgs takes the positional arguments specified and if the unwind flag +// is false and the args array is of length 4, returns them as-is or, if unwind is true and the +// args array has a length of 2, inserts two empty strings at the beginning signifying the +// portID and channelID. +func normalizeArgs(cmd *cobra.Command, args []string) ([]string, error) { unwind, err := cmd.Flags().GetBool(flagUnwind) if err != nil { return nil, err } - return types.NewForwarding(unwind, hops...), nil + if unwind { + if len(args) != 2 { + return nil, fmt.Errorf("expected only 2 arguments, got %d", len(args)) + } + + // Inject empty source portID/channelID. + args = append([]string{"", ""}, args...) + return args, nil + } + + // Unwind false, just ensure we have 4 args. + if len(args) != 4 { + return nil, fmt.Errorf("expected 4 args, got %d", len(args)) + } + + return args, nil } diff --git a/modules/apps/transfer/ibc_module_test.go b/modules/apps/transfer/ibc_module_test.go index 0a22a96e8bd3..266565b66d1f 100644 --- a/modules/apps/transfer/ibc_module_test.go +++ b/modules/apps/transfer/ibc_module_test.go @@ -294,7 +294,7 @@ func (suite *TransferTestSuite) TestOnRecvPacket() { "success", func() {}, channeltypes.NewResultAcknowledgement([]byte{byte(1)}), "", }, { - "success: async aknowledgment with forwarding path", + "success: async acknowledgment with forwarding path", func() { packetData := types.NewFungibleTokenPacketDataV2( []types.Token{ diff --git a/modules/apps/transfer/internal/events/events.go b/modules/apps/transfer/internal/events/events.go index 8a6e103b6f55..4cb70978a9c2 100644 --- a/modules/apps/transfer/internal/events/events.go +++ b/modules/apps/transfer/internal/events/events.go @@ -12,8 +12,15 @@ import ( ) // EmitTransferEvent emits a ibc transfer event on successful transfers. +<<<<<<< HEAD func EmitTransferEvent(ctx context.Context, sender, receiver string, tokens types.Tokens, memo string, forwardingHops []types.Hop) { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC +||||||| 2028e9a34 +func EmitTransferEvent(ctx sdk.Context, sender, receiver string, tokens types.Tokens, memo string, forwardingHops []types.Hop) { +======= +func EmitTransferEvent(ctx context.Context, sender, receiver string, tokens types.Tokens, memo string, forwardingHops []types.Hop) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 +>>>>>>> main tokensStr := mustMarshalJSON(tokens) forwardingHopsStr := mustMarshalJSON(forwardingHops) @@ -51,9 +58,17 @@ func EmitOnRecvPacketEvent(ctx context.Context, packetData types.FungibleTokenPa eventAttributes = append(eventAttributes, sdk.NewAttribute(types.AttributeKeyAckError, ackErr.Error())) } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC sdkCtx.EventManager().EmitEvents(sdk.Events{ +||||||| 2028e9a34 + ctx.EventManager().EmitEvents(sdk.Events{ +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + + sdkCtx.EventManager().EmitEvents(sdk.Events{ +>>>>>>> main sdk.NewEvent( types.EventTypePacket, eventAttributes..., @@ -69,8 +84,16 @@ func EmitOnRecvPacketEvent(ctx context.Context, packetData types.FungibleTokenPa func EmitOnAcknowledgementPacketEvent(ctx context.Context, packetData types.FungibleTokenPacketDataV2, ack channeltypes.Acknowledgement) { tokensStr := mustMarshalJSON(packetData.Tokens) forwardingHopsStr := mustMarshalJSON(packetData.Forwarding.Hops) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC sdkCtx.EventManager().EmitEvents(sdk.Events{ +||||||| 2028e9a34 + + ctx.EventManager().EmitEvents(sdk.Events{ +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + sdkCtx.EventManager().EmitEvents(sdk.Events{ +>>>>>>> main sdk.NewEvent( types.EventTypePacket, sdk.NewAttribute(sdk.AttributeKeySender, packetData.Sender), @@ -105,8 +128,15 @@ func EmitOnAcknowledgementPacketEvent(ctx context.Context, packetData types.Fung } // EmitOnTimeoutEvent emits a fungible token packet event in the OnTimeoutPacket callback +<<<<<<< HEAD func EmitOnTimeoutEvent(ctx context.Context, packetData types.FungibleTokenPacketDataV2) { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC +||||||| 2028e9a34 +func EmitOnTimeoutEvent(ctx sdk.Context, packetData types.FungibleTokenPacketDataV2) { +======= +func EmitOnTimeoutEvent(ctx context.Context, packetData types.FungibleTokenPacketDataV2) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 +>>>>>>> main tokensStr := mustMarshalJSON(packetData.Tokens) forwardingHopsStr := mustMarshalJSON(packetData.Forwarding.Hops) @@ -126,8 +156,15 @@ func EmitOnTimeoutEvent(ctx context.Context, packetData types.FungibleTokenPacke } // EmitDenomEvent emits a denomination event in the OnRecv callback. +<<<<<<< HEAD func EmitDenomEvent(ctx context.Context, token types.Token) { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC +||||||| 2028e9a34 +func EmitDenomEvent(ctx sdk.Context, token types.Token) { +======= +func EmitDenomEvent(ctx context.Context, token types.Token) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 +>>>>>>> main denomStr := mustMarshalJSON(token.Denom) sdkCtx.EventManager().EmitEvent( @@ -139,7 +176,7 @@ func EmitDenomEvent(ctx context.Context, token types.Token) { ) } -// mustMarshalType json marshals the given type and panics on failure. +// mustMarshalJSON json marshals the given type and panics on failure. func mustMarshalJSON(v any) string { bz, err := json.Marshal(v) if err != nil { diff --git a/modules/apps/transfer/keeper/MBT_README.md b/modules/apps/transfer/keeper/MBT_README.md index f967895f3a99..350ff58ef02c 100644 --- a/modules/apps/transfer/keeper/MBT_README.md +++ b/modules/apps/transfer/keeper/MBT_README.md @@ -22,7 +22,7 @@ This is a terminology from the model-checking community; for the testing purpose See the files `counterexample.tla` for human-readable representation, and `counterexample.json` for machine-readable one. In order to execute the produced test, you need to translate it into another format. -For that translation you need the tool [Jsonatr (JSON Arrifact Translator)](https://github.com/informalsystems/jsonatr). +For that translation you need the tool [Jsonatr (JSON Artifact Translator)](https://github.com/informalsystems/jsonatr). It performs the translation using this [transformation spec](relay_model/apalache-to-relay-test2.json); To transform a counterexample into a test, run @@ -35,7 +35,7 @@ Now, if you run `go test` in this directory, the file you have produced above sh and executed automatically. The easiest way to run Apalache is by -[using a Docker image](https://apalache.informal.systems/docs/apalache/installation/docker.html); +[using a Docker image](https://apalache-mc.org/docs/apalache/installation/docker.html); to run Jsonatr you need to locally clone the repository, and then, after building it, add the `target/debug` directory into your `PATH`. diff --git a/modules/apps/transfer/keeper/forwarding.go b/modules/apps/transfer/keeper/forwarding.go index 744c59ac7017..5cbd0cfd53e7 100644 --- a/modules/apps/transfer/keeper/forwarding.go +++ b/modules/apps/transfer/keeper/forwarding.go @@ -47,9 +47,18 @@ func (k Keeper) forwardPacket(ctx context.Context, data types.FungibleTokenPacke } // acknowledgeForwardedPacket writes the async acknowledgement for forwardedPacket +<<<<<<< HEAD func (k Keeper) acknowledgeForwardedPacket(ctx context.Context, forwardedPacket, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC capability, ok := k.scopedKeeper.GetCapability(sdkCtx, host.ChannelCapabilityPath(forwardedPacket.DestinationPort, forwardedPacket.DestinationChannel)) +||||||| 2028e9a34 +func (k Keeper) acknowledgeForwardedPacket(ctx sdk.Context, forwardedPacket, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error { + capability, ok := k.scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(forwardedPacket.DestinationPort, forwardedPacket.DestinationChannel)) +======= +func (k Keeper) acknowledgeForwardedPacket(ctx context.Context, forwardedPacket, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + capability, ok := k.scopedKeeper.GetCapability(sdkCtx, host.ChannelCapabilityPath(forwardedPacket.DestinationPort, forwardedPacket.DestinationChannel)) +>>>>>>> main if !ok { return errorsmod.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability") } diff --git a/modules/apps/transfer/keeper/grpc_query_test.go b/modules/apps/transfer/keeper/grpc_query_test.go index 3b49c468c1fc..866a5b34728e 100644 --- a/modules/apps/transfer/keeper/grpc_query_test.go +++ b/modules/apps/transfer/keeper/grpc_query_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "errors" "fmt" sdkmath "cosmossdk.io/math" @@ -21,7 +22,7 @@ func (suite *KeeperTestSuite) TestQueryDenom() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ { "success: correct ibc denom", @@ -37,7 +38,7 @@ func (suite *KeeperTestSuite) TestQueryDenom() { Hash: expDenom.IBCDenom(), } }, - true, + nil, }, { "success: correct hex hash", @@ -53,7 +54,7 @@ func (suite *KeeperTestSuite) TestQueryDenom() { Hash: expDenom.Hash().String(), } }, - true, + nil, }, { "failure: invalid hash", @@ -62,7 +63,7 @@ func (suite *KeeperTestSuite) TestQueryDenom() { Hash: "!@#!@#!", } }, - false, + errors.New("invalid denom trace hash"), }, { "failure: not found denom trace", @@ -77,7 +78,7 @@ func (suite *KeeperTestSuite) TestQueryDenom() { Hash: expDenom.IBCDenom(), } }, - false, + errors.New("denomination not found"), }, } @@ -91,12 +92,12 @@ func (suite *KeeperTestSuite) TestQueryDenom() { res, err := suite.chainA.GetSimApp().TransferKeeper.Denom(ctx, req) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(&expDenom, res.Denom) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } }) } @@ -111,14 +112,14 @@ func (suite *KeeperTestSuite) TestQueryDenoms() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ { "empty pagination", func() { req = &types.QueryDenomsRequest{} }, - true, + nil, }, { "success", @@ -138,7 +139,7 @@ func (suite *KeeperTestSuite) TestQueryDenoms() { }, } }, - true, + nil, }, } @@ -152,12 +153,12 @@ func (suite *KeeperTestSuite) TestQueryDenoms() { res, err := suite.chainA.GetSimApp().TransferKeeper.Denoms(ctx, req) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(expDenoms.Sort(), res.Denoms) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } }) } @@ -181,16 +182,21 @@ func (suite *KeeperTestSuite) TestQueryDenomHash() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ + { + "success", + func() {}, + nil, + }, { "invalid trace", func() { req = &types.QueryDenomHashRequest{ - Trace: "transfer/channelToA/transfer/", + Trace: "transfer%%/channel-1/transfer/channel-1/uatom", } }, - false, + errors.New("invalid trace"), }, { "not found denom trace", @@ -199,12 +205,7 @@ func (suite *KeeperTestSuite) TestQueryDenomHash() { Trace: "transfer/channelToC/uatom", } }, - false, - }, - { - "success", - func() {}, - true, + errors.New("denomination not found"), }, } @@ -223,12 +224,12 @@ func (suite *KeeperTestSuite) TestQueryDenomHash() { res, err := suite.chainA.GetSimApp().TransferKeeper.DenomHash(ctx, req) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(expHash, res.Hash) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } }) } @@ -241,7 +242,7 @@ func (suite *KeeperTestSuite) TestEscrowAddress() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ { "success", @@ -251,7 +252,7 @@ func (suite *KeeperTestSuite) TestEscrowAddress() { ChannelId: path.EndpointA.ChannelID, } }, - true, + nil, }, { "failure - channel not found", @@ -261,7 +262,7 @@ func (suite *KeeperTestSuite) TestEscrowAddress() { ChannelId: ibctesting.FirstChannelID, } }, - false, + errors.New("channel not found"), }, { "failure - empty channelID", @@ -271,7 +272,7 @@ func (suite *KeeperTestSuite) TestEscrowAddress() { ChannelId: "", } }, - false, + errors.New("identifier cannot be blank"), }, { "failure - empty portID", @@ -281,7 +282,7 @@ func (suite *KeeperTestSuite) TestEscrowAddress() { ChannelId: ibctesting.FirstChannelID, } }, - false, + errors.New("identifier cannot be blank"), }, } @@ -297,12 +298,12 @@ func (suite *KeeperTestSuite) TestEscrowAddress() { res, err := suite.chainA.GetSimApp().TransferKeeper.EscrowAddress(ctx, req) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) expected := types.GetEscrowAddress(ibctesting.TransferPort, path.EndpointA.ChannelID).String() suite.Require().Equal(expected, res.EscrowAddress) } else { - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) } }) } @@ -317,7 +318,7 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { testCases := []struct { msg string malleate func() - expPass bool + expErr error }{ { "valid native denom with escrow amount < 2^63", @@ -329,7 +330,7 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { expEscrowAmount = sdkmath.NewInt(100) suite.chainA.GetSimApp().TransferKeeper.SetTotalEscrowForDenom(suite.chainA.GetContext(), sdk.NewCoin(sdk.DefaultBondDenom, expEscrowAmount)) }, - true, + nil, }, { "valid ibc denom with escrow amount > 2^63", @@ -345,7 +346,7 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { Denom: denom.IBCDenom(), } }, - true, + nil, }, { "valid ibc denom treated as native denom", @@ -356,7 +357,7 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { Denom: denom.IBCDenom(), } }, - true, // denom trace is not found, thus the denom is considered a native token + nil, // denom trace is not found, thus the denom is considered a native token }, { "invalid ibc denom treated as valid native denom", @@ -365,7 +366,7 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { Denom: "ibc/123", } }, - true, // the ibc denom does not contain a valid hash, thus the denom is considered a native token + nil, // the ibc denom does not contain a valid hash, thus the denom is considered a native token }, { "invalid denom", @@ -374,7 +375,7 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { Denom: "??𓃠🐾??", } }, - false, + errors.New("invalid denom"), }, } @@ -389,10 +390,11 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { res, err := suite.chainA.GetSimApp().TransferKeeper.TotalEscrowForDenom(ctx, req) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) suite.Require().Equal(expEscrowAmount, res.Amount.Amount) } else { + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr, err.Error()) suite.Require().Error(err) } }) diff --git a/modules/apps/transfer/keeper/keeper.go b/modules/apps/transfer/keeper/keeper.go index ea6f9aea7140..f955e6c7378b 100644 --- a/modules/apps/transfer/keeper/keeper.go +++ b/modules/apps/transfer/keeper/keeper.go @@ -99,16 +99,34 @@ func (k Keeper) GetAuthority() string { } // Logger returns a module-specific logger. +<<<<<<< HEAD func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"-"+types.ModuleName) +||||||| 2028e9a34 +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+exported.ModuleName+"-"+types.ModuleName) +======= +func (Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"-"+types.ModuleName) +>>>>>>> main } // hasCapability checks if the transfer module owns the port capability for the desired port +<<<<<<< HEAD func (k Keeper) hasCapability(ctx context.Context, portID string) bool { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC _, ok := k.scopedKeeper.GetCapability(sdkCtx, host.PortPath(portID)) +||||||| 2028e9a34 +func (k Keeper) hasCapability(ctx sdk.Context, portID string) bool { + _, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID)) +======= +func (k Keeper) hasCapability(ctx context.Context, portID string) bool { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, ok := k.scopedKeeper.GetCapability(sdkCtx, host.PortPath(portID)) +>>>>>>> main return ok } @@ -130,9 +148,21 @@ func (k Keeper) GetPort(ctx context.Context) string { } // SetPort sets the portID for the transfer module. Used in InitGenesis +<<<<<<< HEAD func (k Keeper) SetPort(ctx context.Context, portID string) { store := k.storeService.OpenKVStore(ctx) store.Set(types.PortKey, []byte(portID)) +||||||| 2028e9a34 +func (k Keeper) SetPort(ctx sdk.Context, portID string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.PortKey, []byte(portID)) +======= +func (k Keeper) SetPort(ctx context.Context, portID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(types.PortKey, []byte(portID)); err != nil { + panic(err) + } +>>>>>>> main } // GetParams returns the current transfer module parameters. @@ -155,7 +185,9 @@ func (k Keeper) GetParams(ctx context.Context) types.Params { func (k Keeper) SetParams(ctx context.Context, params types.Params) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(¶ms) - store.Set([]byte(types.ParamsKey), bz) + if err := store.Set([]byte(types.ParamsKey), bz); err != nil { + panic(err) + } } // GetDenom retrieves the denom from store given the hash of the denom. @@ -268,12 +300,16 @@ func (k Keeper) SetTotalEscrowForDenom(ctx context.Context, coin sdk.Coin) { key := types.TotalEscrowForDenomKey(coin.Denom) if coin.Amount.IsZero() { - store.Delete(key) // delete the key since Cosmos SDK x/bank module will prune any non-zero balances + if err := store.Delete(key); err != nil { // delete the key since Cosmos SDK x/bank module will prune any non-zero balances + panic(err) + } return } bz := k.cdc.MustMarshal(&sdk.IntProto{Int: coin.Amount}) - store.Set(key, bz) + if err := store.Set(key, bz); err != nil { + panic(err) + } } // GetAllTotalEscrowed returns the escrow information for all the denominations. @@ -314,23 +350,43 @@ func (k Keeper) IterateTokensInEscrow(ctx context.Context, storeprefix []byte, c } // AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function +<<<<<<< HEAD func (k Keeper) AuthenticateCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) bool { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return k.scopedKeeper.AuthenticateCapability(sdkCtx, cap, name) +||||||| 2028e9a34 +func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool { + return k.scopedKeeper.AuthenticateCapability(ctx, cap, name) +======= +func (k Keeper) AuthenticateCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) bool { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return k.scopedKeeper.AuthenticateCapability(sdkCtx, cap, name) +>>>>>>> main } // ClaimCapability allows the transfer module that can claim a capability that IBC module // passes to it +<<<<<<< HEAD func (k Keeper) ClaimCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) error { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return k.scopedKeeper.ClaimCapability(sdkCtx, cap, name) +||||||| 2028e9a34 +func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { + return k.scopedKeeper.ClaimCapability(ctx, cap, name) +======= +func (k Keeper) ClaimCapability(ctx context.Context, cap *capabilitytypes.Capability, name string) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return k.scopedKeeper.ClaimCapability(sdkCtx, cap, name) +>>>>>>> main } // setForwardedPacket sets the forwarded packet in the store. func (k Keeper) setForwardedPacket(ctx context.Context, portID, channelID string, sequence uint64, packet channeltypes.Packet) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(&packet) - store.Set(types.PacketForwardKey(portID, channelID, sequence), bz) + if err := store.Set(types.PacketForwardKey(portID, channelID, sequence), bz); err != nil { + panic(err) + } } // getForwardedPacket gets the forwarded packet from the store. @@ -355,7 +411,9 @@ func (k Keeper) deleteForwardedPacket(ctx context.Context, portID, channelID str store := k.storeService.OpenKVStore(ctx) packetKey := types.PacketForwardKey(portID, channelID, sequence) - store.Delete(packetKey) + if err := store.Delete(packetKey); err != nil { + panic(err) + } } // getAllForwardedPackets gets all forward packets stored in state. diff --git a/modules/apps/transfer/keeper/keeper_test.go b/modules/apps/transfer/keeper/keeper_test.go index dc9566bd39f6..b873501396b2 100644 --- a/modules/apps/transfer/keeper/keeper_test.go +++ b/modules/apps/transfer/keeper/keeper_test.go @@ -53,7 +53,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { testCases := []struct { name string instantiateFn func() - expPass bool + panicMsg string }{ {"success", func() { keeper.NewKeeper( @@ -68,7 +68,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.chainA.GetSimApp().ScopedTransferKeeper, suite.chainA.GetSimApp().ICAControllerKeeper.GetAuthority(), ) - }, true}, + }, ""}, {"failure: transfer module account does not exist", func() { keeper.NewKeeper( suite.chainA.GetSimApp().AppCodec(), @@ -82,7 +82,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.chainA.GetSimApp().ScopedTransferKeeper, suite.chainA.GetSimApp().ICAControllerKeeper.GetAuthority(), ) - }, false}, + }, "the IBC transfer module account has not been set"}, {"failure: empty authority", func() { keeper.NewKeeper( suite.chainA.GetSimApp().AppCodec(), @@ -96,7 +96,7 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.chainA.GetSimApp().ScopedTransferKeeper, "", // authority ) - }, false}, + }, "authority must be non-empty"}, } for _, tc := range testCases { @@ -104,12 +104,13 @@ func (suite *KeeperTestSuite) TestNewKeeper() { suite.SetupTest() suite.Run(tc.name, func() { - if tc.expPass { + if tc.panicMsg == "" { suite.Require().NotPanics( tc.instantiateFn, ) } else { - suite.Require().Panics( + suite.Require().PanicsWithError( + tc.panicMsg, tc.instantiateFn, ) } @@ -326,15 +327,15 @@ func (suite *KeeperTestSuite) TestGetAllForwardedPackets() { func (suite *KeeperTestSuite) TestParams() { testCases := []struct { - name string - input types.Params - expPass bool + name string + input types.Params + panicMsg string }{ // it is not possible to set invalid booleans - {"success: set params false-false", types.NewParams(false, false), true}, - {"success: set params false-true", types.NewParams(false, true), true}, - {"success: set params true-false", types.NewParams(true, false), true}, - {"success: set params true-true", types.NewParams(true, true), true}, + {"success: set params false-false", types.NewParams(false, false), ""}, + {"success: set params false-true", types.NewParams(false, true), ""}, + {"success: set params true-false", types.NewParams(true, false), ""}, + {"success: set params true-true", types.NewParams(true, true), ""}, } for _, tc := range testCases { @@ -343,13 +344,13 @@ func (suite *KeeperTestSuite) TestParams() { suite.Run(tc.name, func() { suite.SetupTest() // reset ctx := suite.chainA.GetContext() - if tc.expPass { + if tc.panicMsg == "" { suite.chainA.GetSimApp().TransferKeeper.SetParams(ctx, tc.input) expected := tc.input p := suite.chainA.GetSimApp().TransferKeeper.GetParams(ctx) suite.Require().Equal(expected, p) } else { - suite.Require().Panics(func() { + suite.Require().PanicsWithError(tc.panicMsg, func() { suite.chainA.GetSimApp().TransferKeeper.SetParams(ctx, tc.input) }) } diff --git a/modules/apps/transfer/keeper/msg_server_test.go b/modules/apps/transfer/keeper/msg_server_test.go index 793137e78438..0fb434b08fbc 100644 --- a/modules/apps/transfer/keeper/msg_server_test.go +++ b/modules/apps/transfer/keeper/msg_server_test.go @@ -201,34 +201,34 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { func (suite *KeeperTestSuite) TestUpdateParams() { signer := suite.chainA.GetSimApp().TransferKeeper.GetAuthority() testCases := []struct { - name string - msg *types.MsgUpdateParams - expPass bool + name string + msg *types.MsgUpdateParams + expErr error }{ { "success: valid signer and default params", types.NewMsgUpdateParams(signer, types.DefaultParams()), - true, + nil, }, { "failure: malformed signer address", types.NewMsgUpdateParams(ibctesting.InvalidID, types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, { "failure: empty signer address", types.NewMsgUpdateParams("", types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, { "failure: whitespace signer address", types.NewMsgUpdateParams(" ", types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, { "failure: unauthorized signer address", types.NewMsgUpdateParams(ibctesting.TestAccAddress, types.DefaultParams()), - false, + ibcerrors.ErrUnauthorized, }, } @@ -237,10 +237,10 @@ func (suite *KeeperTestSuite) TestUpdateParams() { suite.Run(tc.name, func() { suite.SetupTest() _, err := suite.chainA.GetSimApp().TransferKeeper.UpdateParams(suite.chainA.GetContext(), tc.msg) - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } diff --git a/modules/apps/transfer/keeper/relay_forwarding_test.go b/modules/apps/transfer/keeper/relay_forwarding_test.go index 8e54eac8f6ee..452cea3f5975 100644 --- a/modules/apps/transfer/keeper/relay_forwarding_test.go +++ b/modules/apps/transfer/keeper/relay_forwarding_test.go @@ -600,6 +600,137 @@ func (suite *ForwardingTestSuite) TestSuccessfulUnwind() { suite.assertAmountOnChain(suite.chainA, balance, originalABalance.Amount.Add(amount), denomA.IBCDenom()) } +// TestForwardingBackAfterUnwind tests the scenario where tokens are unwound and then forwarded +// back to the sending chain. +func (suite *ForwardingTestSuite) TestForwardingBackAfterUnwind() { + /* + Given the following topology: + chain A (channel 0) -> (channel-0) chain B (channel-0) + stake transfer/channel-0/stake + We want to trigger: + 1. A sends to B over channel-0. + 2. B receives and transfers back to A over channel-0 with unwind set to true. + 3. A receives the packet back. + 4. A sends back to B over channel-0. + At this point we want to assert: + A: finalReceiver = amount,transfer/channel-0/denom + B: no tokens should be held in escrow. + */ + amount := sdkmath.NewInt(100) + pathAtoB, _ := suite.setupForwardingPaths() + + accountA := suite.chainA.SenderAccount + accountB := suite.chainB.SenderAccount + + denomA := types.NewDenom(sdk.DefaultBondDenom) + denomAB := types.NewDenom(sdk.DefaultBondDenom, types.NewHop(pathAtoB.EndpointB.ChannelConfig.PortID, pathAtoB.EndpointB.ChannelID)) + + // Send tokens from A to B + coin := ibctesting.TestCoin + transferMsg := types.NewMsgTransfer( + pathAtoB.EndpointA.ChannelConfig.PortID, + pathAtoB.EndpointA.ChannelID, + sdk.NewCoins(coin), + accountA.GetAddress().String(), + accountB.GetAddress().String(), + clienttypes.ZeroHeight(), + suite.chainA.GetTimeoutTimestamp(), "", + nil, + ) + + result, err := suite.chainA.SendMsgs(transferMsg) + suite.Require().NoError(err) // message committed + + // parse the packet from result events and recv packet on chainA + packetFromAtoB, err := ibctesting.ParsePacketFromEvents(result.Events) + suite.Require().NoError(err) + suite.Require().NotNil(packetFromAtoB) + + err = pathAtoB.EndpointB.UpdateClient() + suite.Require().NoError(err) + + result, err = pathAtoB.EndpointB.RecvPacketWithResult(packetFromAtoB) + suite.Require().NoError(err) + suite.Require().NotNil(result) + + // Check that vouchers are received on chain B + suite.assertAmountOnChain(suite.chainB, balance, amount, denomAB.IBCDenom()) + + // Unwind tokens back from B to A + coinOnB := sdk.NewCoin(denomAB.IBCDenom(), amount) + forwarding := types.NewForwarding(true, types.NewHop( + pathAtoB.EndpointA.ChannelConfig.PortID, + pathAtoB.EndpointA.ChannelID, + )) + + transferMsg = types.NewMsgTransfer( + "", + "", + sdk.NewCoins(coinOnB), + accountB.GetAddress().String(), + accountB.GetAddress().String(), + clienttypes.ZeroHeight(), + suite.chainB.GetTimeoutTimestamp(), "", + forwarding, + ) + + result, err = suite.chainB.SendMsgs(transferMsg) + suite.Require().NoError(err) // message committed + + suite.assertAmountOnChain(suite.chainB, balance, sdkmath.NewInt(0), denomAB.IBCDenom()) + + // parse the packet from result events and recv packet on chainA + packetFromBtoA, err := ibctesting.ParsePacketFromEvents(result.Events) + suite.Require().NoError(err) + suite.Require().NotNil(packetFromBtoA) + + err = pathAtoB.EndpointA.UpdateClient() + suite.Require().NoError(err) + + result, err = pathAtoB.EndpointA.RecvPacketWithResult(packetFromBtoA) + suite.Require().NoError(err) + suite.Require().NotNil(result) + + // Check that Escrow A has 100 + suite.assertAmountOnChain(suite.chainA, escrow, sdkmath.NewInt(100), denomA.IBCDenom()) + + // parse the packet from result events and recv packet on chainB + packetFromAtoB, err = ibctesting.ParsePacketFromEvents(result.Events) + suite.Require().NoError(err) + suite.Require().NotNil(packetFromAtoB) + + err = pathAtoB.EndpointB.UpdateClient() + suite.Require().NoError(err) + + result, err = pathAtoB.EndpointB.RecvPacketWithResult(packetFromAtoB) + suite.Require().NoError(err) + suite.Require().NotNil(result) + + // Check that Escrow A has 100 + suite.assertAmountOnChain(suite.chainA, escrow, amount, denomA.IBCDenom()) + // Check that vouchers are back on chain B + suite.assertAmountOnChain(suite.chainB, balance, amount, denomAB.IBCDenom()) + + successAck := channeltypes.NewResultAcknowledgement([]byte{byte(1)}) + successAckBz := channeltypes.CommitAcknowledgement(successAck.Acknowledgement()) + ackOnB := suite.chainB.GetAcknowledgement(packetFromAtoB) + suite.Require().Equal(successAckBz, ackOnB) + + // Ack back to A + err = pathAtoB.EndpointA.UpdateClient() + suite.Require().NoError(err) + + err = pathAtoB.EndpointA.AcknowledgePacket(packetFromAtoB, successAck.Acknowledgement()) + suite.Require().NoError(err) + + // Ack back to B + err = pathAtoB.EndpointB.UpdateClient() + suite.Require().NoError(err) + + err = pathAtoB.EndpointB.AcknowledgePacket(packetFromBtoA, successAck.Acknowledgement()) + suite.Require().NoError(err) +} + // TestAcknowledgementFailureWithMiddleChainAsNativeTokenSource tests a failure in the last hop where the // middle chain is native source when receiving and sending the packet. In other words, the middle chain's native // token has been sent to chain C, and the multi-hop transfer from C -> B -> A has chain B being the source of diff --git a/modules/apps/transfer/types/codec_test.go b/modules/apps/transfer/types/codec_test.go index 6be95087a9b8..591282526b76 100644 --- a/modules/apps/transfer/types/codec_test.go +++ b/modules/apps/transfer/types/codec_test.go @@ -1,6 +1,7 @@ package types_test import ( + "errors" "strings" sdk "github.com/cosmos/cosmos-sdk/types" @@ -8,6 +9,7 @@ import ( "github.com/cosmos/ibc-go/v9/modules/apps/transfer" "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types" + ibctesting "github.com/cosmos/ibc-go/v9/testing" ) // TestMustMarshalProtoJSON tests that the memo field is only emitted (marshalled) if it is populated @@ -30,27 +32,27 @@ func (suite *TypesTestSuite) TestCodecTypeRegistration() { testCases := []struct { name string typeURL string - expPass bool + expErr error }{ { "success: MsgTransfer", sdk.MsgTypeURL(&types.MsgTransfer{}), - true, + nil, }, { "success: MsgUpdateParams", sdk.MsgTypeURL(&types.MsgUpdateParams{}), - true, + nil, }, { "success: TransferAuthorization", sdk.MsgTypeURL(&types.TransferAuthorization{}), - true, + nil, }, { "type not registered on codec", "ibc.invalid.MsgTypeURL", - false, + errors.New("unable to resolve type URL"), }, } @@ -61,12 +63,12 @@ func (suite *TypesTestSuite) TestCodecTypeRegistration() { encodingCfg := moduletestutil.MakeTestEncodingConfig(transfer.AppModuleBasic{}) msg, err := encodingCfg.Codec.InterfaceRegistry().Resolve(tc.typeURL) - if tc.expPass { + if tc.expErr == nil { suite.Require().NotNil(msg) suite.Require().NoError(err) } else { suite.Require().Nil(msg) - suite.Require().Error(err) + ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expErr) } }) } diff --git a/modules/apps/transfer/types/forwarding_test.go b/modules/apps/transfer/types/forwarding_test.go index 2378199d32a5..e7dce4814e82 100644 --- a/modules/apps/transfer/types/forwarding_test.go +++ b/modules/apps/transfer/types/forwarding_test.go @@ -86,6 +86,11 @@ func TestForwarding_Validate(t *testing.T) { ), types.ErrInvalidForwarding, }, + { + "unwind with hop forwarding back to itself", + types.NewForwarding(true, types.NewHop(types.PortID, types.PortID)), + nil, + }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { diff --git a/modules/apps/transfer/types/genesis_test.go b/modules/apps/transfer/types/genesis_test.go index bd9acc7c9ffc..b86f337ee4a8 100644 --- a/modules/apps/transfer/types/genesis_test.go +++ b/modules/apps/transfer/types/genesis_test.go @@ -6,42 +6,43 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ) func TestValidateGenesis(t *testing.T) { testCases := []struct { name string genState *types.GenesisState - expPass bool + expErr error }{ { name: "default", genState: types.DefaultGenesisState(), - expPass: true, + expErr: nil, }, { "valid genesis", &types.GenesisState{ PortId: "portidone", }, - true, + nil, }, { "invalid client", &types.GenesisState{ PortId: "(INVALIDPORT)", }, - false, + host.ErrInvalidID, }, } for _, tc := range testCases { tc := tc err := tc.genState.Validate() - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err, tc.name) } else { - require.Error(t, err, tc.name) + require.ErrorIs(t, err, tc.expErr, tc.name) } } } diff --git a/modules/apps/transfer/types/msgs_test.go b/modules/apps/transfer/types/msgs_test.go index 625202e1816d..f630b041d4b0 100644 --- a/modules/apps/transfer/types/msgs_test.go +++ b/modules/apps/transfer/types/msgs_test.go @@ -148,10 +148,10 @@ func TestMsgUpdateParamsGetSigners(t *testing.T) { testCases := []struct { name string address sdk.AccAddress - expPass bool + errMsg string }{ - {"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), true}, - {"failure: nil address", nil, false}, + {"success: valid address", sdk.AccAddress(ibctesting.TestAccAddress), ""}, + {"failure: nil address", nil, "empty address string is not allowed"}, } for _, tc := range testCases { @@ -164,11 +164,11 @@ func TestMsgUpdateParamsGetSigners(t *testing.T) { encodingCfg := moduletestutil.MakeTestEncodingConfig(transfer.AppModuleBasic{}) signers, _, err := encodingCfg.Codec.GetMsgV1Signers(&msg) - if tc.expPass { + if tc.errMsg == "" { require.NoError(t, err) require.Equal(t, tc.address.Bytes(), signers[0]) } else { - require.Error(t, err) + require.ErrorContains(t, err, tc.errMsg) } }) } diff --git a/modules/apps/transfer/types/packet_test.go b/modules/apps/transfer/types/packet_test.go index ff26a3188fe4..254cec03522c 100644 --- a/modules/apps/transfer/types/packet_test.go +++ b/modules/apps/transfer/types/packet_test.go @@ -10,6 +10,7 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -26,29 +27,29 @@ func TestFungibleTokenPacketDataValidateBasic(t *testing.T) { testCases := []struct { name string packetData types.FungibleTokenPacketData - expPass bool + expErr error }{ - {"valid packet", types.NewFungibleTokenPacketData(denom, amount, sender, receiver, ""), true}, - {"valid packet with memo", types.NewFungibleTokenPacketData(denom, amount, sender, receiver, "memo"), true}, - {"valid packet with large amount", types.NewFungibleTokenPacketData(denom, largeAmount, sender, receiver, ""), true}, - {"invalid denom", types.NewFungibleTokenPacketData("", amount, sender, receiver, ""), false}, - {"invalid denom, invalid portID", types.NewFungibleTokenPacketData("(tranfer)/channel-1/uatom", amount, sender, receiver, ""), false}, - {"invalid empty amount", types.NewFungibleTokenPacketData(denom, "", sender, receiver, ""), false}, - {"invalid zero amount", types.NewFungibleTokenPacketData(denom, "0", sender, receiver, ""), false}, - {"invalid negative amount", types.NewFungibleTokenPacketData(denom, "-1", sender, receiver, ""), false}, - {"invalid large amount", types.NewFungibleTokenPacketData(denom, invalidLargeAmount, sender, receiver, ""), false}, - {"missing sender address", types.NewFungibleTokenPacketData(denom, amount, emptyAddr, receiver, ""), false}, - {"missing recipient address", types.NewFungibleTokenPacketData(denom, amount, sender, emptyAddr, ""), false}, + {"valid packet", types.NewFungibleTokenPacketData(denom, amount, sender, receiver, ""), nil}, + {"valid packet with memo", types.NewFungibleTokenPacketData(denom, amount, sender, receiver, "memo"), nil}, + {"valid packet with large amount", types.NewFungibleTokenPacketData(denom, largeAmount, sender, receiver, ""), nil}, + {"invalid denom", types.NewFungibleTokenPacketData("", amount, sender, receiver, ""), types.ErrInvalidDenomForTransfer}, + {"invalid denom, invalid portID", types.NewFungibleTokenPacketData("(tranfer)/channel-1/uatom", amount, sender, receiver, ""), host.ErrInvalidID}, + {"invalid empty amount", types.NewFungibleTokenPacketData(denom, "", sender, receiver, ""), types.ErrInvalidAmount}, + {"invalid zero amount", types.NewFungibleTokenPacketData(denom, "0", sender, receiver, ""), types.ErrInvalidAmount}, + {"invalid negative amount", types.NewFungibleTokenPacketData(denom, "-1", sender, receiver, ""), types.ErrInvalidAmount}, + {"invalid large amount", types.NewFungibleTokenPacketData(denom, invalidLargeAmount, sender, receiver, ""), types.ErrInvalidAmount}, + {"missing sender address", types.NewFungibleTokenPacketData(denom, amount, emptyAddr, receiver, ""), ibcerrors.ErrInvalidAddress}, + {"missing recipient address", types.NewFungibleTokenPacketData(denom, amount, sender, emptyAddr, ""), ibcerrors.ErrInvalidAddress}, } for i, tc := range testCases { tc := tc err := tc.packetData.ValidateBasic() - if tc.expPass { + if tc.expErr == nil { require.NoError(t, err, "valid test case %d failed: %v", i, err) } else { - require.Error(t, err, "invalid test case %d passed: %s", i, tc.name) + require.ErrorIs(t, err, tc.expErr, "invalid test case %d passed: %s", i, tc.name) } } } @@ -165,7 +166,7 @@ func (suite *TypesTestSuite) TestFungibleTokenPacketDataOmitEmpty() { suite.Require().Contains(string(bz), "memo") } -// TestFungibleTokenPacketDataValidateBasic tests ValidateBasic for FungibleTokenPacketData +// TestFungibleTokenPacketDataV2ValidateBasic tests ValidateBasic for FungibleTokenPacketData func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { testCases := []struct { name string diff --git a/modules/apps/transfer/types/transfer_authorization.go b/modules/apps/transfer/types/transfer_authorization.go index 6e166fe63b96..81a19b0b3843 100644 --- a/modules/apps/transfer/types/transfer_authorization.go +++ b/modules/apps/transfer/types/transfer_authorization.go @@ -123,7 +123,7 @@ func (a TransferAuthorization) ValidateBasic() error { } if err := allocation.SpendLimit.Validate(); err != nil { - return errorsmod.Wrapf(ibcerrors.ErrInvalidCoins, err.Error()) + return errorsmod.Wrapf(ibcerrors.ErrInvalidCoins, "invalid spend limit: %s", err.Error()) } if err := host.PortIdentifierValidator(allocation.SourcePort); err != nil { diff --git a/modules/apps/transfer/types/transfer_authorization_test.go b/modules/apps/transfer/types/transfer_authorization_test.go index 678c42247f39..a02bc51a2f41 100644 --- a/modules/apps/transfer/types/transfer_authorization_test.go +++ b/modules/apps/transfer/types/transfer_authorization_test.go @@ -9,6 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" "github.com/cosmos/ibc-go/v9/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" "github.com/cosmos/ibc-go/v9/testing/mock" @@ -530,19 +532,19 @@ func (suite *TypesTestSuite) TestTransferAuthorizationValidateBasic() { testCases := []struct { name string malleate func() - expPass bool + expErr error }{ { "success", func() {}, - true, + nil, }, { "success: empty allow list", func() { transferAuthz.Allocations[0].AllowList = []string{} }, - true, + nil, }, { "success: with multiple allocations", @@ -556,21 +558,21 @@ func (suite *TypesTestSuite) TestTransferAuthorizationValidateBasic() { transferAuthz.Allocations = append(transferAuthz.Allocations, allocation) }, - true, + nil, }, { "success: with unlimited spend limit of max uint256", func() { transferAuthz.Allocations[0].SpendLimit = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, types.UnboundedSpendLimit())) }, - true, + nil, }, { "success: wildcard allowed packet data", func() { transferAuthz.Allocations[0].AllowedPacketData = []string{"*"} }, - true, + nil, }, { "success: with allowed forwarding hops", @@ -580,56 +582,56 @@ func (suite *TypesTestSuite) TestTransferAuthorizationValidateBasic() { {Hops: []types.Hop{types.NewHop(types.PortID, "channel-1")}}, } }, - true, + nil, }, { "empty allocations", func() { transferAuthz = types.TransferAuthorization{Allocations: []types.Allocation{}} }, - false, + types.ErrInvalidAuthorization, }, { "nil allocations", func() { transferAuthz = types.TransferAuthorization{} }, - false, + types.ErrInvalidAuthorization, }, { "nil spend limit coins", func() { transferAuthz.Allocations[0].SpendLimit = nil }, - false, + ibcerrors.ErrInvalidCoins, }, { "invalid spend limit coins", func() { transferAuthz.Allocations[0].SpendLimit = sdk.Coins{sdk.Coin{Denom: ""}} }, - false, + ibcerrors.ErrInvalidCoins, }, { "duplicate entry in allow list", func() { transferAuthz.Allocations[0].AllowList = []string{ibctesting.TestAccAddress, ibctesting.TestAccAddress} }, - false, + types.ErrInvalidAuthorization, }, { "invalid port identifier", func() { transferAuthz.Allocations[0].SourcePort = "" }, - false, + host.ErrInvalidID, }, { "invalid channel identifier", func() { transferAuthz.Allocations[0].SourceChannel = "" }, - false, + host.ErrInvalidID, }, { "duplicate channel ID", @@ -643,27 +645,27 @@ func (suite *TypesTestSuite) TestTransferAuthorizationValidateBasic() { transferAuthz.Allocations = append(transferAuthz.Allocations, allocation) }, - false, + channeltypes.ErrInvalidChannel, }, { - "fowarding hop with invalid port ID", + "forwarding hop with invalid port ID", func() { transferAuthz.Allocations[0].AllowedForwarding = []types.AllowedForwarding{ {Hops: []types.Hop{validHop}}, {Hops: []types.Hop{types.NewHop("invalid/port", ibctesting.FirstChannelID)}}, } }, - false, + host.ErrInvalidID, }, { - "fowarding hop with invalid channel ID", + "forwarding hop with invalid channel ID", func() { transferAuthz.Allocations[0].AllowedForwarding = []types.AllowedForwarding{ {Hops: []types.Hop{validHop}}, {Hops: []types.Hop{types.NewHop(types.PortID, "invalid/channel")}}, } }, - false, + host.ErrInvalidID, }, } @@ -686,10 +688,10 @@ func (suite *TypesTestSuite) TestTransferAuthorizationValidateBasic() { err := transferAuthz.ValidateBasic() - if tc.expPass { + if tc.expErr == nil { suite.Require().NoError(err) } else { - suite.Require().Error(err) + suite.Require().ErrorIs(err, tc.expErr) } }) } diff --git a/modules/capability/CHANGELOG.md b/modules/capability/CHANGELOG.md index 3f99cc7d5694..52e267fb93c0 100644 --- a/modules/capability/CHANGELOG.md +++ b/modules/capability/CHANGELOG.md @@ -31,7 +31,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies -* [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump Cosmos SDK to v0.50.6. +* [\#6828](https://github.com/cosmos/ibc-go/pull/6828) Bump Cosmos SDK to v0.50.9. * [\#6193](https://github.com/cosmos/ibc-go/pull/6193) Bump `cosmossdk.io/store` to v1.1.0. * [\#6848](https://github.com/cosmos/ibc-go/pull/6848) Bump CometBFT to v0.38.10. diff --git a/modules/capability/go.mod b/modules/capability/go.mod index 8fb9313c185b..156bb0bd63fd 100644 --- a/modules/capability/go.mod +++ b/modules/capability/go.mod @@ -9,13 +9,27 @@ replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.2021 require ( cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 +<<<<<<< HEAD cosmossdk.io/log v1.4.0 +||||||| 2028e9a34 + cosmossdk.io/log v1.3.1 +======= + cosmossdk.io/log v1.4.1 +>>>>>>> main cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 - github.com/cometbft/cometbft v0.38.10 + github.com/cometbft/cometbft v0.38.11 github.com/cosmos/cosmos-db v1.0.2 +<<<<<<< HEAD github.com/cosmos/cosmos-sdk v0.50.10-0.20240808075341-156231be8aef github.com/cosmos/gogoproto v1.5.0 +||||||| 2028e9a34 + github.com/cosmos/cosmos-sdk v0.50.7 + github.com/cosmos/gogoproto v1.5.0 +======= + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/cosmos/gogoproto v1.6.0 +>>>>>>> main github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 sigs.k8s.io/yaml v1.4.0 @@ -148,9 +162,19 @@ require ( golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.7.0 // indirect +<<<<<<< HEAD golang.org/x/sys v0.23.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect +||||||| 2028e9a34 + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect + golang.org/x/text v0.14.0 // indirect +======= + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect +>>>>>>> main google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect diff --git a/modules/capability/go.sum b/modules/capability/go.sum index 945459b31225..9992906d34c1 100644 --- a/modules/capability/go.sum +++ b/modules/capability/go.sum @@ -10,8 +10,16 @@ cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +<<<<<<< HEAD cosmossdk.io/log v1.4.0 h1:Ttt9d6fQ0GlktwhcysOeNiIjixW7l0rYBocmoXOb11k= cosmossdk.io/log v1.4.0/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= +||||||| 2028e9a34 +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +======= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= +>>>>>>> main cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= @@ -122,8 +130,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= -github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -140,15 +148,23 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +<<<<<<< HEAD github.com/cosmos/cosmos-sdk v0.50.10-0.20240808075341-156231be8aef h1:us0dw4egT2k00jnK4JgQ2Su6yJlBnwCfgWnKC7MIwqk= github.com/cosmos/cosmos-sdk v0.50.10-0.20240808075341-156231be8aef/go.mod h1:9l85MGxnejiuiY4gum/RzdRKfkmLZDJh5uOD3m1zxy0= +||||||| 2028e9a34 +github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= +github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= +======= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= +>>>>>>> main github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.6.0 h1:Xm0F/96O5Ox4g6xGgjA41rWaaPjYtOdTi59uBcV2qEE= +github.com/cosmos/gogoproto v1.6.0/go.mod h1:Y+g956rcUf2vr4uwtCcK/1Xx9BWVluCtcI9vsh0GHmk= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -869,8 +885,16 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +<<<<<<< HEAD golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +||||||| 2028e9a34 +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +======= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +>>>>>>> main golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= diff --git a/modules/core/02-client/keeper/keeper.go b/modules/core/02-client/keeper/keeper.go index 6b3a618a021b..760988f66aef 100644 --- a/modules/core/02-client/keeper/keeper.go +++ b/modules/core/02-client/keeper/keeper.go @@ -6,7 +6,12 @@ import ( "fmt" "strings" +<<<<<<< HEAD corestoretypes "cosmossdk.io/core/store" +||||||| 2028e9a34 +======= + corestore "cosmossdk.io/core/store" +>>>>>>> main errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" "cosmossdk.io/store/prefix" @@ -27,7 +32,13 @@ import ( // Keeper represents a type that grants read and write permissions to any client // state information type Keeper struct { +<<<<<<< HEAD storeService corestoretypes.KVStoreService +||||||| 2028e9a34 + storeKey storetypes.StoreKey +======= + storeService corestore.KVStoreService +>>>>>>> main cdc codec.BinaryCodec router *types.Router legacySubspace types.ParamSubspace @@ -35,7 +46,13 @@ type Keeper struct { } // NewKeeper creates a new NewKeeper instance +<<<<<<< HEAD func NewKeeper(cdc codec.BinaryCodec, storeService corestoretypes.KVStoreService, legacySubspace types.ParamSubspace, uk types.UpgradeKeeper) *Keeper { +||||||| 2028e9a34 +func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, legacySubspace types.ParamSubspace, uk types.UpgradeKeeper) *Keeper { +======= +func NewKeeper(cdc codec.BinaryCodec, storeService corestore.KVStoreService, legacySubspace types.ParamSubspace, uk types.UpgradeKeeper) *Keeper { +>>>>>>> main router := types.NewRouter() localhostModule := localhost.NewLightClientModule(cdc, storeService) router.AddRoute(exported.Localhost, localhostModule) @@ -55,9 +72,18 @@ func (k *Keeper) Codec() codec.BinaryCodec { } // Logger returns a module-specific logger. +<<<<<<< HEAD func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: remove after sdk.Context is removed from core IBC return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +||||||| 2028e9a34 +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +======= +func (Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +>>>>>>> main } // AddRoute adds a new route to the underlying router. @@ -157,7 +183,9 @@ func (k *Keeper) GetNextClientSequence(ctx context.Context) uint64 { func (k *Keeper) SetNextClientSequence(ctx context.Context, sequence uint64) { store := k.storeService.OpenKVStore(ctx) bz := sdk.Uint64ToBigEndian(sequence) - store.Set([]byte(types.KeyNextClientSequence), bz) + if err := store.Set([]byte(types.KeyNextClientSequence), bz); err != nil { + panic(err) + } } // IterateConsensusStates provides an iterator over all stored consensus states. @@ -432,10 +460,25 @@ func (k *Keeper) GetClientTimestampAtHeight(ctx context.Context, clientID string } // GetParams returns the total set of ibc-client parameters. +<<<<<<< HEAD func (k *Keeper) GetParams(ctx context.Context) types.Params { store := k.storeService.OpenKVStore(ctx) bz, _ := store.Get([]byte(types.ParamsKey)) // TODO: handle error if bz == nil { // only panic on unset params and not on empty params +||||||| 2028e9a34 +func (k *Keeper) GetParams(ctx sdk.Context) types.Params { + store := ctx.KVStore(k.storeKey) + bz := store.Get([]byte(types.ParamsKey)) + if bz == nil { // only panic on unset params and not on empty params +======= +func (k *Keeper) GetParams(ctx context.Context) types.Params { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get([]byte(types.ParamsKey)) + if err != nil { + panic(err) + } + if bz == nil { // only panic on unset params and not on empty params +>>>>>>> main panic(errors.New("client params are not set in store")) } @@ -448,7 +491,9 @@ func (k *Keeper) GetParams(ctx context.Context) types.Params { func (k *Keeper) SetParams(ctx context.Context, params types.Params) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(¶ms) - store.Set([]byte(types.ParamsKey), bz) + if err := store.Set([]byte(types.ParamsKey), bz); err != nil { + panic(err) + } } // ScheduleIBCSoftwareUpgrade schedules an upgrade for the IBC client. @@ -476,8 +521,15 @@ func (k *Keeper) ScheduleIBCSoftwareUpgrade(ctx context.Context, plan upgradetyp } // emitting an event for scheduling an upgrade plan +<<<<<<< HEAD sdkContext := sdk.UnwrapSDKContext(ctx) // TODO: remove after sdk.Context is removed from core IBC emitScheduleIBCSoftwareUpgradeEvent(sdkContext, plan.Name, plan.Height) +||||||| 2028e9a34 + emitScheduleIBCSoftwareUpgradeEvent(ctx, plan.Name, plan.Height) +======= + sdkContext := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + emitScheduleIBCSoftwareUpgradeEvent(sdkContext, plan.Name, plan.Height) +>>>>>>> main return nil } diff --git a/modules/core/02-client/migrations/v7/store.go b/modules/core/02-client/migrations/v7/store.go index 0885b343f2fa..210318dda192 100644 --- a/modules/core/02-client/migrations/v7/store.go +++ b/modules/core/02-client/migrations/v7/store.go @@ -3,6 +3,7 @@ package v7 import ( "strings" + corestore "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" diff --git a/modules/core/02-client/types/height.go b/modules/core/02-client/types/height.go index 0d21426a17fa..c46f6d47dc56 100644 --- a/modules/core/02-client/types/height.go +++ b/modules/core/02-client/types/height.go @@ -186,8 +186,19 @@ func ParseChainID(chainID string) uint64 { // GetSelfHeight is a utility function that returns self height given context // Revision number is retrieved from ctx.ChainID() +<<<<<<< HEAD func GetSelfHeight(ctx context.Context) Height { sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: remove after sdk.Context is removed from core IBC revision := ParseChainID(sdkCtx.ChainID()) return NewHeight(revision, uint64(sdkCtx.BlockHeight())) +||||||| 2028e9a34 +func GetSelfHeight(ctx sdk.Context) Height { + revision := ParseChainID(ctx.ChainID()) + return NewHeight(revision, uint64(ctx.BlockHeight())) +======= +func GetSelfHeight(ctx context.Context) Height { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + revision := ParseChainID(sdkCtx.ChainID()) + return NewHeight(revision, uint64(sdkCtx.BlockHeight())) +>>>>>>> main } diff --git a/modules/core/02-client/types/router_test.go b/modules/core/02-client/types/router_test.go index fd3100660edb..c23de14b7909 100644 --- a/modules/core/02-client/types/router_test.go +++ b/modules/core/02-client/types/router_test.go @@ -6,7 +6,13 @@ import ( "github.com/stretchr/testify/require" +<<<<<<< HEAD "github.com/cosmos/cosmos-sdk/runtime" +||||||| 2028e9a34 +======= + "github.com/cosmos/cosmos-sdk/runtime" + +>>>>>>> main "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" "github.com/cosmos/ibc-go/v9/modules/core/exported" ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint" diff --git a/modules/core/02-client/types/store.go b/modules/core/02-client/types/store.go index 721e496be207..ab9e0b6a442c 100644 --- a/modules/core/02-client/types/store.go +++ b/modules/core/02-client/types/store.go @@ -8,19 +8,39 @@ import ( "cosmossdk.io/store/prefix" storetypes "cosmossdk.io/store/types" +<<<<<<< HEAD "github.com/cosmos/cosmos-sdk/runtime" +||||||| 2028e9a34 + sdk "github.com/cosmos/cosmos-sdk/types" + +======= + "github.com/cosmos/cosmos-sdk/runtime" + +>>>>>>> main host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ) -// StoreProvider encapsulates the IBC core store key and offers convenience methods for LightClientModules. +// StoreProvider encapsulates the IBC core store service and offers convenience methods for LightClientModules. type StoreProvider struct { storeService corestore.KVStoreService } // NewStoreProvider creates and returns a new client StoreProvider. +<<<<<<< HEAD func NewStoreProvider(storeKey corestore.KVStoreService) StoreProvider { +||||||| 2028e9a34 +func NewStoreProvider(storeKey storetypes.StoreKey) StoreProvider { +======= +func NewStoreProvider(storeService corestore.KVStoreService) StoreProvider { +>>>>>>> main return StoreProvider{ +<<<<<<< HEAD storeService: storeKey, +||||||| 2028e9a34 + storeKey: storeKey, +======= + storeService: storeService, +>>>>>>> main } } diff --git a/modules/core/03-connection/keeper/keeper.go b/modules/core/03-connection/keeper/keeper.go index 937f6bea4cdc..72d87768367d 100644 --- a/modules/core/03-connection/keeper/keeper.go +++ b/modules/core/03-connection/keeper/keeper.go @@ -42,15 +42,32 @@ func NewKeeper(cdc codec.BinaryCodec, storeService corestore.KVStoreService, leg } // Logger returns a module-specific logger. +<<<<<<< HEAD func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when sdk.Context is removed return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +||||||| 2028e9a34 +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +======= +func (Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +>>>>>>> main } // GetCommitmentPrefix returns the IBC connection store prefix as a commitment // Prefix +<<<<<<< HEAD func (k *Keeper) GetCommitmentPrefix() exported.Prefix { return commitmenttypes.NewMerklePrefix([]byte("ibc")) // TODO: import store key directly +||||||| 2028e9a34 +func (k *Keeper) GetCommitmentPrefix() exported.Prefix { + return commitmenttypes.NewMerklePrefix([]byte(k.storeKey.Name())) +======= +func (*Keeper) GetCommitmentPrefix() exported.Prefix { + return commitmenttypes.NewMerklePrefix([]byte(exported.StoreKey)) +>>>>>>> main } // GenerateConnectionIdentifier returns the next connection identifier. @@ -64,12 +81,26 @@ func (k *Keeper) GenerateConnectionIdentifier(ctx context.Context) string { } // GetConnection returns a connection with a particular identifier +<<<<<<< HEAD func (k *Keeper) GetConnection(ctx context.Context, connectionID string) (types.ConnectionEnd, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.ConnectionKey(connectionID)) if err != nil { return types.ConnectionEnd{}, false } +||||||| 2028e9a34 +func (k *Keeper) GetConnection(ctx sdk.Context, connectionID string) (types.ConnectionEnd, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.ConnectionKey(connectionID)) +======= +func (k *Keeper) GetConnection(ctx context.Context, connectionID string) (types.ConnectionEnd, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.ConnectionKey(connectionID)) + if err != nil { + panic(err) + } + +>>>>>>> main if len(bz) == 0 { return types.ConnectionEnd{}, false } @@ -95,17 +126,33 @@ func (k *Keeper) HasConnection(ctx context.Context, connectionID string) bool { func (k *Keeper) SetConnection(ctx context.Context, connectionID string, connection types.ConnectionEnd) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(&connection) - store.Set(host.ConnectionKey(connectionID), bz) + if err := store.Set(host.ConnectionKey(connectionID), bz); err != nil { + panic(err) + } } // GetClientConnectionPaths returns all the connection paths stored under a // particular client +<<<<<<< HEAD func (k *Keeper) GetClientConnectionPaths(ctx context.Context, clientID string) ([]string, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.ClientConnectionsKey(clientID)) if err != nil { return nil, false } +||||||| 2028e9a34 +func (k *Keeper) GetClientConnectionPaths(ctx sdk.Context, clientID string) ([]string, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.ClientConnectionsKey(clientID)) +======= +func (k *Keeper) GetClientConnectionPaths(ctx context.Context, clientID string) ([]string, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.ClientConnectionsKey(clientID)) + if err != nil { + panic(err) + } + +>>>>>>> main if len(bz) == 0 { return nil, false } @@ -120,16 +167,32 @@ func (k *Keeper) SetClientConnectionPaths(ctx context.Context, clientID string, store := k.storeService.OpenKVStore(ctx) clientPaths := types.ClientPaths{Paths: paths} bz := k.cdc.MustMarshal(&clientPaths) - store.Set(host.ClientConnectionsKey(clientID), bz) + if err := store.Set(host.ClientConnectionsKey(clientID), bz); err != nil { + panic(err) + } } // GetNextConnectionSequence gets the next connection sequence from the store. +<<<<<<< HEAD func (k *Keeper) GetNextConnectionSequence(ctx context.Context) uint64 { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get([]byte(types.KeyNextConnectionSequence)) if err != nil { panic(errors.New("next connection sequence is nil")) } +||||||| 2028e9a34 +func (k *Keeper) GetNextConnectionSequence(ctx sdk.Context) uint64 { + store := ctx.KVStore(k.storeKey) + bz := store.Get([]byte(types.KeyNextConnectionSequence)) +======= +func (k *Keeper) GetNextConnectionSequence(ctx context.Context) uint64 { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get([]byte(types.KeyNextConnectionSequence)) + if err != nil { + panic(err) + } + +>>>>>>> main if len(bz) == 0 { panic(errors.New("next connection sequence is nil")) } @@ -141,7 +204,9 @@ func (k *Keeper) GetNextConnectionSequence(ctx context.Context) uint64 { func (k *Keeper) SetNextConnectionSequence(ctx context.Context, sequence uint64) { store := k.storeService.OpenKVStore(ctx) bz := sdk.Uint64ToBigEndian(sequence) - store.Set([]byte(types.KeyNextConnectionSequence), bz) + if err := store.Set([]byte(types.KeyNextConnectionSequence), bz); err != nil { + panic(err) + } } // GetAllClientConnectionPaths returns all stored clients connection id paths. It @@ -149,8 +214,15 @@ func (k *Keeper) SetNextConnectionSequence(ctx context.Context, sequence uint64) // no paths are stored. func (k *Keeper) GetAllClientConnectionPaths(ctx context.Context) []types.ConnectionPaths { var allConnectionPaths []types.ConnectionPaths +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when sdk.Context is removed k.clientKeeper.IterateClientStates(sdkCtx, nil, func(clientID string, cs exported.ClientState) bool { +||||||| 2028e9a34 + k.clientKeeper.IterateClientStates(ctx, nil, func(clientID string, cs exported.ClientState) bool { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + k.clientKeeper.IterateClientStates(sdkCtx, nil, func(clientID string, cs exported.ClientState) bool { +>>>>>>> main paths, found := k.GetClientConnectionPaths(ctx, clientID) if !found { // continue when connection handshake is not initialized @@ -204,9 +276,18 @@ func (k *Keeper) CreateSentinelLocalhostConnection(ctx context.Context) { // addConnectionToClient is used to add a connection identifier to the set of // connections associated with a client. +<<<<<<< HEAD func (k *Keeper) addConnectionToClient(ctx context.Context, clientID, connectionID string) error { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove when sdk.Context is removed _, found := k.clientKeeper.GetClientState(sdkCtx, clientID) +||||||| 2028e9a34 +func (k *Keeper) addConnectionToClient(ctx sdk.Context, clientID, connectionID string) error { + _, found := k.clientKeeper.GetClientState(ctx, clientID) +======= +func (k *Keeper) addConnectionToClient(ctx context.Context, clientID, connectionID string) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, found := k.clientKeeper.GetClientState(sdkCtx, clientID) +>>>>>>> main if !found { return errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID) } @@ -222,12 +303,26 @@ func (k *Keeper) addConnectionToClient(ctx context.Context, clientID, connection } // GetParams returns the total set of ibc-connection parameters. +<<<<<<< HEAD func (k *Keeper) GetParams(ctx context.Context) types.Params { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get([]byte(types.ParamsKey)) if err != nil { panic(errors.New("connection params are not set in store")) } +||||||| 2028e9a34 +func (k *Keeper) GetParams(ctx sdk.Context) types.Params { + store := ctx.KVStore(k.storeKey) + bz := store.Get([]byte(types.ParamsKey)) +======= +func (k *Keeper) GetParams(ctx context.Context) types.Params { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get([]byte(types.ParamsKey)) + if err != nil { + panic(err) + } + +>>>>>>> main if bz == nil { // only panic on unset params and not on empty params panic(errors.New("connection params are not set in store")) } @@ -241,5 +336,7 @@ func (k *Keeper) GetParams(ctx context.Context) types.Params { func (k *Keeper) SetParams(ctx context.Context, params types.Params) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(¶ms) - store.Set([]byte(types.ParamsKey), bz) + if err := store.Set([]byte(types.ParamsKey), bz); err != nil { + panic(err) + } } diff --git a/modules/core/03-connection/types/expected_keepers.go b/modules/core/03-connection/types/expected_keepers.go index b2c28f8fe10f..e6edb4963b0a 100644 --- a/modules/core/03-connection/types/expected_keepers.go +++ b/modules/core/03-connection/types/expected_keepers.go @@ -1,8 +1,14 @@ package types import ( +<<<<<<< HEAD context "context" +||||||| 2028e9a34 +======= + "context" + +>>>>>>> main sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" diff --git a/modules/core/03-connection/types/tx.pb.go b/modules/core/03-connection/types/tx.pb.go index 6576333d5229..4ce68cd9ba6e 100644 --- a/modules/core/03-connection/types/tx.pb.go +++ b/modules/core/03-connection/types/tx.pb.go @@ -132,8 +132,8 @@ type MsgConnectionOpenTry struct { // Deprecated: this field is unused. ProofConsensus []byte `protobuf:"bytes,10,opt,name=proof_consensus,json=proofConsensus,proto3" json:"proof_consensus,omitempty"` // Deprecated: Do not use. // Deprecated: this field is unused. - ConsensusHeight *types1.Height `protobuf:"bytes,11,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height,omitempty"` // Deprecated: Do not use. - Signer string `protobuf:"bytes,12,opt,name=signer,proto3" json:"signer,omitempty"` + ConsensusHeight types1.Height `protobuf:"bytes,11,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height"` // Deprecated: Do not use. + Signer string `protobuf:"bytes,12,opt,name=signer,proto3" json:"signer,omitempty"` // Deprecated: this field is unused. HostConsensusStateProof []byte `protobuf:"bytes,13,opt,name=host_consensus_state_proof,json=hostConsensusStateProof,proto3" json:"host_consensus_state_proof,omitempty"` // Deprecated: Do not use. } @@ -225,8 +225,8 @@ type MsgConnectionOpenAck struct { // Deprecated: this field is unused. ProofConsensus []byte `protobuf:"bytes,8,opt,name=proof_consensus,json=proofConsensus,proto3" json:"proof_consensus,omitempty"` // Deprecated: Do not use. // Deprecated: this field is unused. - ConsensusHeight *types1.Height `protobuf:"bytes,9,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height,omitempty"` // Deprecated: Do not use. - Signer string `protobuf:"bytes,10,opt,name=signer,proto3" json:"signer,omitempty"` + ConsensusHeight types1.Height `protobuf:"bytes,9,opt,name=consensus_height,json=consensusHeight,proto3" json:"consensus_height"` // Deprecated: Do not use. + Signer string `protobuf:"bytes,10,opt,name=signer,proto3" json:"signer,omitempty"` // Deprecated: this field is unused. HostConsensusStateProof []byte `protobuf:"bytes,11,opt,name=host_consensus_state_proof,json=hostConsensusStateProof,proto3" json:"host_consensus_state_proof,omitempty"` // Deprecated: Do not use. } @@ -478,66 +478,66 @@ func init() { func init() { proto.RegisterFile("ibc/core/connection/v1/tx.proto", fileDescriptor_5d00fde5fc97399e) } var fileDescriptor_5d00fde5fc97399e = []byte{ - // 935 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x6e, 0xe3, 0x54, - 0x14, 0xc7, 0xe3, 0x36, 0x49, 0x9b, 0x93, 0x0c, 0x85, 0xab, 0xb4, 0xf5, 0x78, 0x18, 0x27, 0x14, - 0xd0, 0x54, 0x03, 0xb5, 0xa7, 0x33, 0x20, 0xcd, 0x40, 0x25, 0xd4, 0x66, 0x43, 0x17, 0x85, 0x91, - 0x29, 0xb3, 0x60, 0x13, 0x25, 0xce, 0xad, 0x7b, 0xd5, 0xc6, 0xd7, 0xf2, 0x75, 0xc2, 0x98, 0x15, - 0x82, 0x0d, 0x12, 0x1b, 0x1e, 0x81, 0x47, 0x98, 0xc7, 0x18, 0xb1, 0x9a, 0x25, 0x0b, 0x84, 0x46, - 0xed, 0x62, 0x5e, 0x80, 0x07, 0x40, 0xf7, 0xc3, 0x8e, 0x93, 0x38, 0x25, 0x69, 0xd9, 0xd9, 0xc7, - 0xff, 0x73, 0xee, 0xb9, 0xe7, 0xfc, 0x8e, 0xef, 0x85, 0x06, 0xe9, 0xba, 0xb6, 0x4b, 0x43, 0x6c, - 0xbb, 0xd4, 0xf7, 0xb1, 0x1b, 0x11, 0xea, 0xdb, 0xc3, 0x5d, 0x3b, 0x7a, 0x6e, 0x05, 0x21, 0x8d, - 0x28, 0xda, 0x20, 0x5d, 0xd7, 0xe2, 0x02, 0x6b, 0x24, 0xb0, 0x86, 0xbb, 0x46, 0xdd, 0xa3, 0x1e, - 0x15, 0x12, 0x9b, 0x3f, 0x49, 0xb5, 0xb1, 0xe9, 0x52, 0xd6, 0xa7, 0xcc, 0xee, 0x33, 0x8f, 0x47, - 0xe9, 0x33, 0x4f, 0x7d, 0xb8, 0xed, 0x51, 0xea, 0x9d, 0x63, 0x5b, 0xbc, 0x75, 0x07, 0x27, 0x76, - 0xc7, 0x8f, 0xd5, 0xa7, 0x4c, 0x0a, 0xe7, 0x04, 0xfb, 0x11, 0x77, 0x94, 0x4f, 0x4a, 0x70, 0x6f, - 0x46, 0x8e, 0x99, 0x84, 0x84, 0x70, 0xeb, 0xd7, 0x25, 0x58, 0x3f, 0x62, 0x5e, 0x2b, 0xb5, 0x7f, - 0x1d, 0x60, 0xff, 0xd0, 0x27, 0x11, 0xba, 0x03, 0x15, 0x19, 0xb2, 0x4d, 0x7a, 0xba, 0xd6, 0xd4, - 0xb6, 0x2b, 0xce, 0xaa, 0x34, 0x1c, 0xf6, 0xd0, 0x57, 0x50, 0x73, 0xe9, 0xc0, 0x8f, 0x70, 0x18, - 0x74, 0xc2, 0x28, 0xd6, 0x97, 0x9a, 0xda, 0x76, 0xf5, 0xe1, 0x07, 0x56, 0xfe, 0xce, 0xad, 0x56, - 0x46, 0x7b, 0x50, 0x7c, 0xf9, 0x77, 0xa3, 0xe0, 0x8c, 0xf9, 0xa3, 0x27, 0xb0, 0x32, 0xc4, 0x21, - 0x23, 0xd4, 0xd7, 0x97, 0x45, 0xa8, 0xc6, 0xac, 0x50, 0xcf, 0xa4, 0xcc, 0x49, 0xf4, 0xe8, 0x3d, - 0xa8, 0xf5, 0xf0, 0x79, 0x27, 0x6e, 0x07, 0x38, 0x24, 0xb4, 0xa7, 0x17, 0x9b, 0xda, 0x76, 0xd1, - 0xa9, 0x0a, 0xdb, 0x53, 0x61, 0x42, 0x1b, 0x50, 0x66, 0xc4, 0xf3, 0x71, 0xa8, 0x97, 0xc4, 0x3e, - 0xd4, 0xdb, 0x67, 0x6b, 0xbf, 0xfc, 0xde, 0x28, 0xfc, 0xf4, 0xe6, 0xc5, 0x7d, 0x65, 0xd8, 0x6a, - 0xc0, 0xdd, 0xdc, 0x62, 0x38, 0x98, 0x05, 0xd4, 0x67, 0x78, 0xeb, 0x75, 0x09, 0xea, 0x53, 0x8a, - 0xe3, 0x30, 0xbe, 0xba, 0x5a, 0x8f, 0x61, 0x23, 0x08, 0xf1, 0x90, 0xd0, 0x01, 0x6b, 0x8f, 0x76, - 0xc3, 0x95, 0xbc, 0x6e, 0x95, 0x83, 0x25, 0x5d, 0x73, 0xea, 0x89, 0x62, 0x14, 0xfb, 0xb0, 0x87, - 0x3e, 0x87, 0x9a, 0x0a, 0xcb, 0xa2, 0x4e, 0x84, 0x55, 0x71, 0xea, 0x96, 0x44, 0xc3, 0x4a, 0xd0, - 0xb0, 0xf6, 0xfd, 0x58, 0x44, 0xa9, 0x4a, 0xf5, 0x37, 0x5c, 0x3c, 0xd5, 0xa4, 0xe2, 0x0d, 0x9b, - 0x34, 0x59, 0xe9, 0xd2, 0x74, 0xa5, 0x8f, 0x61, 0x3d, 0xeb, 0xd2, 0x56, 0x4d, 0x62, 0x7a, 0xb9, - 0xb9, 0x3c, 0x4f, 0x57, 0xeb, 0x59, 0x6f, 0x65, 0x64, 0xa8, 0x05, 0xb5, 0x20, 0xa4, 0xf4, 0xa4, - 0x7d, 0x8a, 0x89, 0x77, 0x1a, 0xe9, 0x2b, 0x62, 0x23, 0x46, 0x26, 0x98, 0x64, 0x7f, 0xb8, 0x6b, - 0x7d, 0x29, 0x14, 0x2a, 0xfd, 0xaa, 0xf0, 0x92, 0x26, 0x74, 0x17, 0x40, 0x06, 0x21, 0x3e, 0x89, - 0xf4, 0xd5, 0xa6, 0xb6, 0x5d, 0x73, 0x2a, 0xc2, 0x22, 0x70, 0xff, 0x30, 0x59, 0x43, 0xc6, 0xd2, - 0x2b, 0x5c, 0x20, 0x6b, 0x2a, 0xec, 0x2d, 0x61, 0x46, 0x1f, 0xc1, 0x9a, 0x92, 0x71, 0x1e, 0x7c, - 0x36, 0x60, 0x3a, 0xa4, 0xca, 0xb7, 0xa4, 0x32, 0xf9, 0x82, 0x0e, 0xe1, 0xed, 0x54, 0x96, 0xe4, - 0x5e, 0xfd, 0xcf, 0xdc, 0x79, 0xa4, 0xb5, 0xd4, 0x4f, 0x65, 0x3f, 0x42, 0xb8, 0x96, 0x45, 0x18, - 0x7d, 0x01, 0xc6, 0x29, 0x65, 0xd1, 0x28, 0x1d, 0x09, 0x4a, 0x5b, 0x64, 0xa2, 0xdf, 0x4a, 0x53, - 0xdb, 0xe4, 0xaa, 0x34, 0x33, 0xc1, 0xc7, 0x53, 0x2e, 0x99, 0x9e, 0x01, 0x13, 0xde, 0xcd, 0x23, - 0x3c, 0x1d, 0x81, 0xbf, 0x8a, 0x39, 0x23, 0xb0, 0xef, 0x9e, 0xa1, 0xf7, 0xe1, 0xd6, 0x38, 0xdc, - 0x72, 0x0c, 0x6a, 0x6e, 0x16, 0xe8, 0x3d, 0x30, 0xc6, 0x00, 0xc9, 0x19, 0x07, 0x47, 0xcf, 0x2a, - 0xc6, 0xc6, 0xe1, 0x06, 0xbf, 0x89, 0xc9, 0x49, 0x2a, 0x2e, 0x32, 0x49, 0x93, 0x00, 0x96, 0xae, - 0x03, 0xe0, 0x1d, 0x90, 0xb8, 0xb5, 0xa3, 0x30, 0xd6, 0xcb, 0x82, 0xbf, 0x55, 0x61, 0xe0, 0xff, - 0x8f, 0x49, 0xfc, 0x56, 0xe6, 0xc6, 0x6f, 0x75, 0x21, 0xfc, 0x2a, 0x37, 0xc5, 0x0f, 0x16, 0xc0, - 0xaf, 0xfa, 0x3f, 0xe1, 0xb7, 0xef, 0x9e, 0xa5, 0xf8, 0xfd, 0xa1, 0x81, 0x3e, 0x25, 0x68, 0x51, - 0xff, 0x84, 0x84, 0xfd, 0xf9, 0x10, 0x4c, 0xfb, 0xd0, 0x71, 0xcf, 0x04, 0x71, 0x49, 0x1f, 0x38, - 0xc4, 0x93, 0x9d, 0x5e, 0xbe, 0x4e, 0xa7, 0x47, 0xd5, 0x2a, 0x5e, 0x7d, 0xde, 0x6c, 0x41, 0x73, - 0xd6, 0x5e, 0xd2, 0x0d, 0x3f, 0x87, 0xb5, 0x23, 0xe6, 0x7d, 0x1b, 0xf4, 0x78, 0xcd, 0x3a, 0x61, - 0xa7, 0xcf, 0x32, 0xf1, 0xb5, 0xb1, 0x6e, 0xec, 0x41, 0x39, 0x10, 0x0a, 0x75, 0x1e, 0x9b, 0xb3, - 0xa6, 0x43, 0xc6, 0x51, 0xa9, 0x2b, 0x9f, 0xe9, 0xec, 0x6e, 0xc3, 0xe6, 0xc4, 0xca, 0x49, 0x52, - 0x0f, 0xff, 0x29, 0xc2, 0xf2, 0x11, 0xf3, 0xd0, 0x0f, 0x80, 0x72, 0xae, 0x0e, 0x3b, 0xb3, 0xd6, - 0xcd, 0x3d, 0x5c, 0x8d, 0x4f, 0x17, 0x92, 0x27, 0x39, 0xa0, 0xef, 0xe1, 0x9d, 0xe9, 0x73, 0xf8, - 0xe3, 0xb9, 0x63, 0x1d, 0x87, 0xb1, 0xf1, 0xc9, 0x22, 0xea, 0xd9, 0x0b, 0x73, 0x70, 0xe6, 0x5f, - 0x78, 0xdf, 0x3d, 0x5b, 0x60, 0xe1, 0x0c, 0xfb, 0xe8, 0x67, 0x0d, 0xd6, 0xf3, 0xc1, 0x7f, 0x30, - 0x77, 0x3c, 0xe5, 0x61, 0x3c, 0x5e, 0xd4, 0x23, 0xcd, 0x22, 0x84, 0x0d, 0xc9, 0xc4, 0x48, 0xa6, - 0xb8, 0xbc, 0x77, 0x45, 0xcc, 0x2c, 0x46, 0x86, 0x3d, 0xa7, 0x30, 0x59, 0xd3, 0x28, 0xfd, 0xf8, - 0xe6, 0xc5, 0x7d, 0xed, 0xe0, 0xd9, 0xcb, 0x0b, 0x53, 0x7b, 0x75, 0x61, 0x6a, 0xaf, 0x2f, 0x4c, - 0xed, 0xb7, 0x4b, 0xb3, 0xf0, 0xea, 0xd2, 0x2c, 0xfc, 0x79, 0x69, 0x16, 0xbe, 0xdb, 0xf3, 0x48, - 0x74, 0x3a, 0xe8, 0x5a, 0x2e, 0xed, 0xdb, 0xea, 0x42, 0x4d, 0xba, 0xee, 0x8e, 0x47, 0xed, 0xe1, - 0x13, 0xbb, 0x4f, 0x7b, 0x83, 0x73, 0xcc, 0xe4, 0x85, 0xf8, 0xc1, 0xa3, 0x9d, 0xcc, 0x9d, 0x38, - 0x8a, 0x03, 0xcc, 0xba, 0x65, 0xf1, 0xfb, 0x7f, 0xf4, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x81, - 0x77, 0x9b, 0x70, 0xdb, 0x0b, 0x00, 0x00, + // 938 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0xc7, 0x45, 0x5b, 0x92, 0xad, 0x91, 0x52, 0xb7, 0x0b, 0xd9, 0xde, 0x30, 0x8d, 0xa4, 0xba, + 0x2d, 0x62, 0xa4, 0x35, 0x19, 0x27, 0x2d, 0x90, 0xb4, 0x06, 0x0a, 0x5b, 0x97, 0xfa, 0xe0, 0x36, + 0x60, 0xdd, 0x1c, 0x7a, 0x11, 0x24, 0x6a, 0x4d, 0x2f, 0x6c, 0x71, 0x09, 0x2e, 0xa5, 0x46, 0x3d, + 0x15, 0xed, 0xa5, 0x40, 0x2f, 0x7d, 0x84, 0x3e, 0x42, 0x1e, 0x23, 0xe8, 0x29, 0xc7, 0x9e, 0x8a, + 0xc0, 0x2e, 0x90, 0x17, 0xe8, 0x03, 0x14, 0xfb, 0x41, 0x8a, 0x92, 0x28, 0x47, 0x4a, 0x7c, 0x23, + 0x87, 0xff, 0x99, 0x9d, 0x9d, 0xf9, 0x0d, 0x77, 0xa1, 0x4e, 0x3b, 0xae, 0xed, 0xb2, 0x90, 0xd8, + 0x2e, 0xf3, 0x7d, 0xe2, 0x46, 0x94, 0xf9, 0xf6, 0x60, 0xd7, 0x8e, 0x9e, 0x5a, 0x41, 0xc8, 0x22, + 0x86, 0x36, 0x68, 0xc7, 0xb5, 0x84, 0xc0, 0x1a, 0x09, 0xac, 0xc1, 0xae, 0x59, 0xf5, 0x98, 0xc7, + 0xa4, 0xc4, 0x16, 0x4f, 0x4a, 0x6d, 0x6e, 0xba, 0x8c, 0xf7, 0x18, 0xb7, 0x7b, 0xdc, 0x13, 0x51, + 0x7a, 0xdc, 0xd3, 0x1f, 0x6e, 0x7a, 0x8c, 0x79, 0xe7, 0xc4, 0x96, 0x6f, 0x9d, 0xfe, 0x89, 0xdd, + 0xf6, 0x87, 0xfa, 0x53, 0x2a, 0x85, 0x73, 0x4a, 0xfc, 0x48, 0x38, 0xaa, 0x27, 0x2d, 0xb8, 0x33, + 0x23, 0xc7, 0x54, 0x42, 0x52, 0xb8, 0xf5, 0xfb, 0x12, 0xac, 0x1f, 0x71, 0xaf, 0x99, 0xd8, 0xbf, + 0x0d, 0x88, 0x7f, 0xe8, 0xd3, 0x08, 0xdd, 0x82, 0x92, 0x0a, 0xd9, 0xa2, 0x5d, 0x6c, 0x34, 0x8c, + 0xed, 0x92, 0xb3, 0xaa, 0x0c, 0x87, 0x5d, 0xf4, 0x0d, 0x54, 0x5c, 0xd6, 0xf7, 0x23, 0x12, 0x06, + 0xed, 0x30, 0x1a, 0xe2, 0xa5, 0x86, 0xb1, 0x5d, 0xbe, 0xff, 0x91, 0x95, 0xbd, 0x73, 0xab, 0x99, + 0xd2, 0x1e, 0xe4, 0x9f, 0xff, 0x53, 0xcf, 0x39, 0x63, 0xfe, 0xe8, 0x11, 0xac, 0x0c, 0x48, 0xc8, + 0x29, 0xf3, 0xf1, 0xb2, 0x0c, 0x55, 0x9f, 0x15, 0xea, 0x89, 0x92, 0x39, 0xb1, 0x1e, 0x7d, 0x00, + 0x95, 0x2e, 0x39, 0x6f, 0x0f, 0x5b, 0x01, 0x09, 0x29, 0xeb, 0xe2, 0x7c, 0xc3, 0xd8, 0xce, 0x3b, + 0x65, 0x69, 0x7b, 0x2c, 0x4d, 0x68, 0x03, 0x8a, 0x9c, 0x7a, 0x3e, 0x09, 0x71, 0x41, 0xee, 0x43, + 0xbf, 0x7d, 0xb1, 0xf6, 0xdb, 0x9f, 0xf5, 0xdc, 0x2f, 0xaf, 0x9e, 0xdd, 0xd5, 0x86, 0xad, 0x3a, + 0xdc, 0xce, 0x2c, 0x86, 0x43, 0x78, 0xc0, 0x7c, 0x4e, 0xb6, 0xfe, 0x2d, 0x40, 0x75, 0x4a, 0x71, + 0x1c, 0x0e, 0xaf, 0xae, 0xd6, 0x43, 0xd8, 0x08, 0x42, 0x32, 0xa0, 0xac, 0xcf, 0x5b, 0xa3, 0xdd, + 0x08, 0xa5, 0xa8, 0x5b, 0xe9, 0x60, 0x09, 0x1b, 0x4e, 0x35, 0x56, 0x8c, 0x62, 0x1f, 0x76, 0xd1, + 0x97, 0x50, 0xd1, 0x61, 0x79, 0xd4, 0x8e, 0x88, 0x2e, 0x4e, 0xd5, 0x52, 0x68, 0x58, 0x31, 0x1a, + 0xd6, 0xbe, 0x3f, 0x94, 0x51, 0xca, 0x4a, 0xfd, 0x9d, 0x10, 0x4f, 0x35, 0x29, 0xff, 0x96, 0x4d, + 0x9a, 0xac, 0x74, 0x61, 0xba, 0xd2, 0xc7, 0xb0, 0x9e, 0x76, 0x69, 0xe9, 0x26, 0x71, 0x5c, 0x6c, + 0x2c, 0xcf, 0xd3, 0xd5, 0x6a, 0xda, 0x5b, 0x1b, 0x39, 0x6a, 0x42, 0x25, 0x08, 0x19, 0x3b, 0x69, + 0x9d, 0x12, 0xea, 0x9d, 0x46, 0x78, 0x45, 0x6e, 0xc4, 0x4c, 0x05, 0x53, 0xec, 0x0f, 0x76, 0xad, + 0xaf, 0xa5, 0x42, 0xa7, 0x5f, 0x96, 0x5e, 0xca, 0x84, 0x6e, 0x03, 0xa8, 0x20, 0xd4, 0xa7, 0x11, + 0x5e, 0x6d, 0x18, 0xdb, 0x15, 0xa7, 0x24, 0x2d, 0x12, 0xf7, 0x8f, 0xe3, 0x35, 0x54, 0x2c, 0x5c, + 0x12, 0x02, 0x55, 0x53, 0x69, 0x6f, 0x4a, 0x33, 0xfa, 0x04, 0xd6, 0xb4, 0x4c, 0xf0, 0xe0, 0xf3, + 0x3e, 0xc7, 0x90, 0x28, 0xdf, 0x51, 0xca, 0xf8, 0x0b, 0x3a, 0x82, 0x77, 0x13, 0x59, 0x9c, 0x7b, + 0xf9, 0xb5, 0xb9, 0x17, 0x45, 0xee, 0xd8, 0x70, 0xd6, 0x12, 0x5f, 0xbd, 0x83, 0x11, 0xc6, 0x95, + 0x34, 0xc6, 0xe8, 0x2b, 0x30, 0x4f, 0x19, 0x8f, 0x46, 0x29, 0x29, 0x58, 0x5a, 0x32, 0x1b, 0x7c, + 0x23, 0x49, 0x6f, 0x53, 0xa8, 0x92, 0xec, 0x24, 0x23, 0x8f, 0x85, 0x64, 0x7a, 0x0e, 0x6a, 0xf0, + 0x7e, 0x16, 0xe5, 0xc9, 0x18, 0xbc, 0xcc, 0x67, 0x8c, 0xc1, 0xbe, 0x7b, 0x86, 0x3e, 0x84, 0x1b, + 0xe3, 0x80, 0xab, 0x51, 0xa8, 0xb8, 0x69, 0xa8, 0xf7, 0xc0, 0x1c, 0x83, 0x24, 0x63, 0x24, 0x1c, + 0x9c, 0x56, 0x8c, 0x8d, 0xc4, 0x5b, 0xfc, 0x2a, 0x26, 0xa7, 0x29, 0xbf, 0xc8, 0x34, 0x4d, 0x42, + 0x58, 0x78, 0x13, 0x08, 0x6f, 0x81, 0x42, 0xae, 0x15, 0x85, 0x43, 0x5c, 0x94, 0x0c, 0xae, 0x4a, + 0x83, 0xf8, 0x87, 0x4c, 0x22, 0xb8, 0x32, 0x37, 0x82, 0xab, 0x0b, 0x21, 0x58, 0xba, 0x0e, 0x04, + 0x61, 0x01, 0x04, 0xcb, 0xd7, 0x84, 0xe0, 0xbe, 0x7b, 0x96, 0x20, 0xf8, 0x97, 0x01, 0x78, 0x4a, + 0xd0, 0x64, 0xfe, 0x09, 0x0d, 0x7b, 0xf3, 0x61, 0x98, 0xf4, 0xa2, 0xed, 0x9e, 0x49, 0xea, 0xe2, + 0x5e, 0x08, 0x90, 0x27, 0xbb, 0xbd, 0xfc, 0x26, 0xdd, 0x1e, 0x55, 0x2b, 0x7f, 0xf5, 0xb9, 0xb3, + 0x05, 0x8d, 0x59, 0x7b, 0x49, 0x36, 0xfc, 0x14, 0xd6, 0x8e, 0xb8, 0xf7, 0x7d, 0xd0, 0x15, 0x35, + 0x6b, 0x87, 0xed, 0x1e, 0x4f, 0xc5, 0x37, 0xc6, 0xba, 0xb1, 0x07, 0xc5, 0x40, 0x2a, 0xf4, 0xb9, + 0x5c, 0x9b, 0x35, 0x21, 0x2a, 0x8e, 0x4e, 0x5d, 0xfb, 0x4c, 0x67, 0x77, 0x13, 0x36, 0x27, 0x56, + 0x8e, 0x93, 0xba, 0xff, 0x5f, 0x1e, 0x96, 0x8f, 0xb8, 0x87, 0x7e, 0x02, 0x94, 0x71, 0x85, 0xd8, + 0x99, 0xb5, 0x6e, 0xe6, 0x21, 0x6b, 0x7e, 0xbe, 0x90, 0x3c, 0xce, 0x01, 0xfd, 0x08, 0xef, 0x4d, + 0x9f, 0xc7, 0x9f, 0xce, 0x1d, 0xeb, 0x38, 0x1c, 0x9a, 0x9f, 0x2d, 0xa2, 0x9e, 0xbd, 0xb0, 0x00, + 0x67, 0xfe, 0x85, 0xf7, 0xdd, 0xb3, 0x05, 0x16, 0x4e, 0xb1, 0x8f, 0x7e, 0x35, 0x60, 0x3d, 0x1b, + 0xfc, 0x7b, 0x73, 0xc7, 0xd3, 0x1e, 0xe6, 0xc3, 0x45, 0x3d, 0x92, 0x2c, 0x42, 0xd8, 0x50, 0x4c, + 0x8c, 0x64, 0x9a, 0xcb, 0x3b, 0x57, 0xc4, 0x4c, 0x63, 0x64, 0xda, 0x73, 0x0a, 0xe3, 0x35, 0xcd, + 0xc2, 0xcf, 0xaf, 0x9e, 0xdd, 0x35, 0x0e, 0x9e, 0x3c, 0xbf, 0xa8, 0x19, 0x2f, 0x2e, 0x6a, 0xc6, + 0xcb, 0x8b, 0x9a, 0xf1, 0xc7, 0x65, 0x2d, 0xf7, 0xe2, 0xb2, 0x96, 0xfb, 0xfb, 0xb2, 0x96, 0xfb, + 0x61, 0xcf, 0xa3, 0xd1, 0x69, 0xbf, 0x63, 0xb9, 0xac, 0x67, 0xeb, 0x8b, 0x35, 0xed, 0xb8, 0x3b, + 0x1e, 0xb3, 0x07, 0x8f, 0xec, 0x1e, 0xeb, 0xf6, 0xcf, 0x09, 0x57, 0x17, 0xe3, 0x7b, 0x0f, 0x76, + 0x52, 0x77, 0xe3, 0x68, 0x18, 0x10, 0xde, 0x29, 0xca, 0x23, 0xe0, 0xc1, 0xff, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xcf, 0x12, 0x73, 0xd2, 0xe3, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -899,18 +899,16 @@ func (m *MsgConnectionOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x62 } - if m.ConsensusHeight != nil { - { - size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x5a + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x5a if len(m.ProofConsensus) > 0 { i -= len(m.ProofConsensus) copy(dAtA[i:], m.ProofConsensus) @@ -1057,18 +1055,16 @@ func (m *MsgConnectionOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 } - if m.ConsensusHeight != nil { - { - size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + { + size, err := m.ConsensusHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x4a + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x4a if len(m.ProofConsensus) > 0 { i -= len(m.ProofConsensus) copy(dAtA[i:], m.ProofConsensus) @@ -1393,10 +1389,8 @@ func (m *MsgConnectionOpenTry) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.ConsensusHeight != nil { - l = m.ConsensusHeight.Size() - n += 1 + l + sovTx(uint64(l)) - } + l = m.ConsensusHeight.Size() + n += 1 + l + sovTx(uint64(l)) l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -1453,10 +1447,8 @@ func (m *MsgConnectionOpenAck) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.ConsensusHeight != nil { - l = m.ConsensusHeight.Size() - n += 1 + l + sovTx(uint64(l)) - } + l = m.ConsensusHeight.Size() + n += 1 + l + sovTx(uint64(l)) l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -2170,9 +2162,6 @@ func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ConsensusHeight == nil { - m.ConsensusHeight = &types1.Height{} - } if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2643,9 +2632,6 @@ func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ConsensusHeight == nil { - m.ConsensusHeight = &types1.Height{} - } if err := m.ConsensusHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/modules/core/04-channel/keeper/events.go b/modules/core/04-channel/keeper/events.go index b93f3d0c3d2d..6b7de9e973fd 100644 --- a/modules/core/04-channel/keeper/events.go +++ b/modules/core/04-channel/keeper/events.go @@ -417,7 +417,7 @@ func EmitChannelUpgradeCancelEvent(ctx sdk.Context, portID string, channelID str }) } -// emitChannelFlushCompleteEvents emits an flushing event. +// emitChannelFlushCompleteEvent emits an flushing event. func emitChannelFlushCompleteEvent(ctx sdk.Context, portID string, channelID string, channel types.Channel) { ctx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( diff --git a/modules/core/04-channel/keeper/keeper.go b/modules/core/04-channel/keeper/keeper.go index dee7ca7258e1..06cf70ffcc29 100644 --- a/modules/core/04-channel/keeper/keeper.go +++ b/modules/core/04-channel/keeper/keeper.go @@ -61,9 +61,18 @@ func NewKeeper( } // Logger returns a module-specific logger. +<<<<<<< HEAD func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +||||||| 2028e9a34 +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +======= +func (Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +>>>>>>> main } // GenerateChannelIdentifier returns the next channel identifier. @@ -106,7 +115,9 @@ func (k *Keeper) GetChannel(ctx context.Context, portID, channelID string) (type func (k *Keeper) SetChannel(ctx context.Context, portID, channelID string, channel types.Channel) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(&channel) - store.Set(host.ChannelKey(portID, channelID), bz) + if err := store.Set(host.ChannelKey(portID, channelID), bz); err != nil { + panic(err) + } } // GetAppVersion gets the version for the specified channel. @@ -137,7 +148,9 @@ func (k *Keeper) GetNextChannelSequence(ctx context.Context) uint64 { func (k *Keeper) SetNextChannelSequence(ctx context.Context, sequence uint64) { store := k.storeService.OpenKVStore(ctx) bz := sdk.Uint64ToBigEndian(sequence) - store.Set([]byte(types.KeyNextChannelSequence), bz) + if err := store.Set([]byte(types.KeyNextChannelSequence), bz); err != nil { + panic(err) + } } // GetNextSequenceSend gets a channel's next send sequence from the store @@ -158,7 +171,9 @@ func (k *Keeper) GetNextSequenceSend(ctx context.Context, portID, channelID stri func (k *Keeper) SetNextSequenceSend(ctx context.Context, portID, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) bz := sdk.Uint64ToBigEndian(sequence) - store.Set(host.NextSequenceSendKey(portID, channelID), bz) + if err := store.Set(host.NextSequenceSendKey(portID, channelID), bz); err != nil { + panic(err) + } } // GetNextSequenceRecv gets a channel's next receive sequence from the store @@ -179,16 +194,32 @@ func (k *Keeper) GetNextSequenceRecv(ctx context.Context, portID, channelID stri func (k *Keeper) SetNextSequenceRecv(ctx context.Context, portID, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) bz := sdk.Uint64ToBigEndian(sequence) - store.Set(host.NextSequenceRecvKey(portID, channelID), bz) + if err := store.Set(host.NextSequenceRecvKey(portID, channelID), bz); err != nil { + panic(err) + } } // GetNextSequenceAck gets a channel's next ack sequence from the store +<<<<<<< HEAD func (k *Keeper) GetNextSequenceAck(ctx context.Context, portID, channelID string) (uint64, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.NextSequenceAckKey(portID, channelID)) if err != nil { return 0, false } +||||||| 2028e9a34 +func (k *Keeper) GetNextSequenceAck(ctx sdk.Context, portID, channelID string) (uint64, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.NextSequenceAckKey(portID, channelID)) +======= +func (k *Keeper) GetNextSequenceAck(ctx context.Context, portID, channelID string) (uint64, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.NextSequenceAckKey(portID, channelID)) + if err != nil { + panic(err) + } + +>>>>>>> main if len(bz) == 0 { return 0, false } @@ -200,16 +231,32 @@ func (k *Keeper) GetNextSequenceAck(ctx context.Context, portID, channelID strin func (k *Keeper) SetNextSequenceAck(ctx context.Context, portID, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) bz := sdk.Uint64ToBigEndian(sequence) - store.Set(host.NextSequenceAckKey(portID, channelID), bz) + if err := store.Set(host.NextSequenceAckKey(portID, channelID), bz); err != nil { + panic(err) + } } // GetPacketReceipt gets a packet receipt from the store +<<<<<<< HEAD func (k *Keeper) GetPacketReceipt(ctx context.Context, portID, channelID string, sequence uint64) (string, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.PacketReceiptKey(portID, channelID, sequence)) if err != nil { return "", false } +||||||| 2028e9a34 +func (k *Keeper) GetPacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64) (string, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.PacketReceiptKey(portID, channelID, sequence)) +======= +func (k *Keeper) GetPacketReceipt(ctx context.Context, portID, channelID string, sequence uint64) (string, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.PacketReceiptKey(portID, channelID, sequence)) + if err != nil { + panic(err) + } + +>>>>>>> main if len(bz) == 0 { return "", false } @@ -218,24 +265,62 @@ func (k *Keeper) GetPacketReceipt(ctx context.Context, portID, channelID string, } // SetPacketReceipt sets an empty packet receipt to the store +<<<<<<< HEAD func (k *Keeper) SetPacketReceipt(ctx context.Context, portID, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) store.Set(host.PacketReceiptKey(portID, channelID, sequence), []byte{byte(1)}) +||||||| 2028e9a34 +func (k *Keeper) SetPacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64) { + store := ctx.KVStore(k.storeKey) + store.Set(host.PacketReceiptKey(portID, channelID, sequence), []byte{byte(1)}) +======= +func (k *Keeper) SetPacketReceipt(ctx context.Context, portID, channelID string, sequence uint64) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(host.PacketReceiptKey(portID, channelID, sequence), []byte{byte(1)}); err != nil { + panic(err) + } +>>>>>>> main } // deletePacketReceipt deletes a packet receipt from the store +<<<<<<< HEAD func (k *Keeper) deletePacketReceipt(ctx context.Context, portID, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) store.Delete(host.PacketReceiptKey(portID, channelID, sequence)) +||||||| 2028e9a34 +func (k *Keeper) deletePacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64) { + store := ctx.KVStore(k.storeKey) + store.Delete(host.PacketReceiptKey(portID, channelID, sequence)) +======= +func (k *Keeper) deletePacketReceipt(ctx context.Context, portID, channelID string, sequence uint64) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Delete(host.PacketReceiptKey(portID, channelID, sequence)); err != nil { + panic(err) + } +>>>>>>> main } // GetPacketCommitment gets the packet commitment hash from the store +<<<<<<< HEAD func (k *Keeper) GetPacketCommitment(ctx context.Context, portID, channelID string, sequence uint64) []byte { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.PacketCommitmentKey(portID, channelID, sequence)) if err != nil { return nil } +||||||| 2028e9a34 +func (k *Keeper) GetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64) []byte { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.PacketCommitmentKey(portID, channelID, sequence)) +======= +func (k *Keeper) GetPacketCommitment(ctx context.Context, portID, channelID string, sequence uint64) []byte { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.PacketCommitmentKey(portID, channelID, sequence)) + if err != nil { + panic(err) + } + +>>>>>>> main return bz } @@ -250,9 +335,21 @@ func (k *Keeper) HasPacketCommitment(ctx context.Context, portID, channelID stri } // SetPacketCommitment sets the packet commitment hash to the store +<<<<<<< HEAD func (k *Keeper) SetPacketCommitment(ctx context.Context, portID, channelID string, sequence uint64, commitmentHash []byte) { store := k.storeService.OpenKVStore(ctx) store.Set(host.PacketCommitmentKey(portID, channelID, sequence), commitmentHash) +||||||| 2028e9a34 +func (k *Keeper) SetPacketCommitment(ctx sdk.Context, portID, channelID string, sequence uint64, commitmentHash []byte) { + store := ctx.KVStore(k.storeKey) + store.Set(host.PacketCommitmentKey(portID, channelID, sequence), commitmentHash) +======= +func (k *Keeper) SetPacketCommitment(ctx context.Context, portID, channelID string, sequence uint64, commitmentHash []byte) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(host.PacketCommitmentKey(portID, channelID, sequence), commitmentHash); err != nil { + panic(err) + } +>>>>>>> main } func (k *Keeper) deletePacketCommitment(ctx context.Context, portID, channelID string, sequence uint64) { @@ -263,21 +360,48 @@ func (k *Keeper) deletePacketCommitment(ctx context.Context, portID, channelID s } // SetPacketAcknowledgement sets the packet ack hash to the store +<<<<<<< HEAD func (k *Keeper) SetPacketAcknowledgement(ctx context.Context, portID, channelID string, sequence uint64, ackHash []byte) { store := k.storeService.OpenKVStore(ctx) store.Set(host.PacketAcknowledgementKey(portID, channelID, sequence), ackHash) +||||||| 2028e9a34 +func (k *Keeper) SetPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64, ackHash []byte) { + store := ctx.KVStore(k.storeKey) + store.Set(host.PacketAcknowledgementKey(portID, channelID, sequence), ackHash) +======= +func (k *Keeper) SetPacketAcknowledgement(ctx context.Context, portID, channelID string, sequence uint64, ackHash []byte) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Set(host.PacketAcknowledgementKey(portID, channelID, sequence), ackHash); err != nil { + panic(err) + } +>>>>>>> main } // GetPacketAcknowledgement gets the packet ack hash from the store +<<<<<<< HEAD func (k *Keeper) GetPacketAcknowledgement(ctx context.Context, portID, channelID string, sequence uint64) ([]byte, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.PacketAcknowledgementKey(portID, channelID, sequence)) if err != nil { return nil, false } +||||||| 2028e9a34 +func (k *Keeper) GetPacketAcknowledgement(ctx sdk.Context, portID, channelID string, sequence uint64) ([]byte, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.PacketAcknowledgementKey(portID, channelID, sequence)) +======= +func (k *Keeper) GetPacketAcknowledgement(ctx context.Context, portID, channelID string, sequence uint64) ([]byte, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.PacketAcknowledgementKey(portID, channelID, sequence)) + if err != nil { + panic(err) + } + +>>>>>>> main if len(bz) == 0 { return nil, false } + return bz, true } @@ -531,9 +655,18 @@ func (k *Keeper) GetChannelConnection(ctx context.Context, portID, channelID str } // LookupModuleByChannel will return the IBCModule along with the capability associated with a given channel defined by its portID and channelID +<<<<<<< HEAD func (k *Keeper) LookupModuleByChannel(ctx context.Context, portID, channelID string) (string, *capabilitytypes.Capability, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC modules, capability, err := k.scopedKeeper.LookupModules(sdkCtx, host.ChannelCapabilityPath(portID, channelID)) +||||||| 2028e9a34 +func (k *Keeper) LookupModuleByChannel(ctx sdk.Context, portID, channelID string) (string, *capabilitytypes.Capability, error) { + modules, capability, err := k.scopedKeeper.LookupModules(ctx, host.ChannelCapabilityPath(portID, channelID)) +======= +func (k *Keeper) LookupModuleByChannel(ctx context.Context, portID, channelID string) (string, *capabilitytypes.Capability, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + modules, capability, err := k.scopedKeeper.LookupModules(sdkCtx, host.ChannelCapabilityPath(portID, channelID)) +>>>>>>> main if err != nil { return "", nil, err } @@ -542,6 +675,7 @@ func (k *Keeper) LookupModuleByChannel(ctx context.Context, portID, channelID st } // GetUpgradeErrorReceipt returns the upgrade error receipt for the provided port and channel identifiers. +<<<<<<< HEAD func (k *Keeper) GetUpgradeErrorReceipt(ctx context.Context, portID, channelID string) (types.ErrorReceipt, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.ChannelUpgradeErrorKey(portID, channelID)) @@ -549,6 +683,21 @@ func (k *Keeper) GetUpgradeErrorReceipt(ctx context.Context, portID, channelID s return types.ErrorReceipt{}, false } if bz == nil { +||||||| 2028e9a34 +func (k *Keeper) GetUpgradeErrorReceipt(ctx sdk.Context, portID, channelID string) (types.ErrorReceipt, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.ChannelUpgradeErrorKey(portID, channelID)) + if bz == nil { +======= +func (k *Keeper) GetUpgradeErrorReceipt(ctx context.Context, portID, channelID string) (types.ErrorReceipt, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.ChannelUpgradeErrorKey(portID, channelID)) + if err != nil { + panic(err) + } + + if len(bz) == 0 { +>>>>>>> main return types.ErrorReceipt{}, false } @@ -562,7 +711,9 @@ func (k *Keeper) GetUpgradeErrorReceipt(ctx context.Context, portID, channelID s func (k *Keeper) setUpgradeErrorReceipt(ctx context.Context, portID, channelID string, errorReceipt types.ErrorReceipt) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(&errorReceipt) - store.Set(host.ChannelUpgradeErrorKey(portID, channelID), bz) + if err := store.Set(host.ChannelUpgradeErrorKey(portID, channelID), bz); err != nil { + panic(err) + } } // hasUpgrade returns true if a proposed upgrade exists in store @@ -576,6 +727,7 @@ func (k *Keeper) hasUpgrade(ctx context.Context, portID, channelID string) bool } // GetUpgrade returns the proposed upgrade for the provided port and channel identifiers. +<<<<<<< HEAD func (k *Keeper) GetUpgrade(ctx context.Context, portID, channelID string) (types.Upgrade, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.ChannelUpgradeKey(portID, channelID)) @@ -583,6 +735,21 @@ func (k *Keeper) GetUpgrade(ctx context.Context, portID, channelID string) (type return types.Upgrade{}, false } if bz == nil { +||||||| 2028e9a34 +func (k *Keeper) GetUpgrade(ctx sdk.Context, portID, channelID string) (types.Upgrade, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.ChannelUpgradeKey(portID, channelID)) + if bz == nil { +======= +func (k *Keeper) GetUpgrade(ctx context.Context, portID, channelID string) (types.Upgrade, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.ChannelUpgradeKey(portID, channelID)) + if err != nil { + panic(err) + } + + if len(bz) == 0 { +>>>>>>> main return types.Upgrade{}, false } @@ -596,13 +763,27 @@ func (k *Keeper) GetUpgrade(ctx context.Context, portID, channelID string) (type func (k *Keeper) SetUpgrade(ctx context.Context, portID, channelID string, upgrade types.Upgrade) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(&upgrade) - store.Set(host.ChannelUpgradeKey(portID, channelID), bz) + if err := store.Set(host.ChannelUpgradeKey(portID, channelID), bz); err != nil { + panic(err) + } } // deleteUpgrade deletes the upgrade for the provided port and channel identifiers. +<<<<<<< HEAD func (k *Keeper) deleteUpgrade(ctx context.Context, portID, channelID string) { store := k.storeService.OpenKVStore(ctx) store.Delete(host.ChannelUpgradeKey(portID, channelID)) +||||||| 2028e9a34 +func (k *Keeper) deleteUpgrade(ctx sdk.Context, portID, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Delete(host.ChannelUpgradeKey(portID, channelID)) +======= +func (k *Keeper) deleteUpgrade(ctx context.Context, portID, channelID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Delete(host.ChannelUpgradeKey(portID, channelID)); err != nil { + panic(err) + } +>>>>>>> main } // hasCounterpartyUpgrade returns true if a counterparty upgrade exists in store @@ -616,6 +797,7 @@ func (k *Keeper) hasCounterpartyUpgrade(ctx context.Context, portID, channelID s } // GetCounterpartyUpgrade gets the counterparty upgrade from the store. +<<<<<<< HEAD func (k *Keeper) GetCounterpartyUpgrade(ctx context.Context, portID, channelID string) (types.Upgrade, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.ChannelCounterpartyUpgradeKey(portID, channelID)) @@ -623,6 +805,21 @@ func (k *Keeper) GetCounterpartyUpgrade(ctx context.Context, portID, channelID s return types.Upgrade{}, false } if bz == nil { +||||||| 2028e9a34 +func (k *Keeper) GetCounterpartyUpgrade(ctx sdk.Context, portID, channelID string) (types.Upgrade, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.ChannelCounterpartyUpgradeKey(portID, channelID)) + if bz == nil { +======= +func (k *Keeper) GetCounterpartyUpgrade(ctx context.Context, portID, channelID string) (types.Upgrade, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.ChannelCounterpartyUpgradeKey(portID, channelID)) + if err != nil { + panic(err) + } + + if len(bz) == 0 { +>>>>>>> main return types.Upgrade{}, false } @@ -636,13 +833,27 @@ func (k *Keeper) GetCounterpartyUpgrade(ctx context.Context, portID, channelID s func (k *Keeper) SetCounterpartyUpgrade(ctx context.Context, portID, channelID string, upgrade types.Upgrade) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(&upgrade) - store.Set(host.ChannelCounterpartyUpgradeKey(portID, channelID), bz) + if err := store.Set(host.ChannelCounterpartyUpgradeKey(portID, channelID), bz); err != nil { + panic(err) + } } // deleteCounterpartyUpgrade deletes the counterparty upgrade in the store. +<<<<<<< HEAD func (k *Keeper) deleteCounterpartyUpgrade(ctx context.Context, portID, channelID string) { store := k.storeService.OpenKVStore(ctx) store.Delete(host.ChannelCounterpartyUpgradeKey(portID, channelID)) +||||||| 2028e9a34 +func (k *Keeper) deleteCounterpartyUpgrade(ctx sdk.Context, portID, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Delete(host.ChannelCounterpartyUpgradeKey(portID, channelID)) +======= +func (k *Keeper) deleteCounterpartyUpgrade(ctx context.Context, portID, channelID string) { + store := k.storeService.OpenKVStore(ctx) + if err := store.Delete(host.ChannelCounterpartyUpgradeKey(portID, channelID)); err != nil { + panic(err) + } +>>>>>>> main } // deleteUpgradeInfo deletes all auxiliary upgrade information. @@ -655,16 +866,32 @@ func (k *Keeper) deleteUpgradeInfo(ctx context.Context, portID, channelID string func (k *Keeper) SetParams(ctx context.Context, params types.Params) { store := k.storeService.OpenKVStore(ctx) bz := k.cdc.MustMarshal(¶ms) - store.Set([]byte(types.ParamsKey), bz) + if err := store.Set([]byte(types.ParamsKey), bz); err != nil { + panic(err) + } } // GetParams returns the total set of the channel parameters. +<<<<<<< HEAD +func (k *Keeper) GetParams(ctx context.Context) types.Params { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get([]byte(types.ParamsKey)) + if err != nil { + panic(err) + } +||||||| 2028e9a34 +func (k *Keeper) GetParams(ctx sdk.Context) types.Params { + store := ctx.KVStore(k.storeKey) + bz := store.Get([]byte(types.ParamsKey)) +======= func (k *Keeper) GetParams(ctx context.Context) types.Params { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get([]byte(types.ParamsKey)) if err != nil { panic(err) } + +>>>>>>> main if bz == nil { // only panic on unset params and not on empty params panic(errors.New("channel params are not set in store")) } @@ -708,19 +935,35 @@ func (k *Keeper) HasInflightPackets(ctx context.Context, portID, channelID strin func (k *Keeper) setRecvStartSequence(ctx context.Context, portID, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) bz := sdk.Uint64ToBigEndian(sequence) - store.Set(host.RecvStartSequenceKey(portID, channelID), bz) + if err := store.Set(host.RecvStartSequenceKey(portID, channelID), bz); err != nil { + panic(err) + } } // GetRecvStartSequence gets a channel's recv start sequence from the store. // The recv start sequence will be set to the counterparty's next sequence send // upon a successful channel upgrade. It will be used for replay protection of // historical packets and as the upper bound for pruning stale packet receives. +<<<<<<< HEAD func (k *Keeper) GetRecvStartSequence(ctx context.Context, portID, channelID string) (uint64, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.RecvStartSequenceKey(portID, channelID)) if err != nil { return 0, false } +||||||| 2028e9a34 +func (k *Keeper) GetRecvStartSequence(ctx sdk.Context, portID, channelID string) (uint64, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.RecvStartSequenceKey(portID, channelID)) +======= +func (k *Keeper) GetRecvStartSequence(ctx context.Context, portID, channelID string) (uint64, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.RecvStartSequenceKey(portID, channelID)) + if err != nil { + panic(err) + } + +>>>>>>> main if len(bz) == 0 { return 0, false } @@ -732,16 +975,32 @@ func (k *Keeper) GetRecvStartSequence(ctx context.Context, portID, channelID str func (k *Keeper) SetPruningSequenceStart(ctx context.Context, portID, channelID string, sequence uint64) { store := k.storeService.OpenKVStore(ctx) bz := sdk.Uint64ToBigEndian(sequence) - store.Set(host.PruningSequenceStartKey(portID, channelID), bz) + if err := store.Set(host.PruningSequenceStartKey(portID, channelID), bz); err != nil { + panic(err) + } } // GetPruningSequenceStart gets a channel's pruning sequence start from the store. +<<<<<<< HEAD func (k *Keeper) GetPruningSequenceStart(ctx context.Context, portID, channelID string) (uint64, bool) { store := k.storeService.OpenKVStore(ctx) bz, err := store.Get(host.PruningSequenceStartKey(portID, channelID)) if err != nil { return 0, false } +||||||| 2028e9a34 +func (k *Keeper) GetPruningSequenceStart(ctx sdk.Context, portID, channelID string) (uint64, bool) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(host.PruningSequenceStartKey(portID, channelID)) +======= +func (k *Keeper) GetPruningSequenceStart(ctx context.Context, portID, channelID string) (uint64, bool) { + store := k.storeService.OpenKVStore(ctx) + bz, err := store.Get(host.PruningSequenceStartKey(portID, channelID)) + if err != nil { + panic(err) + } + +>>>>>>> main if len(bz) == 0 { return 0, false } @@ -750,6 +1009,7 @@ func (k *Keeper) GetPruningSequenceStart(ctx context.Context, portID, channelID } // HasPruningSequenceStart returns true if the pruning sequence start is set for the specified channel. +<<<<<<< HEAD func (k *Keeper) HasPruningSequenceStart(ctx context.Context, portID, channelID string) bool { store := k.storeService.OpenKVStore(ctx) has, err := store.Has(host.PruningSequenceStartKey(portID, channelID)) @@ -758,6 +1018,19 @@ func (k *Keeper) HasPruningSequenceStart(ctx context.Context, portID, channelID } return has +||||||| 2028e9a34 +func (k *Keeper) HasPruningSequenceStart(ctx sdk.Context, portID, channelID string) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(host.PruningSequenceStartKey(portID, channelID)) +======= +func (k *Keeper) HasPruningSequenceStart(ctx context.Context, portID, channelID string) bool { + store := k.storeService.OpenKVStore(ctx) + has, err := store.Has(host.PruningSequenceStartKey(portID, channelID)) + if err != nil { + panic(err) + } + return has +>>>>>>> main } // PruneAcknowledgements prunes packet acknowledgements and receipts that have a sequence number less than pruning sequence end. diff --git a/modules/core/04-channel/keeper/packet.go b/modules/core/04-channel/keeper/packet.go index 6a1eca8b771d..a04dae574509 100644 --- a/modules/core/04-channel/keeper/packet.go +++ b/modules/core/04-channel/keeper/packet.go @@ -39,8 +39,15 @@ func (k *Keeper) SendPacket( return 0, errorsmod.Wrapf(types.ErrInvalidChannelState, "channel is not OPEN (got %s)", channel.State) } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if !k.scopedKeeper.AuthenticateCapability(sdkCtx, channelCap, host.ChannelCapabilityPath(sourcePort, sourceChannel)) { +||||||| 2028e9a34 + if !k.scopedKeeper.AuthenticateCapability(ctx, channelCap, host.ChannelCapabilityPath(sourcePort, sourceChannel)) { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if !k.scopedKeeper.AuthenticateCapability(sdkCtx, channelCap, host.ChannelCapabilityPath(sourcePort, sourceChannel)) { +>>>>>>> main return 0, errorsmod.Wrapf(types.ErrChannelCapabilityNotFound, "caller does not own capability for channel, port ID (%s) channel ID (%s)", sourcePort, sourceChannel) } @@ -309,8 +316,15 @@ func (k *Keeper) WriteAcknowledgement( // Authenticate capability to ensure caller has authority to receive packet on this channel capName := host.ChannelCapabilityPath(packet.GetDestPort(), packet.GetDestChannel()) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if !k.scopedKeeper.AuthenticateCapability(sdkCtx, chanCap, capName) { +||||||| 2028e9a34 + if !k.scopedKeeper.AuthenticateCapability(ctx, chanCap, capName) { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if !k.scopedKeeper.AuthenticateCapability(sdkCtx, chanCap, capName) { +>>>>>>> main return errorsmod.Wrapf( types.ErrInvalidChannelCapability, "channel capability failed authentication for capability name %s", capName, diff --git a/modules/core/04-channel/types/expected_keepers.go b/modules/core/04-channel/types/expected_keepers.go index 2c59a519c510..8c8f8f880530 100644 --- a/modules/core/04-channel/types/expected_keepers.go +++ b/modules/core/04-channel/types/expected_keepers.go @@ -1,7 +1,13 @@ package types import ( +<<<<<<< HEAD context "context" +||||||| 2028e9a34 + sdk "github.com/cosmos/cosmos-sdk/types" +======= + "context" +>>>>>>> main capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" diff --git a/modules/core/05-port/keeper/keeper.go b/modules/core/05-port/keeper/keeper.go index 47bafef37794..1069ae00c2a2 100644 --- a/modules/core/05-port/keeper/keeper.go +++ b/modules/core/05-port/keeper/keeper.go @@ -29,15 +29,33 @@ func NewKeeper(sck exported.ScopedKeeper) *Keeper { } // Logger returns a module-specific logger. +<<<<<<< HEAD func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +||||||| 2028e9a34 +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +======= +func (Keeper) Logger(ctx context.Context) log.Logger { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) +>>>>>>> main } // IsBound checks a given port ID is already bounded. +<<<<<<< HEAD func (k *Keeper) IsBound(ctx context.Context, portID string) bool { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC _, ok := k.scopedKeeper.GetCapability(sdkCtx, host.PortPath(portID)) +||||||| 2028e9a34 +func (k *Keeper) IsBound(ctx sdk.Context, portID string) bool { + _, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID)) +======= +func (k *Keeper) IsBound(ctx context.Context, portID string) bool { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, ok := k.scopedKeeper.GetCapability(sdkCtx, host.PortPath(portID)) +>>>>>>> main return ok } @@ -54,9 +72,17 @@ func (k *Keeper) BindPort(ctx context.Context, portID string) *capabilitytypes.C panic(fmt.Errorf("port %s is already bound", portID)) } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC key, err := k.scopedKeeper.NewCapability(sdkCtx, host.PortPath(portID)) +||||||| 2028e9a34 + key, err := k.scopedKeeper.NewCapability(ctx, host.PortPath(portID)) +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + + key, err := k.scopedKeeper.NewCapability(sdkCtx, host.PortPath(portID)) +>>>>>>> main if err != nil { panic(err.Error()) } @@ -74,14 +100,30 @@ func (k *Keeper) Authenticate(ctx context.Context, key *capabilitytypes.Capabili panic(err.Error()) } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return k.scopedKeeper.AuthenticateCapability(sdkCtx, key, host.PortPath(portID)) +||||||| 2028e9a34 + return k.scopedKeeper.AuthenticateCapability(ctx, key, host.PortPath(portID)) +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return k.scopedKeeper.AuthenticateCapability(sdkCtx, key, host.PortPath(portID)) +>>>>>>> main } // LookupModuleByPort will return the IBCModule along with the capability associated with a given portID +<<<<<<< HEAD func (k *Keeper) LookupModuleByPort(ctx context.Context, portID string) (string, *capabilitytypes.Capability, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC modules, capability, err := k.scopedKeeper.LookupModules(sdkCtx, host.PortPath(portID)) +||||||| 2028e9a34 +func (k *Keeper) LookupModuleByPort(ctx sdk.Context, portID string) (string, *capabilitytypes.Capability, error) { + modules, capability, err := k.scopedKeeper.LookupModules(ctx, host.PortPath(portID)) +======= +func (k *Keeper) LookupModuleByPort(ctx context.Context, portID string) (string, *capabilitytypes.Capability, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + modules, capability, err := k.scopedKeeper.LookupModules(sdkCtx, host.PortPath(portID)) +>>>>>>> main if err != nil { return "", nil, err } diff --git a/modules/core/23-commitment/types/merkle_test.go b/modules/core/23-commitment/types/merkle_test.go index 89bfd2720133..dd1ec4e6172c 100644 --- a/modules/core/23-commitment/types/merkle_test.go +++ b/modules/core/23-commitment/types/merkle_test.go @@ -67,10 +67,10 @@ func (suite *MerkleTestSuite) TestVerifyMembership() { err := proof.VerifyMembership(types.GetSDKSpecs(), &root, path, tc.value) if tc.shouldPass { - //nolint: scopelint + // nolint: scopelint suite.Require().NoError(err, "test case %d should have passed", i) } else { - //nolint: scopelint + // nolint: scopelint suite.Require().Error(err, "test case %d should have failed", i) } }) @@ -131,10 +131,10 @@ func (suite *MerkleTestSuite) TestVerifyNonMembership() { err := proof.VerifyNonMembership(types.GetSDKSpecs(), &root, path) if tc.shouldPass { - //nolint: scopelint + // nolint: scopelint suite.Require().NoError(err, "test case %d should have passed", i) } else { - //nolint: scopelint + // nolint: scopelint suite.Require().Error(err, "test case %d should have failed", i) } }) diff --git a/modules/core/keeper/keeper.go b/modules/core/keeper/keeper.go index 902fb772a818..2bebc8893fae 100644 --- a/modules/core/keeper/keeper.go +++ b/modules/core/keeper/keeper.go @@ -5,7 +5,15 @@ import ( "reflect" "strings" +<<<<<<< HEAD corestoretypes "cosmossdk.io/core/store" +||||||| 2028e9a34 + storetypes "cosmossdk.io/store/types" + +======= + corestore "cosmossdk.io/core/store" + +>>>>>>> main "github.com/cosmos/cosmos-sdk/codec" capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" @@ -32,7 +40,13 @@ type Keeper struct { // NewKeeper creates a new ibc Keeper func NewKeeper( +<<<<<<< HEAD cdc codec.BinaryCodec, storeService corestoretypes.KVStoreService, paramSpace types.ParamSubspace, +||||||| 2028e9a34 + cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace types.ParamSubspace, +======= + cdc codec.BinaryCodec, storeService corestore.KVStoreService, paramSpace types.ParamSubspace, +>>>>>>> main upgradeKeeper clienttypes.UpgradeKeeper, scopedKeeper capabilitykeeper.ScopedKeeper, authority string, ) *Keeper { diff --git a/modules/core/keeper/keeper_test.go b/modules/core/keeper/keeper_test.go index 4763c822a5be..c7e7323efcae 100644 --- a/modules/core/keeper/keeper_test.go +++ b/modules/core/keeper/keeper_test.go @@ -7,7 +7,13 @@ import ( upgradekeeper "cosmossdk.io/x/upgrade/keeper" +<<<<<<< HEAD "github.com/cosmos/cosmos-sdk/runtime" +||||||| 2028e9a34 +======= + "github.com/cosmos/cosmos-sdk/runtime" + +>>>>>>> main capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported" diff --git a/modules/core/keeper/msg_server_test.go b/modules/core/keeper/msg_server_test.go index ec2195eff0c9..89f80bc0963a 100644 --- a/modules/core/keeper/msg_server_test.go +++ b/modules/core/keeper/msg_server_test.go @@ -1007,8 +1007,15 @@ func (suite *KeeperTestSuite) TestChannelUpgradeInit() { suite.chainA.GetSimApp().IBCMockModule.IBCApp.OnChanUpgradeInit = func(ctx context.Context, portID, channelID string, order channeltypes.Order, connectionHops []string, version string) (string, error) { storeKey := suite.chainA.GetSimApp().GetKey(exported.ModuleName) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC store := sdkCtx.KVStore(storeKey) +||||||| 2028e9a34 + store := ctx.KVStore(storeKey) +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + store := sdkCtx.KVStore(storeKey) +>>>>>>> main store.Set(ibcmock.TestKey, ibcmock.TestValue) sdkCtx.EventManager().EmitEvent(sdk.NewEvent(ibcmock.MockEventType)) @@ -1169,8 +1176,15 @@ func (suite *KeeperTestSuite) TestChannelUpgradeTry() { func() { suite.chainA.GetSimApp().IBCMockModule.IBCApp.OnChanUpgradeTry = func(ctx context.Context, portID, channelID string, order channeltypes.Order, connectionHops []string, counterpartyVersion string) (string, error) { storeKey := suite.chainA.GetSimApp().GetKey(exported.ModuleName) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC store := sdkCtx.KVStore(storeKey) +||||||| 2028e9a34 + store := ctx.KVStore(storeKey) +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + store := sdkCtx.KVStore(storeKey) +>>>>>>> main store.Set(ibcmock.TestKey, ibcmock.TestValue) sdkCtx.EventManager().EmitEvent(sdk.NewEvent(ibcmock.MockEventType)) @@ -1390,8 +1404,15 @@ func (suite *KeeperTestSuite) TestChannelUpgradeAck() { ctx context.Context, portID, channelID, counterpartyVersion string, ) error { // set arbitrary value in store to mock application state changes +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC store := sdkCtx.KVStore(suite.chainA.GetSimApp().GetKey(exported.ModuleName)) +||||||| 2028e9a34 + store := ctx.KVStore(suite.chainA.GetSimApp().GetKey(exported.ModuleName)) +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + store := sdkCtx.KVStore(suite.chainA.GetSimApp().GetKey(exported.ModuleName)) +>>>>>>> main store.Set([]byte("foo"), []byte("bar")) return fmt.Errorf("mock app callback failed") } @@ -1465,8 +1486,15 @@ func (suite *KeeperTestSuite) TestChannelUpgradeAck() { func() { suite.chainA.GetSimApp().IBCMockModule.IBCApp.OnChanUpgradeAck = func(ctx context.Context, portID, channelID, counterpartyVersion string) error { storeKey := suite.chainA.GetSimApp().GetKey(exported.ModuleName) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC store := sdkCtx.KVStore(storeKey) +||||||| 2028e9a34 + store := ctx.KVStore(storeKey) +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + store := sdkCtx.KVStore(storeKey) +>>>>>>> main store.Set(ibcmock.TestKey, ibcmock.TestValue) sdkCtx.EventManager().EmitEvent(sdk.NewEvent(ibcmock.MockEventType)) diff --git a/modules/light-clients/06-solomachine/proof.go b/modules/light-clients/06-solomachine/proof.go index 516b8421d0d8..3a3a3cc3d2fd 100644 --- a/modules/light-clients/06-solomachine/proof.go +++ b/modules/light-clients/06-solomachine/proof.go @@ -26,7 +26,7 @@ func VerifySignature(pubKey cryptotypes.PubKey, signBytes []byte, sigData signin if err := pubKey.VerifyMultisignature(func(signing.SignMode) ([]byte, error) { return signBytes, nil }, data); err != nil { - return errorsmod.Wrapf(ErrSignatureVerificationFailed, err.Error()) + return errorsmod.Wrapf(ErrSignatureVerificationFailed, "failed to verify multisignature: %s", err.Error()) } default: diff --git a/modules/light-clients/07-tendermint/client_state.go b/modules/light-clients/07-tendermint/client_state.go index e60a07de19c6..d6db15f557c3 100644 --- a/modules/light-clients/07-tendermint/client_state.go +++ b/modules/light-clients/07-tendermint/client_state.go @@ -94,8 +94,15 @@ func (cs ClientState) status( return exported.Expired } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if cs.IsExpired(consState.Timestamp, sdkCtx.BlockTime()) { +||||||| 2028e9a34 + if cs.IsExpired(consState.Timestamp, ctx.BlockTime()) { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if cs.IsExpired(consState.Timestamp, sdkCtx.BlockTime()) { +>>>>>>> main return exported.Expired } @@ -297,8 +304,15 @@ func verifyDelayPeriodPassed(ctx context.Context, store storetypes.KVStore, proo return errorsmod.Wrapf(ErrProcessedTimeNotFound, "processed time not found for height: %s", proofHeight) } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC currentTimestamp := uint64(sdkCtx.BlockTime().UnixNano()) +||||||| 2028e9a34 + currentTimestamp := uint64(ctx.BlockTime().UnixNano()) +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + currentTimestamp := uint64(sdkCtx.BlockTime().UnixNano()) +>>>>>>> main validTime := processedTime + delayTimePeriod // NOTE: delay time period is inclusive, so if currentTimestamp is validTime, then we return no error diff --git a/modules/light-clients/07-tendermint/light_client_module.go b/modules/light-clients/07-tendermint/light_client_module.go index 98f8552c8df8..fb85758afdff 100644 --- a/modules/light-clients/07-tendermint/light_client_module.go +++ b/modules/light-clients/07-tendermint/light_client_module.go @@ -64,8 +64,15 @@ func (l LightClientModule) VerifyClientMessage(ctx context.Context, clientID str return errorsmod.Wrap(clienttypes.ErrClientNotFound, clientID) } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC return clientState.VerifyClientMessage(sdkCtx, l.cdc, clientStore, clientMsg) +||||||| 2028e9a34 + return clientState.VerifyClientMessage(ctx, l.cdc, clientStore, clientMsg) +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return clientState.VerifyClientMessage(sdkCtx, l.cdc, clientStore, clientMsg) +>>>>>>> main } // CheckForMisbehaviour obtains the client state associated with the client identifier and calls into the clientState.CheckForMisbehaviour method. diff --git a/modules/light-clients/07-tendermint/misbehaviour_handle.go b/modules/light-clients/07-tendermint/misbehaviour_handle.go index c9fad90dbaa3..f86b23763c95 100644 --- a/modules/light-clients/07-tendermint/misbehaviour_handle.go +++ b/modules/light-clients/07-tendermint/misbehaviour_handle.go @@ -110,7 +110,12 @@ func (cs *ClientState) verifyMisbehaviour(ctx context.Context, clientStore store // NOTE: header height and commitment root assertions are checked in // misbehaviour.ValidateBasic by the client keeper and msg.ValidateBasic // by the base application. +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC +||||||| 2028e9a34 +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 +>>>>>>> main if err := checkMisbehaviourHeader( cs, tmConsensusState1, misbehaviour.Header1, sdkCtx.BlockTime(), ); err != nil { diff --git a/modules/light-clients/07-tendermint/store.go b/modules/light-clients/07-tendermint/store.go index 8366429785a6..3a4401cf64c5 100644 --- a/modules/light-clients/07-tendermint/store.go +++ b/modules/light-clients/07-tendermint/store.go @@ -323,9 +323,18 @@ func bigEndianHeightBytes(height exported.Height) []byte { // as this is internal tendermint light client logic. // client state and consensus state will be set by client keeper // set iteration key to provide ability for efficient ordered iteration of consensus states. +<<<<<<< HEAD func setConsensusMetadata(ctx context.Context, clientStore storetypes.KVStore, height exported.Height) { sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC setConsensusMetadataWithValues(clientStore, height, clienttypes.GetSelfHeight(ctx), uint64(sdkCtx.BlockTime().UnixNano())) +||||||| 2028e9a34 +func setConsensusMetadata(ctx sdk.Context, clientStore storetypes.KVStore, height exported.Height) { + setConsensusMetadataWithValues(clientStore, height, clienttypes.GetSelfHeight(ctx), uint64(ctx.BlockTime().UnixNano())) +======= +func setConsensusMetadata(ctx context.Context, clientStore storetypes.KVStore, height exported.Height) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + setConsensusMetadataWithValues(clientStore, height, clienttypes.GetSelfHeight(ctx), uint64(sdkCtx.BlockTime().UnixNano())) +>>>>>>> main } // setConsensusMetadataWithValues sets the consensus metadata with the provided values diff --git a/modules/light-clients/07-tendermint/update.go b/modules/light-clients/07-tendermint/update.go index fcb79909aef3..979c67d271ea 100644 --- a/modules/light-clients/07-tendermint/update.go +++ b/modules/light-clients/07-tendermint/update.go @@ -47,8 +47,15 @@ func (cs *ClientState) verifyHeader( ctx context.Context, clientStore storetypes.KVStore, cdc codec.BinaryCodec, header *Header, ) error { +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC currentTimestamp := sdkCtx.BlockTime() +||||||| 2028e9a34 + currentTimestamp := ctx.BlockTime() +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + currentTimestamp := sdkCtx.BlockTime() +>>>>>>> main // Retrieve trusted consensus states for each Header in misbehaviour consState, found := GetConsensusState(clientStore, cdc, header.TrustedHeight) @@ -143,8 +150,15 @@ func (cs ClientState) UpdateState(ctx context.Context, cdc codec.BinaryCodec, cl // performance: do not prune in checkTx // simulation must prune for accurate gas estimation +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if (!sdkCtx.IsCheckTx() && !sdkCtx.IsReCheckTx()) || sdkCtx.ExecMode() == sdk.ExecModeSimulate { +||||||| 2028e9a34 + if (!ctx.IsCheckTx() && !ctx.IsReCheckTx()) || ctx.ExecMode() == sdk.ExecModeSimulate { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if (!sdkCtx.IsCheckTx() && !sdkCtx.IsReCheckTx()) || sdkCtx.ExecMode() == sdk.ExecModeSimulate { +>>>>>>> main cs.pruneOldestConsensusState(ctx, cdc, clientStore) } @@ -193,8 +207,15 @@ func (cs ClientState) pruneOldestConsensusState(ctx context.Context, cdc codec.B panic(errorsmod.Wrapf(clienttypes.ErrConsensusStateNotFound, "failed to retrieve consensus state at height: %s", height)) } +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if cs.IsExpired(consState.Timestamp, sdkCtx.BlockTime()) { +||||||| 2028e9a34 + if cs.IsExpired(consState.Timestamp, ctx.BlockTime()) { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if cs.IsExpired(consState.Timestamp, sdkCtx.BlockTime()) { +>>>>>>> main pruneHeight = height } diff --git a/modules/light-clients/08-wasm/CHANGELOG.md b/modules/light-clients/08-wasm/CHANGELOG.md index b2babf7b08cc..ebdffb3d6cb3 100644 --- a/modules/light-clients/08-wasm/CHANGELOG.md +++ b/modules/light-clients/08-wasm/CHANGELOG.md @@ -38,7 +38,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies -* [\#6848](https://github.com/cosmos/ibc-go/pull/6848) Bump CometBFT to v0.38.10. +* [\#7114](https://github.com/cosmos/ibc-go/pull/7114) Bump WasmVM to v2.1.2. +* [\#6828](https://github.com/cosmos/ibc-go/pull/6828) Bump Cosmos SDK to v0.50.9. +* [\#7126](https://github.com/cosmos/ibc-go/pull/7126) Bump CometBFT to v0.38.11. ### API Breaking diff --git a/modules/light-clients/08-wasm/go.mod b/modules/light-clients/08-wasm/go.mod index f8da059c7bd4..828ab27d0ed1 100644 --- a/modules/light-clients/08-wasm/go.mod +++ b/modules/light-clients/08-wasm/go.mod @@ -10,29 +10,29 @@ replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.2021 require ( cosmossdk.io/api v0.7.5 - cosmossdk.io/client/v2 v2.0.0-beta.2 + cosmossdk.io/client/v2 v2.0.0-beta.3 cosmossdk.io/collections v0.4.0 - cosmossdk.io/core v0.11.0 + cosmossdk.io/core v0.11.1 cosmossdk.io/errors v1.0.1 - cosmossdk.io/log v1.3.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.0 - cosmossdk.io/tools/confix v0.1.1 + cosmossdk.io/tools/confix v0.1.2 cosmossdk.io/x/circuit v0.1.1 cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 - cosmossdk.io/x/tx v0.13.3 - cosmossdk.io/x/upgrade v0.1.3 - github.com/CosmWasm/wasmvm/v2 v2.1.0 - github.com/cometbft/cometbft v0.38.10 + cosmossdk.io/x/tx v0.13.4 + cosmossdk.io/x/upgrade v0.1.4 + github.com/CosmWasm/wasmvm/v2 v2.1.2 + github.com/cometbft/cometbft v0.38.11 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.5.0 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/modules/capability v1.0.1 github.com/cosmos/ibc-go/v9 v9.0.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cast v1.6.0 + github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 @@ -47,7 +47,7 @@ require ( cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.9 // indirect cloud.google.com/go/storage v1.41.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/depinject v1.0.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -188,18 +188,18 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/modules/light-clients/08-wasm/go.sum b/modules/light-clients/08-wasm/go.sum index 07c2318eec25..677c3713dcb0 100644 --- a/modules/light-clients/08-wasm/go.sum +++ b/modules/light-clients/08-wasm/go.sum @@ -188,34 +188,34 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.2 h1:jnTKB0PLb7qunQibijAftwmNjUbsIAf1sPjF5HaCW/E= -cosmossdk.io/client/v2 v2.0.0-beta.2/go.mod h1:8QAyewD7rDWeJGqedFBpeqJ9XLIJAkt1TDhCf1gsN9o= +cosmossdk.io/client/v2 v2.0.0-beta.3 h1:+TTuH0DwQYsUq2JFAl3fDZzKq5gQG7nt3dAattkjFDU= +cosmossdk.io/client/v2 v2.0.0-beta.3/go.mod h1:CZcL41HpJPOOayTCO28j8weNBQprG+SRiKX39votypo= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= -cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -227,8 +227,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmvm/v2 v2.1.0 h1:bleLhNA36hM8iPjFJsNRi9RjrQW6MtXafw2+wVjAWAE= -github.com/CosmWasm/wasmvm/v2 v2.1.0/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= +github.com/CosmWasm/wasmvm/v2 v2.1.2 h1:GkJ5bAsRlLHfIQVg/FY1VHwLyBwlCjAhDea0B8L+e20= +github.com/CosmWasm/wasmvm/v2 v2.1.2/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -337,8 +337,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= -github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -353,15 +353,15 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= -github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= @@ -941,8 +941,8 @@ github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIK github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1053,8 +1053,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1153,8 +1153,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1292,13 +1292,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1558,8 +1558,8 @@ google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGr google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= diff --git a/modules/light-clients/08-wasm/light_client_module.go b/modules/light-clients/08-wasm/light_client_module.go index d9660cec654b..cd88887418e6 100644 --- a/modules/light-clients/08-wasm/light_client_module.go +++ b/modules/light-clients/08-wasm/light_client_module.go @@ -2,6 +2,7 @@ package wasm import ( "bytes" + "context" "encoding/hex" "encoding/json" "fmt" @@ -38,7 +39,7 @@ func NewLightClientModule(keeper wasmkeeper.Keeper, storeProvider clienttypes.St // Initialize unmarshals the provided client and consensus states and performs basic validation. It sets the client // state and consensus state in the client store. // It also initializes the wasm contract for the client. -func (l LightClientModule) Initialize(ctx sdk.Context, clientID string, clientStateBz, consensusStateBz []byte) error { +func (l LightClientModule) Initialize(ctx context.Context, clientID string, clientStateBz, consensusStateBz []byte) error { var clientState types.ClientState if err := l.keeper.Codec().Unmarshal(clientStateBz, &clientState); err != nil { return err @@ -70,7 +71,8 @@ func (l LightClientModule) Initialize(ctx sdk.Context, clientID string, clientSt Checksum: clientState.Checksum, } - return l.keeper.WasmInstantiate(ctx, clientID, clientStore, &clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return l.keeper.WasmInstantiate(sdkCtx, clientID, clientStore, &clientState, payload) } // VerifyClientMessage obtains the client state associated with the client identifier, it then must verify the ClientMessage. @@ -78,7 +80,7 @@ func (l LightClientModule) Initialize(ctx sdk.Context, clientID string, clientSt // It must handle each type of ClientMessage appropriately. Calls to CheckForMisbehaviour, UpdateState, and UpdateStateOnMisbehaviour // will assume that the content of the ClientMessage has been verified and can be trusted. An error should be returned // if the ClientMessage fails to verify. -func (l LightClientModule) VerifyClientMessage(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error { +func (l LightClientModule) VerifyClientMessage(ctx context.Context, clientID string, clientMsg exported.ClientMessage) error { clientStore := l.storeProvider.ClientStore(ctx, clientID) cdc := l.keeper.Codec() @@ -95,13 +97,14 @@ func (l LightClientModule) VerifyClientMessage(ctx sdk.Context, clientID string, payload := types.QueryMsg{ VerifyClientMessage: &types.VerifyClientMessageMsg{ClientMessage: clientMessage.Data}, } - _, err := l.keeper.WasmQuery(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, err := l.keeper.WasmQuery(sdkCtx, clientID, clientStore, clientState, payload) return err } // CheckForMisbehaviour obtains the client state associated with the client identifier, it detects misbehaviour in a submitted Header // message and verifies the correctness of a submitted Misbehaviour ClientMessage. -func (l LightClientModule) CheckForMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) bool { +func (l LightClientModule) CheckForMisbehaviour(ctx context.Context, clientID string, clientMsg exported.ClientMessage) bool { clientStore := l.storeProvider.ClientStore(ctx, clientID) cdc := l.keeper.Codec() @@ -119,7 +122,8 @@ func (l LightClientModule) CheckForMisbehaviour(ctx sdk.Context, clientID string CheckForMisbehaviour: &types.CheckForMisbehaviourMsg{ClientMessage: clientMessage.Data}, } - res, err := l.keeper.WasmQuery(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + res, err := l.keeper.WasmQuery(sdkCtx, clientID, clientStore, clientState, payload) if err != nil { return false } @@ -135,7 +139,7 @@ func (l LightClientModule) CheckForMisbehaviour(ctx sdk.Context, clientID string // UpdateStateOnMisbehaviour obtains the client state associated with the client identifier performs appropriate state changes on // a client state given that misbehaviour has been detected and verified. // Client state is updated in the store by the contract. -func (l LightClientModule) UpdateStateOnMisbehaviour(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) { +func (l LightClientModule) UpdateStateOnMisbehaviour(ctx context.Context, clientID string, clientMsg exported.ClientMessage) { clientStore := l.storeProvider.ClientStore(ctx, clientID) cdc := l.keeper.Codec() @@ -153,7 +157,8 @@ func (l LightClientModule) UpdateStateOnMisbehaviour(ctx sdk.Context, clientID s UpdateStateOnMisbehaviour: &types.UpdateStateOnMisbehaviourMsg{ClientMessage: clientMessage.Data}, } - _, err := l.keeper.WasmSudo(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, err := l.keeper.WasmSudo(sdkCtx, clientID, clientStore, clientState, payload) if err != nil { panic(err) } @@ -161,7 +166,7 @@ func (l LightClientModule) UpdateStateOnMisbehaviour(ctx sdk.Context, clientID s // UpdateState obtains the client state associated with the client identifier and calls into the appropriate // contract endpoint. Client state and new consensus states are updated in the store by the contract. -func (l LightClientModule) UpdateState(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height { +func (l LightClientModule) UpdateState(ctx context.Context, clientID string, clientMsg exported.ClientMessage) []exported.Height { clientStore := l.storeProvider.ClientStore(ctx, clientID) cdc := l.keeper.Codec() @@ -179,7 +184,8 @@ func (l LightClientModule) UpdateState(ctx sdk.Context, clientID string, clientM UpdateState: &types.UpdateStateMsg{ClientMessage: clientMessage.Data}, } - res, err := l.keeper.WasmSudo(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + res, err := l.keeper.WasmSudo(sdkCtx, clientID, clientStore, clientState, payload) if err != nil { panic(err) } @@ -202,7 +208,7 @@ func (l LightClientModule) UpdateState(ctx sdk.Context, clientID string, clientM // The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). // If a zero proof height is passed in, it will fail to retrieve the associated consensus state. func (l LightClientModule) VerifyMembership( - ctx sdk.Context, + ctx context.Context, clientID string, height exported.Height, delayTimePeriod uint64, @@ -247,7 +253,8 @@ func (l LightClientModule) VerifyMembership( }, } - _, err := l.keeper.WasmSudo(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, err := l.keeper.WasmSudo(sdkCtx, clientID, clientStore, clientState, payload) return err } @@ -256,7 +263,7 @@ func (l LightClientModule) VerifyMembership( // The caller is expected to construct the full CommitmentPath from a CommitmentPrefix and a standardized path (as defined in ICS 24). // If a zero proof height is passed in, it will fail to retrieve the associated consensus state. func (l LightClientModule) VerifyNonMembership( - ctx sdk.Context, + ctx context.Context, clientID string, height exported.Height, delayTimePeriod uint64, @@ -299,7 +306,8 @@ func (l LightClientModule) VerifyNonMembership( }, } - _, err := l.keeper.WasmSudo(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, err := l.keeper.WasmSudo(sdkCtx, clientID, clientStore, clientState, payload) return err } @@ -313,7 +321,7 @@ func (l LightClientModule) VerifyNonMembership( // // A frozen client will become expired, so the Frozen status // has higher precedence. -func (l LightClientModule) Status(ctx sdk.Context, clientID string) exported.Status { +func (l LightClientModule) Status(ctx context.Context, clientID string) exported.Status { clientStore := l.storeProvider.ClientStore(ctx, clientID) cdc := l.keeper.Codec() @@ -328,7 +336,8 @@ func (l LightClientModule) Status(ctx sdk.Context, clientID string) exported.Sta } payload := types.QueryMsg{Status: &types.StatusMsg{}} - res, err := l.keeper.WasmQuery(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + res, err := l.keeper.WasmQuery(sdkCtx, clientID, clientStore, clientState, payload) if err != nil { return exported.Unknown } @@ -343,7 +352,7 @@ func (l LightClientModule) Status(ctx sdk.Context, clientID string) exported.Sta // LatestHeight returns the latest height for the client state for the given client identifier. // If no client is present for the provided client identifier a zero value height is returned. -func (l LightClientModule) LatestHeight(ctx sdk.Context, clientID string) exported.Height { +func (l LightClientModule) LatestHeight(ctx context.Context, clientID string) exported.Height { clientStore := l.storeProvider.ClientStore(ctx, clientID) cdc := l.keeper.Codec() @@ -357,7 +366,7 @@ func (l LightClientModule) LatestHeight(ctx sdk.Context, clientID string) export // TimestampAtHeight obtains the client state associated with the client identifier and calls into the appropriate contract endpoint. // It returns the timestamp in nanoseconds of the consensus state at the given height. -func (l LightClientModule) TimestampAtHeight(ctx sdk.Context, clientID string, height exported.Height) (uint64, error) { +func (l LightClientModule) TimestampAtHeight(ctx context.Context, clientID string, height exported.Height) (uint64, error) { clientStore := l.storeProvider.ClientStore(ctx, clientID) cdc := l.keeper.Codec() @@ -377,7 +386,8 @@ func (l LightClientModule) TimestampAtHeight(ctx sdk.Context, clientID string, h }, } - res, err := l.keeper.WasmQuery(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + res, err := l.keeper.WasmQuery(sdkCtx, clientID, clientStore, clientState, payload) if err != nil { return 0, errorsmod.Wrapf(err, "height (%s)", height) } @@ -394,7 +404,7 @@ func (l LightClientModule) TimestampAtHeight(ctx sdk.Context, clientID string, h // subject client and calls into the appropriate contract endpoint. // It will verify that a substitute client state is valid and update the subject client state. // Note that this method is used only for recovery and will not allow changes to the checksum. -func (l LightClientModule) RecoverClient(ctx sdk.Context, clientID, substituteClientID string) error { +func (l LightClientModule) RecoverClient(ctx context.Context, clientID, substituteClientID string) error { substituteClientType, _, err := clienttypes.ParseClientIdentifier(substituteClientID) if err != nil { return err @@ -430,7 +440,8 @@ func (l LightClientModule) RecoverClient(ctx sdk.Context, clientID, substituteCl MigrateClientStore: &types.MigrateClientStoreMsg{}, } - _, err = l.keeper.WasmSudo(ctx, clientID, store, subjectClientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, err = l.keeper.WasmSudo(sdkCtx, clientID, store, subjectClientState, payload) return err } @@ -438,7 +449,7 @@ func (l LightClientModule) RecoverClient(ctx sdk.Context, clientID, substituteCl // The new client and consensus states will be unmarshaled and an error is returned if the new client state is not at a height greater // than the existing client. On a successful verification, it expects the contract to update the new client state, consensus state, and any other client metadata. func (l LightClientModule) VerifyUpgradeAndUpdateState( - ctx sdk.Context, + ctx context.Context, clientID string, newClient []byte, newConsState []byte, @@ -478,6 +489,7 @@ func (l LightClientModule) VerifyUpgradeAndUpdateState( }, } - _, err := l.keeper.WasmSudo(ctx, clientID, clientStore, clientState, payload) + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + _, err := l.keeper.WasmSudo(sdkCtx, clientID, clientStore, clientState, payload) return err } diff --git a/modules/light-clients/08-wasm/testing/simapp/app.go b/modules/light-clients/08-wasm/testing/simapp/app.go index 1ebf3d9fd352..d7b4f88fe690 100644 --- a/modules/light-clients/08-wasm/testing/simapp/app.go +++ b/modules/light-clients/08-wasm/testing/simapp/app.go @@ -412,7 +412,7 @@ func NewSimApp( app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String()) app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibcexported.StoreKey], app.GetSubspace(ibcexported.ModuleName), app.UpgradeKeeper, scopedIBCKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, runtime.NewKVStoreService(keys[ibcexported.StoreKey]), app.GetSubspace(ibcexported.ModuleName), app.UpgradeKeeper, scopedIBCKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) govConfig := govtypes.DefaultConfig() @@ -475,7 +475,7 @@ func NewSimApp( // IBC Fee Module keeper app.IBCFeeKeeper = ibcfeekeeper.NewKeeper( - appCodec, keys[ibcfeetypes.StoreKey], + appCodec, runtime.NewKVStoreService(keys[ibcfeetypes.StoreKey]), app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, @@ -483,7 +483,7 @@ func NewSimApp( // ICA Controller keeper app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( - appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), + appCodec, runtime.NewKVStoreService(keys[icacontrollertypes.StoreKey]), app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), @@ -492,7 +492,7 @@ func NewSimApp( // ICA Host keeper app.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), + appCodec, runtime.NewKVStoreService(keys[icahosttypes.StoreKey]), app.GetSubspace(icahosttypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), @@ -507,7 +507,7 @@ func NewSimApp( // Create Transfer Keeper and pass IBCFeeKeeper as expected Channel and PortKeeper // since fee middleware will wrap the IBCKeeper for underlying application. app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), + appCodec, runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]), app.GetSubspace(ibctransfertypes.ModuleName), app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, diff --git a/modules/light-clients/08-wasm/types/expected_keepers.go b/modules/light-clients/08-wasm/types/expected_keepers.go index a9f8d40872e4..a0a469b4c406 100644 --- a/modules/light-clients/08-wasm/types/expected_keepers.go +++ b/modules/light-clients/08-wasm/types/expected_keepers.go @@ -1,16 +1,16 @@ package types import ( - storetypes "cosmossdk.io/store/types" + "context" - sdk "github.com/cosmos/cosmos-sdk/types" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/ibc-go/v9/modules/core/exported" ) // ClientKeeper defines the expected client keeper type ClientKeeper interface { - ClientStore(ctx sdk.Context, clientID string) storetypes.KVStore - GetClientState(ctx sdk.Context, clientID string) (exported.ClientState, bool) - SetClientState(ctx sdk.Context, clientID string, clientState exported.ClientState) + ClientStore(ctx context.Context, clientID string) storetypes.KVStore + GetClientState(ctx context.Context, clientID string) (exported.ClientState, bool) + SetClientState(ctx context.Context, clientID string, clientState exported.ClientState) } diff --git a/modules/light-clients/09-localhost/light_client_module.go b/modules/light-clients/09-localhost/light_client_module.go index 14a80c5b97e8..e9a6197b9c67 100644 --- a/modules/light-clients/09-localhost/light_client_module.go +++ b/modules/light-clients/09-localhost/light_client_module.go @@ -33,15 +33,37 @@ var _ exported.LightClientModule = (*LightClientModule)(nil) // LightClientModule implements the core IBC api.LightClientModule interface. type LightClientModule struct { +<<<<<<< HEAD cdc codec.BinaryCodec kvstoreService corestore.KVStoreService +||||||| 2028e9a34 + cdc codec.BinaryCodec + key storetypes.StoreKey +======= + cdc codec.BinaryCodec + storeService corestore.KVStoreService +>>>>>>> main } // NewLightClientModule creates and returns a new 09-localhost LightClientModule. +<<<<<<< HEAD func NewLightClientModule(cdc codec.BinaryCodec, key corestore.KVStoreService) *LightClientModule { +||||||| 2028e9a34 +func NewLightClientModule(cdc codec.BinaryCodec, key storetypes.StoreKey) *LightClientModule { +======= +func NewLightClientModule(cdc codec.BinaryCodec, storeService corestore.KVStoreService) *LightClientModule { +>>>>>>> main return &LightClientModule{ +<<<<<<< HEAD cdc: cdc, kvstoreService: key, +||||||| 2028e9a34 + cdc: cdc, + key: key, +======= + cdc: cdc, + storeService: storeService, +>>>>>>> main } } @@ -83,7 +105,13 @@ func (l LightClientModule) VerifyMembership( path exported.Path, value []byte, ) error { +<<<<<<< HEAD ibcStore := l.kvstoreService.OpenKVStore(ctx) +||||||| 2028e9a34 + ibcStore := ctx.KVStore(l.key) +======= + ibcStore := l.storeService.OpenKVStore(ctx) +>>>>>>> main // ensure the proof provided is the expected sentinel localhost client proof if !bytes.Equal(proof, SentinelProof) { @@ -100,10 +128,19 @@ func (l LightClientModule) VerifyMembership( } // The commitment prefix (eg: "ibc") is omitted when operating on the core IBC store +<<<<<<< HEAD bz, err := ibcStore.Get(merklePath.KeyPath[1]) if err != nil { return errorsmod.Wrapf(err, "error getting value for path %s", path) } +||||||| 2028e9a34 + bz := ibcStore.Get(merklePath.KeyPath[1]) +======= + bz, err := ibcStore.Get(merklePath.KeyPath[1]) + if err != nil { + panic(err) + } +>>>>>>> main if bz == nil { return errorsmod.Wrapf(clienttypes.ErrFailedMembershipVerification, "value not found for path %s", path) } @@ -127,7 +164,13 @@ func (l LightClientModule) VerifyNonMembership( proof []byte, path exported.Path, ) error { +<<<<<<< HEAD ibcStore := l.kvstoreService.OpenKVStore(ctx) +||||||| 2028e9a34 + ibcStore := ctx.KVStore(l.key) +======= + ibcStore := l.storeService.OpenKVStore(ctx) +>>>>>>> main // ensure the proof provided is the expected sentinel localhost client proof if !bytes.Equal(proof, SentinelProof) { @@ -167,9 +210,18 @@ func (LightClientModule) LatestHeight(ctx context.Context, _ string) exported.He // TimestampAtHeight returns the current block time retrieved from the application context. The localhost client does not store consensus states and thus // cannot provide a timestamp for the provided height. +<<<<<<< HEAD func (LightClientModule) TimestampAtHeight(ctx context.Context, _ string, _ exported.Height) (uint64, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: remove after sdk.Context is removed from core IBC return uint64(sdkCtx.BlockTime().UnixNano()), nil +||||||| 2028e9a34 +func (LightClientModule) TimestampAtHeight(ctx sdk.Context, _ string, _ exported.Height) (uint64, error) { + return uint64(ctx.BlockTime().UnixNano()), nil +======= +func (LightClientModule) TimestampAtHeight(ctx context.Context, _ string, _ exported.Height) (uint64, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + return uint64(sdkCtx.BlockTime().UnixNano()), nil +>>>>>>> main } // RecoverClient returns an error. The localhost cannot be modified by proposals. diff --git a/proto/ibc/core/connection/v1/tx.proto b/proto/ibc/core/connection/v1/tx.proto index 151f72fb2d06..894a8bcddd6b 100644 --- a/proto/ibc/core/connection/v1/tx.proto +++ b/proto/ibc/core/connection/v1/tx.proto @@ -74,7 +74,7 @@ message MsgConnectionOpenTry { // Deprecated: this field is unused. bytes proof_consensus = 10 [deprecated = true]; // Deprecated: this field is unused. - ibc.core.client.v1.Height consensus_height = 11 [deprecated = true]; + ibc.core.client.v1.Height consensus_height = 11 [deprecated = true, (gogoproto.nullable) = false]; string signer = 12; // Deprecated: this field is unused. bytes host_consensus_state_proof = 13 [deprecated = true]; @@ -104,7 +104,7 @@ message MsgConnectionOpenAck { // Deprecated: this field is unused. bytes proof_consensus = 8 [deprecated = true]; // Deprecated: this field is unused. - ibc.core.client.v1.Height consensus_height = 9 [deprecated = true]; + ibc.core.client.v1.Height consensus_height = 9 [deprecated = true, (gogoproto.nullable) = false]; string signer = 10; // Deprecated: this field is unused. bytes host_consensus_state_proof = 11 [deprecated = true]; diff --git a/simapp/app.go b/simapp/app.go index 9d8e4fd7d633..816cb4a49be1 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -433,7 +433,7 @@ func NewSimApp( // ICA Controller keeper app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( - appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), + appCodec, runtime.NewKVStoreService(keys[icacontrollertypes.StoreKey]), app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), @@ -442,7 +442,7 @@ func NewSimApp( // ICA Host keeper app.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), + appCodec, runtime.NewKVStoreService(keys[icahosttypes.StoreKey]), app.GetSubspace(icahosttypes.SubModuleName), app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), app.GRPCQueryRouter(), @@ -457,7 +457,7 @@ func NewSimApp( // Create Transfer Keeper and pass IBCFeeKeeper as expected Channel and PortKeeper // since fee middleware will wrap the IBCKeeper for underlying application. app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), + appCodec, runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]), app.GetSubspace(ibctransfertypes.ModuleName), app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, diff --git a/simapp/go.mod b/simapp/go.mod index 23d1cb1220e2..0e580f421c60 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -11,23 +11,23 @@ replace ( require ( cosmossdk.io/api v0.7.5 - cosmossdk.io/client/v2 v2.0.0-beta.2 - cosmossdk.io/core v0.11.0 - cosmossdk.io/log v1.3.1 + cosmossdk.io/client/v2 v2.0.0-beta.4 + cosmossdk.io/core v0.11.1 + cosmossdk.io/log v1.4.1 cosmossdk.io/store v1.1.0 - cosmossdk.io/tools/confix v0.1.1 + cosmossdk.io/tools/confix v0.1.2 cosmossdk.io/x/circuit v0.1.1 cosmossdk.io/x/evidence v0.1.1 cosmossdk.io/x/feegrant v0.1.1 - cosmossdk.io/x/tx v0.13.3 - cosmossdk.io/x/upgrade v0.1.3 - github.com/cometbft/cometbft v0.38.10 + cosmossdk.io/x/tx v0.13.4 + cosmossdk.io/x/upgrade v0.1.4 + github.com/cometbft/cometbft v0.38.11 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.5.0 + github.com/cosmos/cosmos-sdk v0.50.9 + github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/modules/capability v1.0.1 github.com/cosmos/ibc-go/v9 v9.0.0 - github.com/spf13/cast v1.6.0 + github.com/spf13/cast v1.7.0 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 @@ -41,7 +41,7 @@ require ( cloud.google.com/go/iam v1.1.9 // indirect cloud.google.com/go/storage v1.41.0 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/depinject v1.0.0-alpha.4 // indirect + cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.3.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect @@ -185,19 +185,19 @@ require ( go.opentelemetry.io/otel/metric v1.24.0 // indirect go.opentelemetry.io/otel/trace v1.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/term v0.21.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.186.0 // indirect google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 58a8e02571bb..6283843c20bc 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -188,34 +188,34 @@ cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1V cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= -cosmossdk.io/client/v2 v2.0.0-beta.2 h1:jnTKB0PLb7qunQibijAftwmNjUbsIAf1sPjF5HaCW/E= -cosmossdk.io/client/v2 v2.0.0-beta.2/go.mod h1:8QAyewD7rDWeJGqedFBpeqJ9XLIJAkt1TDhCf1gsN9o= +cosmossdk.io/client/v2 v2.0.0-beta.4 h1:LGIzWbVTOof/IHQZeoWwxPX0fq607ONXhsfA7eUrQIg= +cosmossdk.io/client/v2 v2.0.0-beta.4/go.mod h1:c753d0sBv3AQRx6X+BOKL1aGpKjZMTZAHGiLPbVi5TE= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= -cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= +cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= -cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= -cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= +cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= +cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= -cosmossdk.io/x/upgrade v0.1.3 h1:q4XpXc6zp0dX6x74uBtfN6+J7ikaQev5Bla6Q0ADLK8= -cosmossdk.io/x/upgrade v0.1.3/go.mod h1:jOdQhnaY5B8CDUoUbed23/Lre0Dk+r6BMQE40iKlVVQ= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= +cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38= +cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -335,8 +335,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= -github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/cometbft/cometbft v0.38.11 h1:6bNDUB8/xq4uYonYwIfGc9OqK1ZH4NkdaMmR1LZIJqk= +github.com/cometbft/cometbft v0.38.11/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -351,15 +351,15 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= -github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= -github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.2.0 h1:kVxTmjTh4k0Dh1VNL046v6BXqKziqMDzxo93oh3kOfM= github.com/cosmos/iavl v1.2.0/go.mod h1:HidWWLVAtODJqFD6Hbne2Y0q3SdxByJepHUOeoH4LiI= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -935,8 +935,8 @@ github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIK github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= -github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= @@ -1047,8 +1047,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1147,8 +1147,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1286,13 +1286,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1552,8 +1552,8 @@ google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 h1:6whtk83KtD3FkGr google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094/go.mod h1:Zs4wYw8z1zr6RNF4cwYb31mvN/EGaKAdQjNCF3DW6K4= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= diff --git a/simapp/upgrades/upgrades.go b/simapp/upgrades/upgrades.go index ddc14baaf8fa..863318da3676 100644 --- a/simapp/upgrades/upgrades.go +++ b/simapp/upgrades/upgrades.go @@ -3,7 +3,6 @@ package upgrades import ( "context" - storetypes "cosmossdk.io/store/types" upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -14,18 +13,12 @@ import ( paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" - "github.com/cosmos/ibc-go/v9/modules/apps/27-interchain-accounts/controller/migrations/v6" clientkeeper "github.com/cosmos/ibc-go/v9/modules/core/02-client/keeper" "github.com/cosmos/ibc-go/v9/modules/core/exported" ibctmmigrations "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint/migrations" ) const ( - // V5 defines the upgrade name for the ibc-go/v5 upgrade handler. - V5 = "normal upgrade" // NOTE: keeping as "normal upgrade" as existing tags depend on this name - // V6 defines the upgrade name for the ibc-go/v6 upgrade handler. - V6 = "v6" // V7 defines the upgrade name for the ibc-go/v7 upgrade handler. V7 = "v7" // V7_1 defines the upgrade name for the ibc-go/v7.1 upgrade handler. @@ -49,26 +42,6 @@ func CreateDefaultUpgradeHandler( } } -// CreateV6UpgradeHandler creates an upgrade handler for the ibc-go/v6 SimApp upgrade. -// NOTE: The v6.MigrateICS27ChannelCapabiliity function can be omitted if chains do not yet implement an ICS27 controller module -func CreateV6UpgradeHandler( - mm *module.Manager, - configurator module.Configurator, - cdc codec.BinaryCodec, - capabilityStoreKey *storetypes.KVStoreKey, - capabilityKeeper *capabilitykeeper.Keeper, - moduleName string, -) upgradetypes.UpgradeHandler { - return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - if err := v6.MigrateICS27ChannelCapability(sdkCtx, cdc, capabilityStoreKey, capabilityKeeper, moduleName); err != nil { - return nil, err - } - - return mm.RunMigrations(ctx, configurator, vm) - } -} - // CreateV7UpgradeHandler creates an upgrade handler for the ibc-go/v7 SimApp upgrade. func CreateV7UpgradeHandler( mm *module.Manager, diff --git a/testing/events.go b/testing/events.go index fa11fd031dbc..7c467c5e48c1 100644 --- a/testing/events.go +++ b/testing/events.go @@ -56,7 +56,7 @@ func ParseChannelIDFromEvents(events []abci.Event) (string, error) { return "", errors.New("channel identifier event attribute not found") } -// ParsePacketFromEvents parses events emitted from a MsgRecvPacket and returns +// ParsePacketFromEvents parses events emitted from a send packet and returns // the first EventTypeSendPacket packet found. // Returns an error if no packet is found. func ParsePacketFromEvents(events []abci.Event) (channeltypes.Packet, error) { diff --git a/testing/mock/ibc_module.go b/testing/mock/ibc_module.go index e714a1385510..ee9dfa9d452f 100644 --- a/testing/mock/ibc_module.go +++ b/testing/mock/ibc_module.go @@ -60,8 +60,15 @@ func (im IBCModule) OnChanOpenInit( if chanCap != nil { // Claim channel capability passed back by IBC module +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if err := im.IBCApp.ScopedKeeper.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +||||||| 2028e9a34 + if err := im.IBCApp.ScopedKeeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if err := im.IBCApp.ScopedKeeper.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +>>>>>>> main return "", err } } @@ -80,8 +87,15 @@ func (im IBCModule) OnChanOpenTry( if chanCap != nil { // Claim channel capability passed back by IBC module +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if err := im.IBCApp.ScopedKeeper.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +||||||| 2028e9a34 + if err := im.IBCApp.ScopedKeeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if err := im.IBCApp.ScopedKeeper.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +>>>>>>> main return "", err } } @@ -133,8 +147,15 @@ func (im IBCModule) OnRecvPacket(ctx context.Context, channelVersion string, pac // set state by claiming capability to check if revert happens return capName := GetMockRecvCanaryCapabilityName(packet) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +||||||| 2028e9a34 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(ctx, capName); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +>>>>>>> main // application callback called twice on same packet sequence // must never occur panic(err) @@ -158,8 +179,15 @@ func (im IBCModule) OnAcknowledgementPacket(ctx context.Context, channelVersion } capName := GetMockAckCanaryCapabilityName(packet) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +||||||| 2028e9a34 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(ctx, capName); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +>>>>>>> main // application callback called twice on same packet sequence // must never occur panic(err) @@ -177,8 +205,15 @@ func (im IBCModule) OnTimeoutPacket(ctx context.Context, channelVersion string, } capName := GetMockTimeoutCanaryCapabilityName(packet) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +||||||| 2028e9a34 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(ctx, capName); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +>>>>>>> main // application callback called twice on same packet sequence // must never occur panic(err) diff --git a/testing/mock/middleware.go b/testing/mock/middleware.go index 2ed1b8d17fb1..daa0ac35bf98 100644 --- a/testing/mock/middleware.go +++ b/testing/mock/middleware.go @@ -51,8 +51,15 @@ func (im BlockUpgradeMiddleware) OnChanOpenInit( if chanCap != nil { // Claim channel capability passed back by IBC module +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if err := im.IBCApp.ScopedKeeper.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +||||||| 2028e9a34 + if err := im.IBCApp.ScopedKeeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if err := im.IBCApp.ScopedKeeper.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +>>>>>>> main return "", err } } @@ -71,8 +78,15 @@ func (im BlockUpgradeMiddleware) OnChanOpenTry( if chanCap != nil { // Claim channel capability passed back by IBC module +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if err := im.IBCApp.ScopedKeeper.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +||||||| 2028e9a34 + if err := im.IBCApp.ScopedKeeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if err := im.IBCApp.ScopedKeeper.ClaimCapability(sdkCtx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil { +>>>>>>> main return "", err } } @@ -124,8 +138,15 @@ func (im BlockUpgradeMiddleware) OnRecvPacket(ctx context.Context, channelVersio // set state by claiming capability to check if revert happens return capName := GetMockRecvCanaryCapabilityName(packet) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +||||||| 2028e9a34 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(ctx, capName); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +>>>>>>> main // application callback called twice on same packet sequence // must never occur panic(err) @@ -147,8 +168,15 @@ func (im BlockUpgradeMiddleware) OnAcknowledgementPacket(ctx context.Context, ch } capName := GetMockAckCanaryCapabilityName(packet) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +||||||| 2028e9a34 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(ctx, capName); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +>>>>>>> main // application callback called twice on same packet sequence // must never occur panic(err) @@ -164,8 +192,15 @@ func (im BlockUpgradeMiddleware) OnTimeoutPacket(ctx context.Context, channelVer } capName := GetMockTimeoutCanaryCapabilityName(packet) +<<<<<<< HEAD sdkCtx := sdk.UnwrapSDKContext(ctx) //TODO: remove after sdk.Context is removed from core IBC if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +||||||| 2028e9a34 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(ctx, capName); err != nil { +======= + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + if _, err := im.IBCApp.ScopedKeeper.NewCapability(sdkCtx, capName); err != nil { +>>>>>>> main // application callback called twice on same packet sequence // must never occur panic(err) diff --git a/testing/utils.go b/testing/utils.go index 773c39b420d8..53d84ab559aa 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -1,8 +1,10 @@ package ibctesting import ( + "errors" "fmt" "math/rand" + "strings" "testing" "github.com/stretchr/testify/require" @@ -81,3 +83,13 @@ func UnmarshalMsgResponses(cdc codec.Codec, data []byte, msgs ...codec.ProtoMars return nil } + +// RequireErrorIsOrContains verifies that the passed error is either a target error or contains its error message. +func RequireErrorIsOrContains(t *testing.T, err, targetError error, msgAndArgs ...interface{}) { + t.Helper() + require.True( + t, + errors.Is(err, targetError) || + strings.Contains(err.Error(), targetError.Error()), + msgAndArgs...) +}