-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ibcratelimit tests. #1977
Fix ibcratelimit tests. #1977
Conversation
WalkthroughThe recent changes in the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Out of diff range and nitpick comments (1)
CHANGELOG.md (1)
Line range hint
102-116
: Fix unordered list style.- - Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956)) - - Bump `google.golang.org/grpc` from 1.62.1 to 1.64.0 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918), [#1972](https://github.com/provenance-io/provenance/pull/1972)) - - Bump `bufbuild/buf-breaking-action` from 1.1.3 to 1.1.4 ([#1894](https://github.com/provenance-io/provenance/pull/1894)) - - Bump `bufbuild/buf-lint-action` from 1.1.0 to 1.1.1 ([#1895](https://github.com/provenance-io/provenance/pull/1895)) - - Bump `bufbuild/buf-setup-action` from 1.30.0 to 1.31.0 ([#1904](https://github.com/provenance-io/provenance/pull/1904), [#1949](https://github.com/provenance-io/provenance/pull/1949)) - - Bump `github.com/cometbft/cometbft` from 0.38.5 to 0.38.7 ([#1912](https://github.com/provenance-io/provenance/pull/1912), [#1959](https://github.com/provenance-io/provenance/pull/1959)) - - Bump `cosmossdk.io/x/upgrade` from 0.1.0 to 0.1.1 ([#1913](https://github.com/provenance-io/provenance/pull/1913)) - - Bump `github.com/hashicorp/go-metrics` from 0.5.2 to 0.5.3 ([#1914](https://github.com/provenance-io/provenance/pull/1914)) - - Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.5 ([#1929](https://github.com/provenance-io/provenance/pull/1929), [#1940](https://github.com/provenance-io/provenance/pull/1940), [#1955](https://github.com/provenance-io/provenance/pull/1955)) - - Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.3 ([#1928](https://github.com/provenance-io/provenance/pull/1928), [#1944](https://github.com/provenance-io/provenance/pull/1944)) - - Bump `cosmwasm-std` from 1.4.1 to 1.4.4 ([#1950](https://github.com/provenance-io/provenance/pull/1950)) - - Bump `golangci/golangci-lint-action` from 4 to 6 ([#1951](https://github.com/provenance-io/provenance/pull/1951), [#1965](https://github.com/provenance-io/provenance/pull/1965)) - - Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.1 ([#1960](https://github.com/provenance-io/provenance/pull/1960), [#1966](https://github.com/provenance-io/provenance/pull/1966)) - - Bump `github.com/hashicorp/go-getter` from 1.7.3 to 1.7.4 ([#1958](https://github.com/provenance-io/provenance/pull/1958)) - - Bump `golang.org/x/text` from 0.14.0 to 0.15.0 ([#1964](https://github.com/provenance-io/provenance/pull/1964)) + * Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956)) + * Bump `google.golang.org/grpc` from 1.62.1 to 1.64.0 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918), [#1972](https://github.com/provenance-io/provenance/pull/1972)) + * Bump `bufbuild/buf-breaking-action` from 1.1.3 to 1.1.4 ([#1894](https://github.com/provenance-io/provenance/pull/1894)) + * Bump `bufbuild/buf-lint-action` from 1.1.0 to 1.1.1 ([#1895](https://github.com/provenance-io/provenance/pull/1895)) + * Bump `bufbuild/buf-setup-action` from 1.30.0 to 1.31.0 ([#1904](https://github.com/provenance-io/provenance/pull/1904), [#1949](https://github.com/provenance-io/provenance/pull/1949)) + * Bump `github.com/cometbft/cometbft` from 0.38.5 to 0.38.7 ([#1912](https://github.com/provenance-io/provenance/pull/1912), [#1959](https://github.com/provenance-io/provenance/pull/1959)) + * Bump `cosmossdk.io/x/upgrade` from 0.1.0 to 0.1.1 ([#1913](https://github.com/provenance-io/provenance/pull/1913)) + * Bump `github.com/hashicorp/go-metrics` from 0.5.2 to 0.5.3 ([#1914](https://github.com/provenance-io/provenance/pull/1914)) + * Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.5 ([#1929](https://github.com/provenance-io/provenance/pull/1929), [#1940](https://github.com/provenance-io/provenance/pull/1940), [#1955](https://github.com/provenance-io/provenance/pull/1955)) + * Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.3 ([#1928](https://github.com/provenance-io/provenance/pull/1928), [#1944](https://github.com/provenance-io/provenance/pull/1944)) + * Bump `cosmwasm-std` from 1.4.1 to 1.4.4 ([#1950](https://github.com/provenance-io/provenance/pull/1950)) + * Bump `golangci/golangci-lint-action` from 4 to 6 ([#1951](https://github.com/provenance-io/provenance/pull/1951), [#1965](https://github.com/provenance-io/provenance/pull/1965)) + * Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.1 ([#1960](https://github.com/provenance-io/provenance/pull/1960), [#1966](https://github.com/provenance-io/provenance/pull/1966)) + * Bump `github.com/hashicorp/go-getter` from 1.7.3 to 1.7.4 ([#1958](https://github.com/provenance-io/provenance/pull/1958)) + * Bump `golang.org/x/text` from 0.14.0 to 0.15.0 ([#1964](https://github.com/provenance-io/provenance/pull/1964))
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (3)
testutil/contracts/rate-limiter/Cargo.lock
is excluded by!**/*.lock
testutil/contracts/rate-limiter/artifacts/rate_limiter-aarch64.wasm
is excluded by!**/*.wasm
testutil/contracts/rate-limiter/artifacts/rate_limiter.wasm
is excluded by!**/*.wasm
Files selected for processing (16)
- CHANGELOG.md (1 hunks)
- app/app.go (5 hunks)
- internal/antewrapper/msg_fees_decorator.go (2 hunks)
- testutil/contracts/rate-limiter/Cargo.toml (1 hunks)
- testutil/contracts/rate-limiter/artifacts/checksums.txt (1 hunks)
- testutil/contracts/rate-limiter/artifacts/checksums_intermediate.txt (1 hunks)
- testutil/contracts/rate-limiter/src/contract_tests.rs (5 hunks)
- testutil/contracts/rate-limiter/src/execute.rs (4 hunks)
- testutil/contracts/rate-limiter/src/helpers.rs (3 hunks)
- testutil/contracts/rate-limiter/src/management.rs (4 hunks)
- testutil/contracts/rate-limiter/src/query.rs (2 hunks)
- testutil/ibc/testchain.go (3 hunks)
- x/ibchooks/ibc_middleware_test.go (1 hunks)
- x/ibchooks/keeper/params.go (1 hunks)
- x/ibcratelimit/module/ibc_middleware.go (2 hunks)
- x/ibcratelimit/module/ibc_middleware_test.go (10 hunks)
Files not reviewed due to errors (4)
- testutil/contracts/rate-limiter/src/management.rs (no review received)
- testutil/contracts/rate-limiter/src/execute.rs (no review received)
- x/ibcratelimit/module/ibc_middleware.go (no review received)
- x/ibchooks/ibc_middleware_test.go (no review received)
Files skipped from review due to trivial changes (3)
- testutil/contracts/rate-limiter/Cargo.toml
- testutil/contracts/rate-limiter/artifacts/checksums.txt
- testutil/contracts/rate-limiter/artifacts/checksums_intermediate.txt
Additional comments not posted (19)
testutil/contracts/rate-limiter/src/query.rs (1)
1-1
: LGTM! The change to useto_json_binary
aligns with the PR's objective to switch serialization methods.Also applies to: 11-11
x/ibchooks/keeper/params.go (1)
5-5
: LGTM! The added imports are necessary for the functions to work correctly.testutil/contracts/rate-limiter/src/helpers.rs (1)
5-5
: LGTM! The change to useto_json_binary
aligns with the PR's objective to switch serialization methods.Also applies to: 21-21, 31-31
internal/antewrapper/msg_fees_decorator.go (1)
4-5
: LGTM! The update toisTestContext
to recognize chain IDs starting with "testchain" is necessary for the tests.Also applies to: 82-84
testutil/ibc/testchain.go (3)
Line range hint
86-127
: Ensure proper error handling and assertions.The changes to
SendMsgsNoCheck
look good, but please verify that all calls to this function have been updated to match the new signature and that error handling is consistent.Verification successful
All calls to
SendMsgsNoCheck
have been updated to match the new signatureThe search results confirm that all instances of
SendMsgsNoCheck
in the codebase have been updated to use the new signature with thesuite
parameter. The error handling and assertions around these calls also appear to be consistent with the new function definition.
x/ibcratelimit/module/ibc_middleware_test.go
x/ibchooks/ibc_middleware_test.go
testutil/ibc/testchain.go
These files correctly use the new signature and handle the returned
abci.ExecTxResult
appropriately.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `SendMsgsNoCheck` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go $'SendMsgsNoCheck'Length of output: 753
Script:
#!/bin/bash # Description: Verify the context of each call to `SendMsgsNoCheck` to ensure they match the new signature. # Extract and review lines around each call to `SendMsgsNoCheck` rg --type go --context 5 $'SendMsgsNoCheck'Length of output: 4406
129-154
: LGTM! ThecommitBlock
function is a good addition for handling block commitments in tests.
160-190
: LGTM! The changes toSignAndDeliver
enhance the granularity of test results.testutil/contracts/rate-limiter/src/contract_tests.rs (3)
6-6
: Import change aligns with deserialization updates.
244-244
: Deserialization method updated tofrom_json
.
314-314
: Deserialization method updated tofrom_json
.x/ibcratelimit/module/ibc_middleware_test.go (6)
17-17
: Import statement forabci
looks good.
24-24
: Import statement fortransfertypes
looks good.
130-146
: FunctionFullSendBToA
changes look good. Ensure all function calls handle the new return type correctly.
151-177
: FunctionFullSendAToB
changes look good. Ensure all function calls handle the new return type correctly.
201-207
: FunctionAssertSend
changes look good. Ensure all function calls handle the new return type correctly.
221-241
: New test functionTestNonICS20
looks good.app/app.go (3)
127-127
: Import statement for IBC Tendermint light client module looks good.
296-296
: Addition ofRateLimitMiddleware
field in theApp
struct looks good.
547-548
: Integration ofRateLimitMiddleware
and addition ofibctm.AppModule{}
in theNew
function looks good.
Can you update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
testutil/contracts/rate-limiter/artifacts/rate_limiter.wasm
is excluded by!**/*.wasm
Files selected for processing (1)
- x/ibcratelimit/module/ibc_middleware_test.go (11 hunks)
Additional comments not posted (28)
x/ibcratelimit/module/ibc_middleware_test.go (28)
62-84
: LGTM! The setup for the test environment is well-structured.
Line range hint
88-98
: LGTM! The message construction for transferring tokens from chain A to chain B is correct.
Line range hint
109-119
: LGTM! The message construction for transferring tokens from chain B to chain A is correct.
130-146
: LGTM! The process for sending a message from chain B to chain A is handled correctly.
151-177
: LGTM! The process for sending a message from chain A to chain B is handled correctly.
185-194
: LGTM! The assertion for the receive operation from chain B to chain A is correct.
201-207
: LGTM! The assertion for the send operation from chain A to chain B is correct.
213-215
: LGTM! The quota message construction is correct.
222-241
: LGTM! The test for rate limit reversion on send failure is correct.
244-247
: LGTM! The test for sending IBC messages without middleware configuration is correct.
251-254
: LGTM! The test for receiving IBC messages without middleware configuration is correct.
Line range hint
258-277
: LGTM! The escrow setup is correct.
Line range hint
282-332
: LGTM! The full send test with rate limiting is correct.
337-339
: LGTM! The test for rate limiting on sends with native tokens is correct.
343-347
: LGTM! The test for rate limiting on sends with non-native tokens is correct.
351-372
: LGTM! The test for rate limit reset is correct.
Line range hint
376-419
: LGTM! The full receive test with rate limiting is correct.
422-426
: LGTM! The test for rate limiting on receives with native tokens is correct.
429-433
: LGTM! The test for rate limiting on receives with non-native tokens is correct.
437-447
: LGTM! The test for sending IBC messages without quotas is correct.
451-520
: LGTM! The test for rate limit reversion on send failure is correct.
523-533
: LGTM! The test for unsetting the rate limiting contract is correct.
538-543
: LGTM! The event finding logic is correct.
Line range hint
547-555
: LGTM! The attribute extraction logic is correct.
Line range hint
558-569
: LGTM! The init message creation logic is correct.
Line range hint
573-593
: LGTM! The channel value calculation logic is correct.
Line range hint
597-604
: LGTM! The transfer path creation logic is correct.
Line range hint
607-613
: LGTM! The logic to skip tests on WSL is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- .github/workflows/test.yml (1 hunks)
Files skipped from review due to trivial changes (1)
- .github/workflows/test.yml
Description
Fixes the tests for the ibcratelimit module.
Related: #1760
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passesSummary by CodeRabbit
New Features
Bug Fixes
ibcratelimit
.Improvements
Testing Enhancements