Closed kpob closed 4 months ago
[!WARNING]
Rate limit exceeded
@kpob has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 12 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between 09061b52c42c3990d016bfe1b72a8f968f54d535 and b1d80fbe76056d1a8f88e155c4385712bca0f833.
This update introduces a new External
module in the codebase, abstracting the complexities of managing contract references and addresses when calling external contracts. Additionally, the ExecutionError
enum is enhanced to handle address-related errors, and several modules have been adjusted to leverage the new External
component, simplifying interactions with external contracts.
File Path | Summary |
---|---|
core/src/external.rs |
Introduced the External module for external contract reference management. |
core/src/error.rs |
Added MissingAddress and AddressAlreadySet variants to ExecutionError . |
core/src/lib.rs |
Included and exported the new external module. |
examples/src/contracts/balance_checker.rs |
Updated BalanceChecker to include a token field of type External<TokenContractRef> and simplified the check_balance method. |
modules/src/cep78/utils.rs |
Modified MockCep78Operator to use External<NftContractContractRef> for nft_contract . |
odra-macros/src/ast/... |
Added SchemaErrorsItem and SchemaEventsItem structs and their implementations. |
odra-schema/src/custom_type.rs |
Added ContractRef and External to the import list and implemented SchemaEvents and SchemaErrors . |
odra/src/lib.rs |
Rearranged exports, added External entity, and adjusted position of GasReport . |
sequenceDiagram
participant BC as BalanceChecker
participant Ext as External<TokenContractRef>
participant TC as TokenContract
BC->>Ext: set(token_address: Address)
Ext->>TC: Store Address
BC->>Ext: check_balance(account: Address)
Ext->>TC: Retrieve token balance
TC->>Ext: Return balance
Ext->>BC: Return balance
External
module, which directly aligns with the desired feature described in this issue.In the realm of code so grand and vast,
External
was born to simplify tasks.
No more fuss with addresses and refs,
Just set it once, let it do the rest.
For contracts now communicate with ease,
Wrapped in elegance, developers at peace.
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?
Action | Details | Gas diff |
---|---|---|
Wasm Deploy | Filename: Benchmark.wasm | :red_circle: +0.01117587 CSPR (0.01%) |
Action | Details | Gas diff |
---|---|---|
Wasm Deploy | Filename: Benchmark.wasm | :red_circle: +0.01117587 CSPR (0.01%) |
Attention: Patch coverage is 98.97959%
with 1 line
in your changes missing coverage. Please review.
Please upload report for BASE (
release/1.2.0@5d2ea53
). Learn more about missing BASE report.
Files | Patch % | Lines |
---|---|---|
core/src/external.rs | 96.96% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What if the external contract has a set() method?
Action | Details | Gas diff |
---|---|---|
Wasm Deploy | Filename: Benchmark.wasm | :green_circle: -0.01117587 CSPR (0.01%) |
Summary by CodeRabbit
New Features
External
module for handling and manipulating references to external contracts.BalanceChecker
to include atoken
field and streamlined thecheck_balance
method.Bug Fixes
MissingAddress
andAddressAlreadySet
to improve address handling.Enhancements
MockCep78Operator
to use theExternal
trait, impacting method calls likemint
,transfer
, andapprove
.SchemaErrorsItem
andSchemaEventsItem
for better error and event management.Refactor
External
entity and reordered others for clarity.