Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group all derived module structs into single trait #509

Conversation

kpob
Copy link
Contributor

@kpob kpob commented Aug 5, 2024

Summary by CodeRabbit

  • New Features

    • Introduced the OdraContract trait to enhance modularity and organization within the deployment architecture.
    • Updated deployment methods to utilize direct contract types rather than host references across various modules, including enhancements in the Cep78 contract's testing framework.
  • Bug Fixes

    • Enhanced error handling by adding the ExecutionError::MaxUserError variant.
  • Documentation

    • Updated the changelog to reflect significant changes in version 1.3.0.
  • Chores

    • Updated version numbers across multiple Cargo.toml files, indicating a coordinated release of dependencies.

kpob added 2 commits August 5, 2024 10:22
* Add OdraContract trait grouping module-related structs
* Change `Deploy` definition to take advantage of `OdraContract`
* Update `deploy` in modules and examples
@kpob kpob linked an issue Aug 5, 2024 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Aug 5, 2024

Walkthrough

The odra project has been updated to version 1.3.0, introducing significant enhancements aimed at improving modularity and clarity. Key changes include the introduction of the OdraContract trait and a revised deployment mechanism that favors direct contract interaction over host references. Additionally, there has been a coordinated version bump across dependencies, reflecting a commitment to a more organized and robust development environment.

Changes

Files Change Summary
CHANGELOG.md, Cargo.toml Updated version numbers to 1.3.0. Highlighted addition of OdraContract trait and modifications to deployment references.
core/src/contract.rs, core/src/error.rs, core/src/host.rs, core/src/lib.rs Added OdraContract trait, improved error handling with ExecutionError::MaxUserError, and refined HostRefLoader and Deployer traits.
benchmark/bin/benchmark.rs Changed contract instantiation from BenchmarkHostRef to Benchmark.
examples/... Replaced HostRef references with direct contract types across various example contracts (e.g., Cep18, Erc20, OwnedToken, etc.).
modules/Cargo.toml Updated package version and dependencies to 1.3.0.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant `OdraContract`
    participant Deployer

    Developer->>OdraContract: Define contract logic
    OdraContract->>Deployer: Use deploy method
    Deployer->>OdraContract: Deploy contract instance
    Deployer->>Developer: Confirm deployment success
Loading

🐰 "In code we hop and play,
With traits and structs, we pave the way.
From HostRef to direct, we leap so bright,
Version bumps and changes, all feel just right.
Modular dreams in every line,
Happy coding, all will shine!" ✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Aug 5, 2024

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.020116566 CSPR (0.01%)

@zie1ony zie1ony changed the base branch from release/1.2.0 to release/1.3.0 August 5, 2024 09:53
@@ -151,6 +151,7 @@ impl ExecutionError {
unsafe {
match self {
ExecutionError::User(code) => *code,
ExecutionError::MaxUserError => 64535,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a missing mapping and was causing an overflow error.

core/src/host.rs Show resolved Hide resolved
core/src/host.rs Show resolved Hide resolved
examples/bin/cep78_on_livenet.rs Outdated Show resolved Hide resolved
odra-macros/src/ast/deployer_item.rs Show resolved Hide resolved
@kpob kpob marked this pull request as ready for review August 5, 2024 10:38
Copy link

github-actions bot commented Aug 5, 2024

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.02235174 CSPR (0.01%)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range, codebase verification and nitpick comments (2)
examples/bin/cep18_on_livenet.rs (1)

43-43: Update the return type of _load_cep18 function.

The _load_cep18 function in examples/bin/cep18_on_livenet.rs should return Cep18 instead of Cep18HostRef. Additionally, verify the return type consistency in related files.

  • examples/bin/cep18_on_livenet.rs: Change the return type of _load_cep18 to Cep18.
Analysis chain

Verify the function usage in the codebase.

Ensure that all references to _load_cep18 are updated to handle the return type Cep18 instead of Cep18HostRef.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_load_cep18` match the new return type `Cep18`.

# Test: Search for the function usage. Expect: Only occurrences of the new return type.
rg --type rust -A 5 $'_load_cep18'

Length of output: 1253

modules/src/cep78/tests/set_variables.rs (1)

53-53: Incomplete refactoring of TestCep78HostRef to TestCep78.

The following references to TestCep78HostRef need to be updated to TestCep78 for consistency:

  • modules/src/cep78/tests/burn.rs
    • Line 1: token::{TestCep78, TestCep78HostRef}
    • Line 2: fn mint(contract: &mut TestCep78HostRef, reverse_lookup_enabled: bool, token_owner: Address)
  • modules/src/cep78/tests/mint.rs
    • Line 1: token::{TestCep78, TestCep78HostRef}
    • Line 2: fn default_token() -> (TestCep78HostRef, HostEnv)
  • examples/bin/cep78_on_livenet.rs
    • Line 1: use odra_modules::cep78::token::{TestCep78, TestCep78HostRef, TestCep78InitArgs}
    • Line 2: pub fn load_contract(env: &HostEnv, address: &'static str) -> TestCep78HostRef
    • Line 3: pub fn deploy_contract(env: &HostEnv) -> TestCep78HostRef

Please update these references to ensure the refactoring is complete.

Analysis chain

Verify the function usage in the codebase.

Ensure that all references to TestCep78::deploy are updated to handle the new deployment mechanism.


Verify all references to TestCep78HostRef in the codebase.

Ensure that all references to TestCep78HostRef are updated to TestCep78.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


Script:

#!/bin/bash
# Description: Verify all references to `TestCep78HostRef` are removed or updated.

# Test: Search for any remaining references to `TestCep78HostRef`.
rg --type rust 'TestCep78HostRef'

Length of output: 713

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6dba46d and 309b125.

Files selected for processing (57)
  • CHANGELOG.md (1 hunks)
  • Cargo.toml (1 hunks)
  • benchmark/bin/benchmark.rs (2 hunks)
  • core/src/contract.rs (1 hunks)
  • core/src/error.rs (1 hunks)
  • core/src/host.rs (11 hunks)
  • core/src/lib.rs (2 hunks)
  • examples/Cargo.toml (1 hunks)
  • examples/bin/cep18_on_livenet.rs (3 hunks)
  • examples/bin/cep78_on_livenet.rs (3 hunks)
  • examples/bin/erc20_on_livenet.rs (3 hunks)
  • examples/bin/livenet_tests.rs (4 hunks)
  • examples/bin/tlw_on_livenet.rs (2 hunks)
  • examples/ourcoin/bin/our_token_livenet.rs (1 hunks)
  • examples/ourcoin/src/token.rs (1 hunks)
  • examples/src/contracts/balance_checker.rs (1 hunks)
  • examples/src/contracts/owned_token.rs (1 hunks)
  • examples/src/contracts/tlw.rs (1 hunks)
  • examples/src/contracts/token_manager.rs (3 hunks)
  • examples/src/features/access_control.rs (3 hunks)
  • examples/src/features/cross_calls.rs (1 hunks)
  • examples/src/features/custom_types.rs (1 hunks)
  • examples/src/features/events.rs (1 hunks)
  • examples/src/features/handling_errors.rs (3 hunks)
  • examples/src/features/host_functions.rs (1 hunks)
  • examples/src/features/module_nesting.rs (1 hunks)
  • examples/src/features/modules.rs (1 hunks)
  • examples/src/features/native_token.rs (3 hunks)
  • examples/src/features/optional_args.rs (2 hunks)
  • examples/src/features/pauseable.rs (3 hunks)
  • examples/src/features/reentrancy_guard.rs (2 hunks)
  • examples/src/features/signature_verifier.rs (3 hunks)
  • examples/src/features/storage/list.rs (1 hunks)
  • examples/src/features/storage/mapping.rs (1 hunks)
  • examples/src/features/storage/variable.rs (2 hunks)
  • examples/src/features/testing.rs (1 hunks)
  • modules/Cargo.toml (2 hunks)
  • modules/src/access/ownable.rs (2 hunks)
  • modules/src/cep18/tests/allowance.rs (2 hunks)
  • modules/src/cep18/tests/transfer.rs (3 hunks)
  • modules/src/cep18_token.rs (2 hunks)
  • modules/src/cep78/tests/acl.rs (20 hunks)
  • modules/src/cep78/tests/burn.rs (12 hunks)
  • modules/src/cep78/tests/costs.rs (4 hunks)
  • modules/src/cep78/tests/events.rs (2 hunks)
  • modules/src/cep78/tests/installer.rs (12 hunks)
  • modules/src/cep78/tests/metadata.rs (19 hunks)
  • modules/src/cep78/tests/mint.rs (24 hunks)
  • modules/src/cep78/tests/set_variables.rs (3 hunks)
  • modules/src/cep78/tests/transfer.rs (26 hunks)
  • modules/src/cep78/tests/utils.rs (2 hunks)
  • modules/src/cep78/utils.rs (2 hunks)
  • modules/src/erc1155_token.rs (8 hunks)
  • modules/src/erc20.rs (2 hunks)
  • modules/src/erc721_token.rs (5 hunks)
  • modules/src/wrapped_native.rs (2 hunks)
  • odra-casper/proxy-caller/Cargo.toml (1 hunks)
Files not processed due to max files limit (16)
  • odra-casper/rpc-client/src/casper_client/error.rs
  • odra-macros/src/ast/contract_item.rs
  • odra-macros/src/ast/deployer_item.rs
  • odra-macros/src/ast/mod.rs
  • odra-macros/src/ast/module_impl_item.rs
  • odra-macros/src/ast/test_parts.rs
  • odra-macros/src/utils/ident.rs
  • odra-macros/src/utils/ty.rs
  • odra/src/lib.rs
  • templates/cep18.rs.template
  • templates/cep18/src/token.rs
  • templates/cep78.rs.template
  • templates/cep78/src/token.rs
  • templates/full/src/flipper.rs
  • templates/workspace/flapper/src/flapper.rs
  • templates/workspace/flipper/src/flipper.rs
Files skipped from review due to trivial changes (2)
  • examples/Cargo.toml
  • examples/src/features/reentrancy_guard.rs
Additional comments not posted (193)
core/src/contract.rs (1)

1-13: LGTM!

The OdraContract trait is well-defined with appropriate type constraints and conditional compilation.

odra-casper/proxy-caller/Cargo.toml (1)

4-4: Version update approved.

The version number has been correctly updated from 1.2.0 to 1.3.0.

examples/src/features/modules.rs (2)

23-23: Ensure the correct import.

The import of ModulesContract is correct and necessary for the updated test.


29-29: LGTM!

The test correctly deploys ModulesContract and verifies its functionality.

examples/bin/tlw_on_livenet.rs (1)

5-5: Verify the consistency of TimeLockWallet usage.

Ensure that TimeLockWallet is correctly used and compatible with the rest of the code. Verify that the deployment and subsequent method calls are consistent with the new class structure.

Also applies to: 18-18

Verification successful

The usage of TimeLockWallet is consistent across the codebase.

The TimeLockWallet is correctly used for deployment and method calls, and the changes align with the class definition and its methods. No issues were found.

  • examples/bin/tlw_on_livenet.rs
  • examples/src/contracts/tlw.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `TimeLockWallet` in the codebase.

# Test: Search for the usage of `TimeLockWallet`. Expect: Consistent usage across the codebase.
rg --type rust -A 5 $'TimeLockWallet'

Length of output: 2990

examples/src/features/events.rs (1)

31-31: Verify the consistency of PartyContract usage.

Ensure that PartyContract is correctly used and compatible with the rest of the code. Verify that the deployment and subsequent method calls are consistent with the new class structure.

Also applies to: 37-37

Verification successful

Verified the consistency of PartyContract usage.

The PartyContract struct is correctly used and compatible with the rest of the code. The deployment and subsequent method calls are consistent with the new class structure.

  • PartyContract is defined and implemented in examples/src/features/events.rs.
  • It is used in the test_party function for deployment and event emission.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `PartyContract` in the codebase.

# Test: Search for the usage of `PartyContract`. Expect: Consistent usage across the codebase.
rg --type rust -A 5 $'PartyContract'

Length of output: 1579

modules/src/cep78/tests/events.rs (1)

9-9: Verify the consistency of TestCep78 usage.

Ensure that TestCep78 is correctly used and compatible with the rest of the code. Verify that the deployment and subsequent method calls are consistent with the new class structure.

Also applies to: 24-24

Verification successful

Verification successful for TestCep78 usage.

The TestCep78 class is used consistently across the codebase, and the deployment and subsequent method calls are correctly integrated with the new class structure.

  • No issues found with the replacement of TestCep78HostRef with TestCep78.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `TestCep78` in the codebase.

# Test: Search for the usage of `TestCep78`. Expect: Consistent usage across the codebase.
rg --type rust -A 5 $'TestCep78'

Length of output: 49045

examples/src/features/host_functions.rs (2)

32-32: Update import statement to reflect the new structure.

The import statement now directly imports HostContract instead of HostContractHostRef.


Line range hint 37-41:
LGTM! The instantiation of HostContract is streamlined.

The deploy method is now called directly on HostContract, which improves clarity and possibly efficiency.

core/src/lib.rs (2)

15-15: New module contract added.

The addition of the contract module enhances the library's capabilities.


51-51: Export OdraContract for better contract handling.

The export of OdraContract improves the library's functionality by making it accessible for use in other parts of the codebase.

modules/Cargo.toml (5)

3-3: Version increment to 1.3.0.

The package version has been updated from 1.2.0 to 1.3.0, indicating a new release with enhancements or fixes.


12-12: Update odra dependency to 1.3.0.

The version of the odra dependency has been updated from 1.2.0 to 1.3.0, suggesting enhancements or fixes.


20-20: Update odra-build dependency to 1.3.0.

The version of the odra-build dependency has been updated from 1.2.0 to 1.3.0, suggesting enhancements or fixes.


23-23: Update odra-test dependency to 1.3.0.

The version of the odra-test dependency has been updated from 1.2.0 to 1.3.0, suggesting enhancements or fixes.


28-28: Update odra-build build-dependency to 1.3.0.

The version of the odra-build build-dependency has been updated from 1.2.0 to 1.3.0, suggesting enhancements or fixes.

examples/src/features/optional_args.rs (2)

54-54: Verify the function usage and correctness.

The deployment logic has changed to use Token::deploy. Ensure that this change aligns with the new design pattern or API and verify the correctness of the deployment logic.


43-43: Verify the function usage and correctness.

The deployment logic has changed to use Token::deploy. Ensure that this change aligns with the new design pattern or API and verify the correctness of the deployment logic.

examples/src/features/cross_calls.rs (1)

46-46: Verify the function usage and correctness.

The deployment logic has changed to use MathEngine::deploy and CrossContract::deploy. Ensure that these changes align with the new design pattern or API and verify the correctness of the deployment logic.

Verification successful

Verify the definitions of MathEngine::deploy and CrossContract::deploy to ensure they align with the expected design pattern or API.


Verify the definitions of MathEngine::deploy and CrossContract::deploy to ensure they align with the expected design pattern or API.


Verify the definitions of MathEngine and CrossContract to understand their structure and how the deploy function is integrated.


Verify the deploy methods generated by the odra framework and confirm their expected behavior.


The deployment logic in test_cross_calls is correct and aligns with the new design pattern or API.

  • The deploy methods for MathEngine and CrossContract are generated by the odra framework, as indicated by the #[odra::module] attribute.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function usage and correctness of `MathEngine::deploy` and `CrossContract::deploy`.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type rust -A 5 $'MathEngine::deploy'
rg --type rust -A 5 $'CrossContract::deploy'

Length of output: 1001


Script:

#!/bin/bash
# Description: Verify the definitions of `MathEngine::deploy` and `CrossContract::deploy`.

# Test: Search for the definitions of the deploy functions.
ast-grep --lang rust --pattern 'impl MathEngine {
    fn deploy($_, $_) {
        $$$
    }
}'

ast-grep --lang rust --pattern 'impl CrossContract {
    fn deploy($_, $_) {
        $$$
    }
}'

Length of output: 196


Script:

#!/bin/bash
# Description: Verify the definitions of `MathEngine::deploy` and `CrossContract::deploy`.

# Test: Search for the definitions of the deploy functions with a more flexible pattern.
rg --type rust 'fn deploy' -A 10

Length of output: 13438


Script:

#!/bin/bash
# Description: Verify the definitions of `MathEngine` and `CrossContract`.

# Test: Search for the definitions of `MathEngine` and `CrossContract`.
rg --type rust 'struct MathEngine' -A 10
rg --type rust 'struct CrossContract' -A 10

Length of output: 1397


Script:

#!/bin/bash
# Description: Verify that the `deploy` methods are generated by the `odra` framework.

# Test: Search for the `odra::module` attribute to understand its functionality and confirm the generation of `deploy` methods.
rg --type rust 'odra::module' -A 10

Length of output: 71321

examples/src/features/storage/mapping.rs (1)

47-47: Verify the function usage and correctness.

The deployment logic has changed to use DogContract2::deploy. Ensure that this change aligns with the new design pattern or API and verify the correctness of the deployment logic.

Verification successful

Verify the function usage and correctness.

The deployment logic using DogContract2::deploy aligns with the odra framework's design, as indicated by the #[odra::module] attribute. The deploy method is generated by the framework, ensuring its correctness.

  • examples/src/features/storage/mapping.rs: The usage of DogContract2::deploy is correct and follows the framework's pattern.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function usage and correctness of `DogContract2::deploy`.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type rust -A 5 $'DogContract2::deploy'

Length of output: 467


Script:

#!/bin/bash
# Description: Verify the definition and correctness of `DogContract2` and its `deploy` method.

# Search for the definition of `DogContract2`.
rg --type rust 'struct DogContract2'

# Search for the implementation of the `deploy` method for `DogContract2`.
rg --type rust 'impl DogContract2' -A 20

Length of output: 1646


Script:

#!/bin/bash
# Description: Verify the implementation of the `deploy` method for `DogContract2`.

# Search for the implementation of the `deploy` method for `DogContract2`.
rg --type rust 'fn deploy' -A 10

Length of output: 13438


Script:

#!/bin/bash
# Description: Verify if `DogContract2` implements the relevant trait from `core/src/host.rs`.

# Search for trait implementations for `DogContract2`.
rg --type rust 'impl .* for DogContract2'

Length of output: 43


Script:

#!/bin/bash
# Description: Verify if `DogContract2` uses a macro or other mechanism for the `deploy` method.

# Search for macro usage or relevant patterns in `DogContract2`.
rg --type rust 'DogContract2' -A 10

Length of output: 2363

Cargo.toml (8)

19-19: Version update approved.

The workspace package version has been updated to "1.3.0". This is a standard version increment.


26-26: Version update approved.

The dependency odra-core version has been updated to "1.3.0". This is a standard version increment.


27-27: Version update approved.

The dependency odra-macros version has been updated to "1.3.0". This is a standard version increment.


28-28: Version update approved.

The dependency odra-casper-test-vm version has been updated to "1.3.0". This is a standard version increment.


29-29: Version update approved.

The dependency odra-casper-rpc-client version has been updated to "1.3.0". This is a standard version increment.


30-30: Version update approved.

The dependency odra-vm version has been updated to "1.3.0". This is a standard version increment.


31-31: Version update approved.

The dependency odra-casper-wasm-env version has been updated to "1.3.0". This is a standard version increment.


32-32: Version update approved.

The dependency odra-schema version has been updated to "1.3.0". This is a standard version increment.

examples/src/features/storage/list.rs (2)

41-41: Change approved.

The reference type DogContract3HostRef has been replaced with DogContract3, simplifying the contract deployment logic.


47-47: Change approved.

The deployment now uses DogContract3 instead of DogContract3HostRef, simplifying the contract deployment logic.

examples/bin/erc20_on_livenet.rs (3)

5-5: Change approved.

The reference type Erc20HostRef has been replaced with Erc20, simplifying the contract loading logic.


35-35: Change approved.

The _load_erc20 function now uses Erc20 instead of Erc20HostRef, simplifying the contract loading logic.


53-53: Change approved.

The deploy_erc20 function now uses Erc20 instead of Erc20HostRef, simplifying the contract deployment logic.

benchmark/bin/benchmark.rs (1)

11-11: Verify the correctness of the deployment change.

Ensure that the replacement of BenchmarkHostRef with Benchmark is correct and consistent with the rest of the codebase.

Verification successful

The deployment change from BenchmarkHostRef to Benchmark is correct and consistent with the rest of the codebase.

  • Benchmark is defined in benchmark/src/benchmark.rs.
  • Benchmark is used in benchmark/bin/benchmark.rs and benchmark/bin/evaluate_benchmark.rs.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `Benchmark` is correctly used for deployment instead of `BenchmarkHostRef`.

# Test: Search for the usage of `BenchmarkHostRef`. Expect: No occurrences.
rg --type rust 'BenchmarkHostRef'

Length of output: 33


Script:

#!/bin/bash
# Description: Verify the definition and usage of `Benchmark` in the codebase.

# Search for the definition of `Benchmark`.
rg --type rust 'struct Benchmark' -A 10

# Search for all occurrences of `Benchmark` to ensure it is used consistently.
rg --type rust 'Benchmark'

Length of output: 1006

examples/src/contracts/balance_checker.rs (1)

44-44: Verify the correctness of the deployment change.

Ensure that the replacement of BalanceCheckerHostRef with BalanceChecker is correct and consistent with the rest of the codebase.

Verification successful

Verified the correctness of the deployment change.

The replacement of BalanceCheckerHostRef with BalanceChecker is correct and consistent with the rest of the codebase.

  • BalanceChecker struct and its implementation are correctly defined.
  • The deployment method BalanceChecker::deploy is used appropriately.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `BalanceChecker` is correctly used for deployment instead of `BalanceCheckerHostRef`.

# Test: Search for the usage of `BalanceCheckerHostRef`. Expect: No occurrences.
rg --type rust 'BalanceCheckerHostRef'

Length of output: 38


Script:

#!/bin/bash
# Description: Verify that `BalanceChecker` is correctly used for deployment instead of `BalanceCheckerHostRef`.

# Test: Search for the usage of `BalanceChecker`.
rg --type rust 'BalanceChecker' -A 5

Length of output: 1449

examples/src/features/testing.rs (2)

49-49: Verify the correctness of the deployment change.

Ensure that the replacement of TestingContractHostRef with TestingContract is correct and consistent with the rest of the codebase.

Verification successful

The deployment change from TestingContractHostRef to TestingContract is correctly implemented and consistent with the rest of the codebase.

  • The TestingContract struct is properly defined and used in the codebase.
  • The deployment and initialization of TestingContract are consistent with the expected usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `TestingContract` is correctly used for deployment instead of `TestingContractHostRef`.

# Test: Search for the usage of `TestingContractHostRef`. Expect: No occurrences.
rg --type rust 'TestingContractHostRef'

Length of output: 39


Script:

#!/bin/bash
# Description: Verify the definition and usage of `TestingContract` in the codebase.

# Search for the definition of `TestingContract`.
rg --type rust 'struct TestingContract' -A 10

# Search for the usage of `TestingContract` in the codebase.
rg --type rust 'TestingContract' -A 5

Length of output: 3119


57-57: Verify the correctness of the deployment change.

Ensure that the replacement of TestingContractHostRef with TestingContract is correct and consistent with the rest of the codebase.

Verification successful

Deployment change verified successfully.

The replacement of TestingContractHostRef with TestingContract is correct and consistent with the rest of the codebase. The TestingContract struct is defined, implemented, and used appropriately for deployment.

  • examples/src/features/testing.rs: Instances of TestingContract::deploy found and consistent.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `TestingContract` is correctly used for deployment instead of `TestingContractHostRef`.

# Test: Search for the usage of `TestingContractHostRef`. Expect: No occurrences.
rg --type rust 'TestingContractHostRef'

Length of output: 39


Script:

#!/bin/bash
# Search for the definition and implementation of `TestingContract`.
ast-grep --lang rust --pattern 'struct TestingContract { $$$ }'

# Search for other instances where `TestingContractHostRef` might have been replaced with `TestingContract`.
rg --type rust 'TestingContract'

# Verify the deployment logic involving `TestingContract`.
rg --type rust 'TestingContract::deploy'

Length of output: 943

examples/bin/cep18_on_livenet.rs (1)

64-64: Verify the function usage in the codebase.

Ensure that all references to deploy_cep18 are updated to handle the return type Cep18 instead of Cep18HostRef.

examples/src/features/storage/variable.rs (1)

65-65: Verify the function usage in the codebase.

Ensure that all references to DogContract::deploy are updated to handle the new deployment mechanism.

Verification successful

Verify the removal of DogContractHostRef references in the codebase.

Ensure that all references to DogContractHostRef have been replaced by DogContract.


Refactoring verification successful

All references to DogContractHostRef have been removed, and DogContract::deploy is used consistently in the codebase.

  • examples/src/features/storage/variable.rs: Verified usage of DogContract::deploy.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `DogContract::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'DogContract::deploy'

Length of output: 622


Script:

#!/bin/bash
# Description: Verify all references to `DogContractHostRef` have been removed from the codebase.

# Test: Search for any remaining references to `DogContractHostRef`. Expect: No occurrences.
rg --type rust $'DogContractHostRef'

Length of output: 35

modules/src/cep78/tests/set_variables.rs (1)

19-19: Verify the function usage in the codebase.

Ensure that all references to TestCep78::deploy are updated to handle the new deployment mechanism.

Verification successful

Verify the function usage in the codebase.

Ensure that all references to TestCep78::deploy are updated to handle the new deployment mechanism.

  • examples/bin/cep78_on_livenet.rs
  • modules/src/cep78/tests/burn.rs
  • modules/src/cep78/tests/mint.rs
  • modules/src/cep78/tests/events.rs
  • modules/src/cep78/tests/costs.rs
  • modules/src/cep78/tests/metadata.rs
  • modules/src/cep78/tests/transfer.rs
  • modules/src/cep78/tests/acl.rs
  • modules/src/cep78/tests/installer.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420

examples/ourcoin/bin/our_token_livenet.rs (1)

72-72: Verify the correctness of the new deployment logic.

The deployment logic has changed from OurTokenHostRef::deploy to OurToken::deploy. Ensure that the new deployment logic is correct and consistent with the rest of the codebase.

examples/src/features/native_token.rs (3)

37-37: Verify the correctness of the new deployment logic in the tests.

The deployment logic in the tests has changed from PublicWalletHostRef::deploy to PublicWallet::deploy. Ensure that the new deployment logic is correct and consistent with the rest of the codebase.


54-54: Verify the correctness of the new deployment logic in the tests.

The deployment logic in the tests has changed from PublicWalletHostRef::deploy to PublicWallet::deploy. Ensure that the new deployment logic is correct and consistent with the rest of the codebase.


28-28: Verify the correctness of the new deployment logic in the tests.

The deployment logic in the tests has changed from PublicWalletHostRef::deploy to PublicWallet::deploy. Ensure that the new deployment logic is correct and consistent with the rest of the codebase.

modules/src/cep78/tests/utils.rs (2)

51-56: Verify the correctness of the new iteration logic.

The iteration logic has changed from into_iter() to iter() and gas is now dereferenced. Ensure that the new iteration logic is correct and efficient.


68-70: Verify the correctness of the new iteration logic.

The iteration logic has changed from into_iter() to iter() and gas is now dereferenced. Ensure that the new iteration logic is correct and efficient.

examples/src/features/custom_types.rs (1)

108-108: Verify the function usage in the codebase.

Ensure that all function calls to MyContract::deploy match the new deployment mechanism.

Verification successful

Verified the function usage in the codebase.

The only instance of MyContract::deploy found matches the new deployment mechanism.

  • examples/src/features/custom_types.rs: MyContract::deploy(&test_env, init_args)
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `MyContract::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'MyContract::deploy'

Length of output: 587

examples/src/features/handling_errors.rs (2)

86-86: Verify the function usage in the codebase.

Ensure that all function calls to OwnedContract::deploy match the new deployment mechanism.

Verification successful

Verification successful.

The new deployment mechanism using OwnedContract::deploy is consistently applied in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `OwnedContract::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'OwnedContract::deploy'

Length of output: 918


Script:

#!/bin/bash
# Description: Verify all function calls to `OwnedContract::deploy` match the new deployment mechanism across the entire codebase.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 'OwnedContract::deploy'

Length of output: 918


62-62: Verify the function usage in the codebase.

Ensure that all function calls to OwnedContract::deploy match the new deployment mechanism.

Verification successful

Verification successful.

All instances of OwnedContract::deploy in the codebase follow the new deployment mechanism.

  • examples/src/features/handling_errors.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `OwnedContract::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'OwnedContract::deploy'

Length of output: 918


Script:

#!/bin/bash
# Description: Verify all function calls to `OwnedContract::deploy` match the new deployment mechanism across the entire codebase.

# Test: Search for the function usage across the entire codebase. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'OwnedContract::deploy'

Length of output: 918

examples/src/features/pauseable.rs (4)

79-79: Verify the function usage in the codebase.

Ensure that all function calls to PauseableCounter::deploy match the new deployment mechanism.

Verification successful

Verification successful.

All function calls to PauseableCounter::deploy in the examples/src/features/pauseable.rs file match the new deployment mechanism.

  • examples/src/features/pauseable.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `PauseableCounter::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'PauseableCounter::deploy'

Length of output: 1604


59-59: Verify the function usage in the codebase.

Ensure that all function calls to PauseableCounter::deploy match the new deployment mechanism.

Verification successful

Verified the function usage in the codebase.

All instances of PauseableCounter::deploy in the examples/src/features/pauseable.rs file match the new deployment mechanism.

  • examples/src/features/pauseable.rs: Lines 59, 65, 71, 77, 83
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `PauseableCounter::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'PauseableCounter::deploy'

Length of output: 1604


101-101: Verify the function usage in the codebase.

Ensure that all function calls to PauseableCounter::deploy match the new deployment mechanism.

Verification successful

Verification successful.

All function calls to PauseableCounter::deploy match the new deployment mechanism.

  • examples/src/features/pauseable.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `PauseableCounter::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'PauseableCounter::deploy'

Length of output: 1604


93-93: Verify the function usage in the codebase.

Ensure that all function calls to PauseableCounter::deploy match the new deployment mechanism.

Verification successful

Verification successful.

All instances of PauseableCounter::deploy in the examples/src/features/pauseable.rs file match the new deployment mechanism, confirming the change has been uniformly applied.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `PauseableCounter::deploy` match the new deployment mechanism.

# Test: Search for the function usage. Expect: Only occurrences of the new deployment mechanism.
rg --type rust -A 5 $'PauseableCounter::deploy'

Length of output: 1604

examples/src/features/signature_verifier.rs (2)

71-71: Verify the function usage in the codebase.

Ensure that all function calls to SignatureVerifier::deploy match the new implementation.

Verification successful

Verification successful.

All instances of SignatureVerifier::deploy match the new implementation.

  • examples/src/features/signature_verifier.rs:
    • Line 71: SignatureVerifier::deploy(&odra_test::env(), NoArgs)
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SignatureVerifier::deploy` match the new implementation.

# Test: Search for the function usage. Expect: Only occurrences of the new implementation.
rg --type rust -A 5 $'SignatureVerifier::deploy'

Length of output: 995


24-24: Verify the function usage in the codebase.

Ensure that all function calls to SignatureVerifier::deploy match the new implementation.

Verification successful

Verify the function usage in the codebase.

The only instances of SignatureVerifier::deploy found are in the examples/src/features/signature_verifier.rs file, and they match the new implementation.

  • examples/src/features/signature_verifier.rs:24
  • examples/src/features/signature_verifier.rs:34
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SignatureVerifier::deploy` match the new implementation.

# Test: Search for the function usage. Expect: Only occurrences of the new implementation.
rg --type rust -A 5 $'SignatureVerifier::deploy'

Length of output: 995


Script:

#!/bin/bash
# Description: Verify all function calls to `SignatureVerifier::deploy` match the new implementation across the entire codebase.

# Test: Search for the function usage. Expect: Only occurrences of the new implementation.
rg --type rust -A 5 $'SignatureVerifier::deploy'

Length of output: 995

examples/bin/cep78_on_livenet.rs (2)

75-75: Verify the function usage in the codebase.

Ensure that all function calls to TestCep78::deploy match the new implementation.

Verification successful

All function calls to TestCep78::deploy match the new implementation.

The function is consistently called with (&env, args) as arguments across the codebase.

  • examples/bin/cep78_on_livenet.rs
  • modules/src/cep78/tests/costs.rs
  • modules/src/cep78/tests/transfer.rs
  • modules/src/cep78/tests/mint.rs
  • modules/src/cep78/tests/acl.rs
  • modules/src/cep78/tests/installer.rs
  • modules/src/cep78/tests/metadata.rs
  • modules/src/cep78/tests/burn.rs
  • modules/src/cep78/tests/events.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new implementation.

# Test: Search for the function usage. Expect: Only occurrences of the new implementation.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


50-52: Verify the function usage in the codebase.

Ensure that all function calls to TestCep78::load match the new implementation.

Verification successful

Verified: The function usage matches the new implementation.

There is only one instance of TestCep78::load in the codebase, and it aligns with the new implementation.

  • examples/bin/cep78_on_livenet.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::load` match the new implementation.

# Test: Search for the function usage. Expect: Only occurrences of the new implementation.
rg --type rust -A 5 $'TestCep78::load'

Length of output: 430


Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::load` match the new implementation across the entire codebase.

# Test: Search for the function usage. Expect: Only occurrences of the new implementation.
rg --type rust -A 5 'TestCep78::load'

Length of output: 430

modules/src/cep78/tests/costs.rs (3)

66-73: Verify the function usage in the codebase.

Ensure that all function calls to TestCep78::deploy match the new implementation.


18-18: Verify the function usage in the codebase.

Ensure that all function calls to TestCep78::deploy match the new implementation.


37-37: Verify the function usage in the codebase.

Ensure that all function calls to TestCep78::deploy match the new implementation.

Verification successful

All function calls to TestCep78::deploy match the new implementation.

The updated instantiation pattern let mut contract = TestCep78::deploy(&env, args); is consistently used across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new implementation.

# Test: Search for the function usage. Expect: Only occurrences of the new implementation.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420

examples/bin/livenet_tests.rs (3)

73-73: LGTM!

The function now returns LivenetContract and Erc20 directly. This change enhances clarity and aligns with the new approach of using direct contract types.


84-85: LGTM!

The function now returns LivenetContract and Erc20 directly. This change enhances clarity and aligns with the new approach of using direct contract types.


104-104: LGTM!

The function now returns Erc20 directly. This change enhances clarity and aligns with the new approach of using direct contract types.

examples/src/contracts/owned_token.rs (1)

69-69: LGTM!

The function now uses OwnedToken::deploy directly. This change enhances clarity and aligns with the new approach of using direct contract types.

examples/src/contracts/token_manager.rs (2)

73-73: LGTM!

The function now uses TokenManager::deploy directly. This change enhances clarity and aligns with the new approach of using direct contract types.


140-140: LGTM!

The function now uses TokenManager::deploy directly. This change enhances clarity and aligns with the new approach of using direct contract types.

examples/src/features/module_nesting.rs (1)

153-153: LGTM!

The change to use NestedOdraTypesContract instead of NestedOdraTypesContractHostRef aligns with the PR objective and is appropriate.

modules/src/cep18/tests/allowance.rs (2)

9-9: LGTM!

The import statement update to use Cep18ClientContract instead of Cep18ClientContractHostRef aligns with the PR objective and is appropriate.


59-60: LGTM!

The changes to use Cep18ClientContract instead of Cep18ClientContractHostRef align with the PR objective and are appropriate.

modules/src/cep78/tests/installer.rs (11)

9-10: LGTM!

The import statement update to use TestCep78 instead of TestCep78HostRef and MockDummyContract instead of MockDummyContractHostRef aligns with the PR objective and is appropriate.


23-23: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.


42-42: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.


Line range hint 61-70:
LGTM!

The changes to use MockDummyContract instead of MockDummyContractHostRef and TestCep78 instead of TestCep78HostRef align with the PR objective and are appropriate.


100-100: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.


124-124: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.


137-137: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.


152-152: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.


167-167: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.


183-183: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.


198-198: LGTM!

The change to use TestCep78 instead of TestCep78HostRef aligns with the PR objective and is appropriate.

modules/src/cep18/tests/transfer.rs (2)

89-89: LGTM!

The change to use Cep18ClientContract::deploy instead of Cep18ClientContractHostRef::deploy is correct and simplifies the deployment process.


203-203: LGTM!

The change to use Cep18ClientContract::deploy instead of Cep18ClientContractHostRef::deploy is correct and simplifies the deployment process.

examples/src/contracts/tlw.rs (1)

124-124: LGTM!

The change to use TimeLockWallet::deploy instead of TimeLockWalletHostRef::deploy is correct and simplifies the deployment process.

core/src/error.rs (1)

154-154: LGTM!

The addition of the MaxUserError variant to the ExecutionError enum is correct and enhances the error handling capabilities.

examples/src/features/access_control.rs (2)

105-105: LGTM!

The change from MockModeratedHostRef to MockModerated in the deployment process is correct.


273-273: LGTM!

The change from MockModeratedHostRef to MockModerated in the deployment process is correct.

modules/src/wrapped_native.rs (1)

150-150: LGTM!

The change from WrappedNativeTokenHostRef to WrappedNativeToken in the deployment process is correct.

examples/ourcoin/src/token.rs (1)

228-228: LGTM!

The change from OurTokenHostRef to OurToken in the deployment process is correct.

modules/src/cep78/utils.rs (2)

36-36: Visibility change: MockDummyContract

The MockDummyContract struct has been made public. Ensure this change is necessary and does not expose any unintended functionality.


58-58: Visibility change: MockCep78Operator

The MockCep78Operator struct has been made public. Ensure this change is necessary and does not expose any unintended functionality.

modules/src/erc20.rs (2)

213-213: Refactor: Use Erc20 instead of Erc20HostRef

The test module now uses Erc20 instead of Erc20HostRef. Ensure that the new Erc20 structure is fully compatible with the existing tests.


230-230: Refactor: Deployment call

The deployment call has been updated to use Erc20::deploy. Ensure that this change is consistent with the new deployment mechanism and does not introduce any issues.

modules/src/cep78/tests/burn.rs (12)

28-28: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


99-99: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


121-121: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


138-138: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


155-155: Refactor: Use MockCep78Operator instead of MockCep78OperatorHostRef

The test function now uses MockCep78Operator instead of MockCep78OperatorHostRef. Ensure that the new MockCep78Operator structure is fully compatible with the existing tests.


164-164: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


186-186: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


206-206: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


251-251: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


256-256: Refactor: Use MockCep78Operator instead of MockCep78OperatorHostRef

The test function now uses MockCep78Operator instead of MockCep78OperatorHostRef. Ensure that the new MockCep78Operator structure is fully compatible with the existing tests.


298-298: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.


319-319: Refactor: Use TestCep78 instead of TestCep78HostRef

The test function now uses TestCep78 instead of TestCep78HostRef. Ensure that the new TestCep78 structure is fully compatible with the existing tests.

modules/src/cep78/tests/metadata.rs (10)

38-38: LGTM!

The changes to rename TestCep78HostRef to TestCep78 are consistent and improve clarity.


66-66: LGTM!

The changes to rename TestCep78HostRef to TestCep78 are consistent and improve clarity.


78-78: LGTM!

The changes to rename TestCep78HostRef to TestCep78 are consistent and improve clarity.


108-108: LGTM!

The changes to rename TestCep78HostRef to TestCep78 are consistent and improve clarity.


148-148: LGTM!

The changes to rename TestCep78HostRef to TestCep78 are consistent and improve clarity.


259-259: LGTM!

The changes to rename MockCep78OperatorHostRef to MockCep78Operator are consistent and improve clarity.


286-286: LGTM!

The changes to rename MockCep78OperatorHostRef to MockCep78Operator are consistent and improve clarity.


317-317: LGTM!

The changes to rename MockCep78OperatorHostRef to MockCep78Operator are consistent and improve clarity.


351-351: LGTM!

The changes to rename MockCep78OperatorHostRef to MockCep78Operator are consistent and improve clarity.


382-382: LGTM!

The changes to rename MockCep78OperatorHostRef to MockCep78Operator are consistent and improve clarity.

CHANGELOG.md (1)

5-9: LGTM!

The changelog updates correctly reflect the significant changes in version 1.3.0, including the addition of the OdraContract trait and modifications to the Deployer functionality.

modules/src/erc721_token.rs (1)

169-169: LGTM!

The changes to use Erc721Token instead of Erc721TokenHostRef are consistent and improve clarity.

modules/src/cep78/tests/mint.rs (23)

41-41: Update deployment in default_token function.

The deployment call within the default_token function has been correctly updated to use TestCep78::deploy.


51-51: Update deployment in should_disallow_minting_when_allow_minting_is_set_to_false test.

The deployment call within the should_disallow_minting_when_allow_minting_is_set_to_false test function has been correctly updated to use TestCep78::deploy.


75-75: Update deployment in should_mint test.

The deployment call within the should_mint test function has been correctly updated to use TestCep78::deploy.


225-225: Update deployment in should_allow_public_minting_with_flag_set_to_true test.

The deployment call within the should_allow_public_minting_with_flag_set_to_true test function has been correctly updated to use TestCep78::deploy.


251-251: Update deployment in should_disallow_public_minting_with_flag_set_to_false test.

The deployment call within the should_disallow_public_minting_with_flag_set_to_false test function has been correctly updated to use TestCep78::deploy.


277-277: Update deployment in should_allow_minting_for_different_public_key_with_minting_mode_set_to_public test.

The deployment call within the should_allow_minting_for_different_public_key_with_minting_mode_set_to_public test function has been correctly updated to use TestCep78::deploy.


303-303: Update deployment in should_set_approval_for_all test.

The deployment call within the should_set_approval_for_all test function has been correctly updated to use TestCep78::deploy.


349-349: Update deployment in should_revoke_approval_for_all test.

The deployment call within the should_revoke_approval_for_all test function has been correctly updated to use TestCep78::deploy.


410-410: Update deployment in should_mint_with_valid_cep78_metadata test.

The deployment call within the should_mint_with_valid_cep78_metadata test function has been correctly updated to use TestCep78::deploy.


433-433: Update deployment in should_mint_with_custom_metadata_validation test.

The deployment call within the should_mint_with_custom_metadata_validation test function has been correctly updated to use TestCep78::deploy.


456-456: Update deployment in should_mint_with_raw_metadata test.

The deployment call within the should_mint_with_raw_metadata test function has been correctly updated to use TestCep78::deploy.


473-473: Update deployment in should_mint_with_hash_identifier_mode test.

The deployment call within the should_mint_with_hash_identifier_mode test function has been correctly updated to use TestCep78::deploy.


495-495: Update deployment in should_fail_to_mint_when_immediate_caller_is_account_in_contract_mode test.

The deployment call within the should_fail_to_mint_when_immediate_caller_is_account_in_contract_mode test function has been correctly updated to use TestCep78::deploy.


515-515: Update deployment in should_approve_in_hash_identifier_mode test.

The deployment call within the should_approve_in_hash_identifier_mode test function has been correctly updated to use TestCep78::deploy.


538-538: Update deployment in should_mint_without_returning_receipts_and_flat_gas_cost test.

The deployment call within the should_mint_without_returning_receipts_and_flat_gas_cost test function has been correctly updated to use TestCep78::deploy.


563-563: Update deployment in should_maintain_page_table_despite_invoking_register_owner test.

The deployment call within the should_maintain_page_table_despite_invoking_register_owner test function has been correctly updated to use TestCep78::deploy.


588-588: Update deployment in should_prevent_mint_to_unregistered_owner test.

The deployment call within the should_prevent_mint_to_unregistered_owner test function has been correctly updated to use TestCep78::deploy.


605-605: Update deployment in should_mint_with_two_required_metadata_kind test.

The deployment call within the should_mint_with_two_required_metadata_kind test function has been correctly updated to use TestCep78::deploy.


634-634: Update deployment in should_mint_with_one_required_one_optional_metadata_kind_without_optional test.

The deployment call within the should_mint_with_one_required_one_optional_metadata_kind_without_optional test function has been correctly updated to use TestCep78::deploy.


676-676: Update deployment in should_not_mint_with_missing_required_metadata test.

The deployment call within the should_not_mint_with_missing_required_metadata test function has been correctly updated to use TestCep78::deploy.


698-698: Update deployment in should_mint_with_transfer_only_reporting test.

The deployment call within the should_mint_with_transfer_only_reporting test function has been correctly updated to use TestCep78::deploy.


720-720: Update deployment in should_approve_all_in_hash_identifier_mode test.

The deployment call within the should_approve_all_in_hash_identifier_mode test function has been correctly updated to use TestCep78::deploy.


754-754: Update deployment in should_approve_all_with_flat_gas_cost test.

The deployment call within the should_approve_all_with_flat_gas_cost test function has been correctly updated to use TestCep78::deploy.

core/src/host.rs (16)

6-7: Update imports to include OdraContract and HasIdent.

The imports have been correctly updated to include the necessary traits for the new type parameters.


10-11: Conditional compilation for non-WASM32 architecture.

The OdraContract and HasIdent traits are only included for non-WASM32 targets, ensuring compatibility with different target architectures.


50-52: Add type parameter to HostRefLoader trait.

The HostRefLoader trait now includes a type parameter <T: HostRef>, enhancing type safety by ensuring the load method returns a specific host reference type.


67-68: Conditional compilation for non-WASM32 architecture.

The Deployer trait is only included for non-WASM32 targets, ensuring compatibility with different target architectures.


68-76: Add type parameter to Deployer trait and update method signatures.

The Deployer trait now includes a type parameter <R: OdraContract>, and the deploy method's signature has been updated to return R::HostRef. This change enhances type safety by ensuring the method returns a specific host reference type.


81-81: Update try_deploy method signature.

The try_deploy method's signature has been updated to return OdraResult<R::HostRef>, enhancing type safety by ensuring the method returns a specific host reference type.


85-85: Update InitArgs trait to extend Into<RuntimeArgs>.

The InitArgs trait now extends Into<RuntimeArgs>, simplifying the conversion of initialization arguments.


94-94: Simplify InitArgs implementation for NoArgs.

The InitArgs implementation for NoArgs has been simplified by removing the validate method.


102-103: Conditional compilation for non-WASM32 architecture.

The Deployer implementation for R is only included for non-WASM32 targets, ensuring compatibility with different target architectures.


Line range hint 103-123: Update Deployer implementation to use new type parameters.

The Deployer implementation has been updated to use the new type parameters and method signatures, enhancing type safety and clarity.


130-136: Update HostRefLoader implementation to use new type parameters.

The HostRefLoader implementation has been updated to use the new type parameters and method signatures, enhancing type safety and clarity.


314-320: Add raw_call_contract method to HostEnv.

The raw_call_contract method allows for more direct interaction with contract calls, returning raw bytes instead of deserialized objects. This addition provides a lower-level interface for contract interactions.


Line range hint 322-365: Implement raw_call_contract method in HostEnv.

The raw_call_contract method has been implemented to call a contract and return raw bytes. It also collects events and updates the last call result, ensuring comprehensive contract interaction management.


589-605: Implement ContractRef and OdraContract for MockTestRef.

The ContractRef and OdraContract traits have been implemented for MockTestRef, ensuring compatibility with the new type parameters and method signatures.


642-642: Update test_deploy_with_default_args test.

The test_deploy_with_default_args test has been updated to use the new deploy method signature, ensuring compatibility with the new type parameters.


Line range hint 647-675: Update test_load_ref test.

The test_load_ref test has been updated to use the new load method signature, ensuring compatibility with the new type parameters.

modules/src/erc1155_token.rs (10)

189-189: Update import for Erc1155Receiver.

The import for Erc1155Receiver has been correctly updated to replace Erc1155ReceiverHostRef.


191-191: Update import for WrappedNativeToken.

The import for WrappedNativeToken has been correctly updated to replace WrappedNativeTokenHostRef.


199-200: Update import for Erc1155Token.

The import for Erc1155Token has been correctly updated to replace Erc1155TokenHostRef.


214-214: Update deployment in setup function.

The deployment call within the setup function has been correctly updated to use Erc1155Token::deploy.


829-829: Update deployment in safe_transfer_to_valid_receiver test.

The deployment call within the safe_transfer_to_valid_receiver test function has been correctly updated to use Erc1155Receiver::deploy.


868-868: Update deployment in safe_transfer_to_valid_receiver_with_data test.

The deployment call within the safe_transfer_to_valid_receiver_with_data test function has been correctly updated to use Erc1155Receiver::deploy.


907-907: Update deployment in safe_transfer_to_invalid_receiver test.

The deployment call within the safe_transfer_to_invalid_receiver test function has been correctly updated to use WrappedNativeToken::deploy.


934-934: Update deployment in safe_batch_transfer_to_valid_receiver test.

The deployment call within the safe_batch_transfer_to_valid_receiver test function has been correctly updated to use Erc1155Receiver::deploy.


980-980: Update deployment in safe_batch_transfer_to_valid_receiver_with_data test.

The deployment call within the safe_batch_transfer_to_valid_receiver_with_data test function has been correctly updated to use Erc1155Receiver::deploy.


1026-1026: Update deployment in safe_batch_transfer_to_invalid_receiver test.

The deployment call within the safe_batch_transfer_to_invalid_receiver test function has been correctly updated to use WrappedNativeToken::deploy.

modules/src/cep78/tests/transfer.rs (11)

186-186: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


328-328: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

LGTM! All instances of TestCep78::deploy match the new reference.

The code changes are approved.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


245-245: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

All occurrences of TestCep78::deploy match the new reference.

The code changes are consistent throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


126-126: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

Verification successful. All instances of TestCep78::deploy match the new reference.

  • The deployment reference in the function has been updated correctly and consistently across the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


269-269: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

All instances of TestCep78::deploy match the new reference.

The function calls have been consistently updated to use TestCep78::deploy across the codebase.

  • modules/src/cep78/tests/costs.rs
  • modules/src/cep78/tests/installer.rs
  • modules/src/cep78/tests/mint.rs
  • modules/src/cep78/tests/transfer.rs
  • modules/src/cep78/tests/burn.rs
  • modules/src/cep78/tests/events.rs
  • modules/src/cep78/tests/metadata.rs
  • modules/src/cep78/tests/acl.rs
  • examples/bin/cep78_on_livenet.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


30-30: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

LGTM! Verified that all function calls to TestCep78::deploy match the new reference.

The code changes are confirmed to be consistent across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


384-384: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

Function usage verified!

All instances of TestCep78::deploy match the new reference across the codebase.

  • modules/src/cep78/tests/acl.rs
  • modules/src/cep78/tests/metadata.rs
  • modules/src/cep78/tests/transfer.rs
  • modules/src/cep78/tests/burn.rs
  • examples/bin/cep78_on_livenet.rs
  • modules/src/cep78/tests/costs.rs
  • modules/src/cep78/tests/installer.rs
  • modules/src/cep78/tests/mint.rs
  • modules/src/cep78/tests/events.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


537-537: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

Verification complete: All instances of TestCep78::deploy are correctly updated.

The changes are consistently applied across the codebase.

  • Verified files:
    • modules/src/cep78/tests/costs.rs
    • modules/src/cep78/tests/transfer.rs
    • modules/src/cep78/tests/events.rs
    • modules/src/cep78/tests/acl.rs
    • modules/src/cep78/tests/burn.rs
    • modules/src/cep78/tests/metadata.rs
    • modules/src/cep78/tests/mint.rs
    • modules/src/cep78/tests/installer.rs
    • examples/bin/cep78_on_livenet.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


459-459: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to MockCep78Operator::deploy and TestCep78::deploy match the new references.

Also applies to: 470-470

Verification successful

Function usage verification complete.

The new deployment references MockCep78Operator::deploy and TestCep78::deploy are correctly used across the codebase.

  • Verified in the following files:
    • modules/src/cep78/tests/burn.rs
    • modules/src/cep78/tests/metadata.rs
    • modules/src/cep78/tests/acl.rs
    • modules/src/cep78/tests/transfer.rs
    • modules/src/cep78/tests/installer.rs
    • modules/src/cep78/tests/costs.rs
    • modules/src/cep78/tests/mint.rs
    • modules/src/cep78/tests/events.rs
    • examples/bin/cep78_on_livenet.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `MockCep78Operator::deploy` and `TestCep78::deploy` match the new references.

# Test: Search for the function usage. Expect: Only occurrences of the new references.
rg --type rust -A 5 $'MockCep78Operator::deploy'
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 47298


502-502: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

All references to TestCep78::deploy are correctly updated. No instances of the old reference TestCep78HostRef::deploy were found.

  • The code changes are correct and consistent across the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420


Script:

#!/bin/bash
# Description: Verify if there are any remaining instances of the old reference `TestCep78HostRef::deploy`.

# Test: Search for the old reference. Expect: No occurrences of the old reference.
rg --type rust -A 5 $'TestCep78HostRef::deploy'

Length of output: 46


67-67: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to TestCep78::deploy match the new reference.

Verification successful

Verification successful!

All instances of the deploy method are correctly using the TestCep78 reference.

  • Verified in the following files:
    • examples/bin/cep78_on_livenet.rs
    • modules/src/cep78/tests/burn.rs
    • modules/src/cep78/tests/events.rs
    • modules/src/cep78/tests/mint.rs
    • modules/src/cep78/tests/installer.rs
    • modules/src/cep78/tests/metadata.rs
    • modules/src/cep78/tests/acl.rs
    • modules/src/cep78/tests/transfer.rs
    • modules/src/cep78/tests/costs.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `TestCep78::deploy` match the new reference.

# Test: Search for the function usage. Expect: Only occurrences of the new reference.
rg --type rust -A 5 $'TestCep78::deploy'

Length of output: 36420

modules/src/cep78/tests/acl.rs (12)

20-28: LGTM!

The renaming from MockCep78OperatorHostRef to MockCep78Operator and from TestCep78HostRef to TestCep78 is consistent and improves code readability.


49-49: LGTM!

The renaming from TestCep78HostRef to TestCep78 is consistent and improves code readability.


67-67: LGTM!

The renaming from TestCep78HostRef to TestCep78 is consistent and improves code readability.


120-120: LGTM!

The renaming from TestCep78HostRef to TestCep78 is consistent and improves code readability.


153-153: LGTM!

The renaming from TestCep78HostRef to TestCep78 is consistent and improves code readability.


Line range hint 177-187: LGTM!

The renaming from MockCep78OperatorHostRef to MockCep78Operator and from TestCep78HostRef to TestCep78 is consistent and improves code readability.


Line range hint 204-214: LGTM!

The renaming from MockCep78OperatorHostRef to MockCep78Operator and from TestCep78HostRef to TestCep78 is consistent and improves code readability.


Line range hint 228-239: LGTM!

The renaming from MockCep78OperatorHostRef to MockCep78Operator and from TestCep78HostRef to TestCep78 is consistent and improves code readability.


Line range hint 273-287: LGTM!

The renaming from MockCep78OperatorHostRef to MockCep78Operator and from TestCep78HostRef to TestCep78 is consistent and improves code readability.


Line range hint 301-313: LGTM!

The renaming from MockCep78OperatorHostRef to MockCep78Operator and from TestCep78HostRef to TestCep78 is consistent and improves code readability.


Line range hint 330-342: LGTM!

The renaming from MockCep78OperatorHostRef to MockCep78Operator and from TestCep78HostRef to TestCep78 is consistent and improves code readability.


Line range hint 366-376: LGTM!

The renaming from MockCep78OperatorHostRef to MockCep78Operator and from TestCep78HostRef to TestCep78 is consistent and improves code readability.

modules/src/access/ownable.rs (4)

341-341: LGTM!

The return type change from OwnableHostRef to Ownable is consistent and improves code readability.


346-346: LGTM!

The return type change from Ownable2StepHostRef to Ownable2Step is consistent and improves code readability.


351-352: LGTM!

The return type change from RenounceableHostRef to Renounceable is consistent and improves code readability.


364-365: LGTM!

The return type change from OwnableHostRef to Ownable and from Ownable2StepHostRef to Ownable2Step is consistent and improves code readability.

modules/src/cep18_token.rs (1)

406-406: LGTM!

The return type change from Cep18HostRef to Cep18 is consistent and improves code readability.

modules/src/cep78/tests/mint.rs Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Outside diff range, codebase verification and nitpick comments (1)
examples/bin/cep78_on_livenet.rs (1)

78-78: Ensure all references to TestCep78HostRef are updated to TestCep78.

The following instances of TestCep78HostRef need to be updated to TestCep78:

  • modules/src/cep78/tests/burn.rs
  • modules/src/cep78/tests/mint.rs
  • examples/bin/cep78_on_livenet.rs

Please review and update these references to maintain consistency.

Analysis chain

Verify the function usage in the codebase.

Ensure that all function calls to deploy_contract are updated to reflect the use of TestCep78 instead of TestCep78HostRef.


Ensure all references to TestCep78HostRef are updated to TestCep78.

The deploy_contract function still returns TestCep78HostRef. Verify and update all instances of TestCep78HostRef to TestCep78.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `deploy_contract` reflect the use of `TestCep78`.

# Test: Search for the function usage. Expect: Only occurrences of the updated implementation.
rg --type rust -A 5 $'deploy_contract'

Length of output: 1941


Script:

#!/bin/bash
# Description: Search for all occurrences of `TestCep78HostRef` in the codebase.

# Test: List all occurrences of `TestCep78HostRef`.
rg --type rust 'TestCep78HostRef'

Length of output: 713

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 309b125 and 4217ceb.

Files selected for processing (1)
  • examples/bin/cep78_on_livenet.rs (3 hunks)
Additional comments not posted (2)
examples/bin/cep78_on_livenet.rs (2)

50-55: Verify the function usage in the codebase.

Ensure that all function calls to load_contract match the new signature with a static string reference.


52-53: Consider checking Address::is_contract.

The existing comment suggests that Address::is_contract should be checked. Verify if this is necessary and update the code accordingly.

Verification successful

The check for Address::is_contract is necessary and correctly implemented.

  • The is_contract method verifies if an address can be converted to a ContractPackageHash, ensuring it is a contract address.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `Address::is_contract` check is necessary.

# Test: Search for the `is_contract` method in the `Address` implementation. Expect: Relevant context around the method.
rg --type rust -A 5 $'fn is_contract'

Length of output: 305

Copy link

github-actions bot commented Aug 5, 2024

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.02235174 CSPR (0.01%)

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits

Files that changed from the base of the PR and between 4217ceb and c0ae606.

Files selected for processing (1)
  • core/src/lib.rs (3 hunks)
Additional comments not posted (2)
core/src/lib.rs (2)

15-15: Module addition approved.

The contract module has been correctly added and follows the project's module structure.


52-52: Export addition approved.

The OdraContract export has been correctly added and follows the project's export conventions.

Copy link

github-actions bot commented Aug 6, 2024

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.02235174 CSPR (0.01%)

@kpob kpob merged commit efbe1ff into release/1.3.0 Aug 6, 2024
5 checks passed
@kpob kpob deleted the feature/group-all-derived-module-structs--into-single-trait branch August 6, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Group all structs derived from a module into a single trait.
3 participants