-
Notifications
You must be signed in to change notification settings - Fork 2
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
Group all derived module structs into single trait #509
Conversation
* Add OdraContract trait grouping module-related structs * Change `Deploy` definition to take advantage of `OdraContract` * Update `deploy` in modules and examples
WalkthroughThe Changes
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
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 Configuration File (
|
Benchmark report
|
@@ -151,6 +151,7 @@ impl ExecutionError { | |||
unsafe { | |||
match self { | |||
ExecutionError::User(code) => *code, | |||
ExecutionError::MaxUserError => 64535, |
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.
why?
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.
That was a missing mapping and was causing an overflow error.
Benchmark report
|
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: 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 inexamples/bin/cep18_on_livenet.rs
should returnCep18
instead ofCep18HostRef
. Additionally, verify the return type consistency in related files.
examples/bin/cep18_on_livenet.rs
: Change the return type of_load_cep18
toCep18
.Analysis chain
Verify the function usage in the codebase.
Ensure that all references to
_load_cep18
are updated to handle the return typeCep18
instead ofCep18HostRef
.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 ofTestCep78HostRef
toTestCep78
.The following references to
TestCep78HostRef
need to be updated toTestCep78
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 toTestCep78
.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
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
to1.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 ofTimeLockWallet
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 ofPartyContract
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 inexamples/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 ofTestCep78
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
withTestCep78
.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 ofHostContractHostRef
.
Line range hint
37-41
:
LGTM! The instantiation ofHostContract
is streamlined.The
deploy
method is now called directly onHostContract
, which improves clarity and possibly efficiency.core/src/lib.rs (2)
15-15
: New modulecontract
added.The addition of the
contract
module enhances the library's capabilities.
51-51
: ExportOdraContract
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 to1.3.0
.The package version has been updated from
1.2.0
to1.3.0
, indicating a new release with enhancements or fixes.
12-12
: Updateodra
dependency to1.3.0
.The version of the
odra
dependency has been updated from1.2.0
to1.3.0
, suggesting enhancements or fixes.
20-20
: Updateodra-build
dependency to1.3.0
.The version of the
odra-build
dependency has been updated from1.2.0
to1.3.0
, suggesting enhancements or fixes.
23-23
: Updateodra-test
dependency to1.3.0
.The version of the
odra-test
dependency has been updated from1.2.0
to1.3.0
, suggesting enhancements or fixes.
28-28
: Updateodra-build
build-dependency to1.3.0
.The version of the
odra-build
build-dependency has been updated from1.2.0
to1.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
andCrossContract::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
andCrossContract::deploy
to ensure they align with the expected design pattern or API.
Verify the definitions of
MathEngine::deploy
andCrossContract::deploy
to ensure they align with the expected design pattern or API.
Verify the definitions of
MathEngine
andCrossContract
to understand their structure and how thedeploy
function is integrated.
Verify the
deploy
methods generated by theodra
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 forMathEngine
andCrossContract
are generated by theodra
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 10Length 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 10Length 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 10Length 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 theodra
framework's design, as indicated by the#[odra::module]
attribute. Thedeploy
method is generated by the framework, ensuring its correctness.
examples/src/features/storage/mapping.rs
: The usage ofDogContract2::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 20Length 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 10Length 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 10Length 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 withDogContract3
, simplifying the contract deployment logic.
47-47
: Change approved.The deployment now uses
DogContract3
instead ofDogContract3HostRef
, simplifying the contract deployment logic.examples/bin/erc20_on_livenet.rs (3)
5-5
: Change approved.The reference type
Erc20HostRef
has been replaced withErc20
, simplifying the contract loading logic.
35-35
: Change approved.The
_load_erc20
function now usesErc20
instead ofErc20HostRef
, simplifying the contract loading logic.
53-53
: Change approved.The
deploy_erc20
function now usesErc20
instead ofErc20HostRef
, 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
withBenchmark
is correct and consistent with the rest of the codebase.Verification successful
The deployment change from
BenchmarkHostRef
toBenchmark
is correct and consistent with the rest of the codebase.
Benchmark
is defined inbenchmark/src/benchmark.rs
.Benchmark
is used inbenchmark/bin/benchmark.rs
andbenchmark/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
withBalanceChecker
is correct and consistent with the rest of the codebase.Verification successful
Verified the correctness of the deployment change.
The replacement of
BalanceCheckerHostRef
withBalanceChecker
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 5Length of output: 1449
examples/src/features/testing.rs (2)
49-49
: Verify the correctness of the deployment change.Ensure that the replacement of
TestingContractHostRef
withTestingContract
is correct and consistent with the rest of the codebase.Verification successful
The deployment change from
TestingContractHostRef
toTestingContract
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 5Length of output: 3119
57-57
: Verify the correctness of the deployment change.Ensure that the replacement of
TestingContractHostRef
withTestingContract
is correct and consistent with the rest of the codebase.Verification successful
Deployment change verified successfully.
The replacement of
TestingContractHostRef
withTestingContract
is correct and consistent with the rest of the codebase. TheTestingContract
struct is defined, implemented, and used appropriately for deployment.
examples/src/features/testing.rs
: Instances ofTestingContract::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 typeCep18
instead ofCep18HostRef
.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 byDogContract
.
Refactoring verification successful
All references to
DogContractHostRef
have been removed, andDogContract::deploy
is used consistently in the codebase.
examples/src/features/storage/variable.rs
: Verified usage ofDogContract::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
toOurToken::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
toPublicWallet::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
toPublicWallet::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
toPublicWallet::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()
toiter()
andgas
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()
toiter()
andgas
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 theexamples/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 theexamples/src/features/pauseable.rs
file match the new deployment mechanism.
examples/src/features/pauseable.rs
: Lines 59, 65, 71, 77, 83Scripts 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 theexamples/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 theexamples/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
andErc20
directly. This change enhances clarity and aligns with the new approach of using direct contract types.
84-85
: LGTM!The function now returns
LivenetContract
andErc20
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 ofNestedOdraTypesContractHostRef
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 ofCep18ClientContractHostRef
aligns with the PR objective and is appropriate.
59-60
: LGTM!The changes to use
Cep18ClientContract
instead ofCep18ClientContractHostRef
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 ofTestCep78HostRef
andMockDummyContract
instead ofMockDummyContractHostRef
aligns with the PR objective and is appropriate.
23-23
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
aligns with the PR objective and is appropriate.
42-42
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
aligns with the PR objective and is appropriate.
Line range hint
61-70
:
LGTM!The changes to use
MockDummyContract
instead ofMockDummyContractHostRef
andTestCep78
instead ofTestCep78HostRef
align with the PR objective and are appropriate.
100-100
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
aligns with the PR objective and is appropriate.
124-124
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
aligns with the PR objective and is appropriate.
137-137
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
aligns with the PR objective and is appropriate.
152-152
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
aligns with the PR objective and is appropriate.
167-167
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
aligns with the PR objective and is appropriate.
183-183
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
aligns with the PR objective and is appropriate.
198-198
: LGTM!The change to use
TestCep78
instead ofTestCep78HostRef
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 ofCep18ClientContractHostRef::deploy
is correct and simplifies the deployment process.
203-203
: LGTM!The change to use
Cep18ClientContract::deploy
instead ofCep18ClientContractHostRef::deploy
is correct and simplifies the deployment process.examples/src/contracts/tlw.rs (1)
124-124
: LGTM!The change to use
TimeLockWallet::deploy
instead ofTimeLockWalletHostRef::deploy
is correct and simplifies the deployment process.core/src/error.rs (1)
154-154
: LGTM!The addition of the
MaxUserError
variant to theExecutionError
enum is correct and enhances the error handling capabilities.examples/src/features/access_control.rs (2)
105-105
: LGTM!The change from
MockModeratedHostRef
toMockModerated
in the deployment process is correct.
273-273
: LGTM!The change from
MockModeratedHostRef
toMockModerated
in the deployment process is correct.modules/src/wrapped_native.rs (1)
150-150
: LGTM!The change from
WrappedNativeTokenHostRef
toWrappedNativeToken
in the deployment process is correct.examples/ourcoin/src/token.rs (1)
228-228
: LGTM!The change from
OurTokenHostRef
toOurToken
in the deployment process is correct.modules/src/cep78/utils.rs (2)
36-36
: Visibility change: MockDummyContractThe
MockDummyContract
struct has been made public. Ensure this change is necessary and does not expose any unintended functionality.
58-58
: Visibility change: MockCep78OperatorThe
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: UseErc20
instead ofErc20HostRef
The test module now uses
Erc20
instead ofErc20HostRef
. Ensure that the newErc20
structure is fully compatible with the existing tests.
230-230
: Refactor: Deployment callThe 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: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
99-99
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
121-121
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
138-138
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
155-155
: Refactor: UseMockCep78Operator
instead ofMockCep78OperatorHostRef
The test function now uses
MockCep78Operator
instead ofMockCep78OperatorHostRef
. Ensure that the newMockCep78Operator
structure is fully compatible with the existing tests.
164-164
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
186-186
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
206-206
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
251-251
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
256-256
: Refactor: UseMockCep78Operator
instead ofMockCep78OperatorHostRef
The test function now uses
MockCep78Operator
instead ofMockCep78OperatorHostRef
. Ensure that the newMockCep78Operator
structure is fully compatible with the existing tests.
298-298
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.
319-319
: Refactor: UseTestCep78
instead ofTestCep78HostRef
The test function now uses
TestCep78
instead ofTestCep78HostRef
. Ensure that the newTestCep78
structure is fully compatible with the existing tests.modules/src/cep78/tests/metadata.rs (10)
38-38
: LGTM!The changes to rename
TestCep78HostRef
toTestCep78
are consistent and improve clarity.
66-66
: LGTM!The changes to rename
TestCep78HostRef
toTestCep78
are consistent and improve clarity.
78-78
: LGTM!The changes to rename
TestCep78HostRef
toTestCep78
are consistent and improve clarity.
108-108
: LGTM!The changes to rename
TestCep78HostRef
toTestCep78
are consistent and improve clarity.
148-148
: LGTM!The changes to rename
TestCep78HostRef
toTestCep78
are consistent and improve clarity.
259-259
: LGTM!The changes to rename
MockCep78OperatorHostRef
toMockCep78Operator
are consistent and improve clarity.
286-286
: LGTM!The changes to rename
MockCep78OperatorHostRef
toMockCep78Operator
are consistent and improve clarity.
317-317
: LGTM!The changes to rename
MockCep78OperatorHostRef
toMockCep78Operator
are consistent and improve clarity.
351-351
: LGTM!The changes to rename
MockCep78OperatorHostRef
toMockCep78Operator
are consistent and improve clarity.
382-382
: LGTM!The changes to rename
MockCep78OperatorHostRef
toMockCep78Operator
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 theDeployer
functionality.modules/src/erc721_token.rs (1)
169-169
: LGTM!The changes to use
Erc721Token
instead ofErc721TokenHostRef
are consistent and improve clarity.modules/src/cep78/tests/mint.rs (23)
41-41
: Update deployment indefault_token
function.The deployment call within the
default_token
function has been correctly updated to useTestCep78::deploy
.
51-51
: Update deployment inshould_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 useTestCep78::deploy
.
75-75
: Update deployment inshould_mint
test.The deployment call within the
should_mint
test function has been correctly updated to useTestCep78::deploy
.
225-225
: Update deployment inshould_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 useTestCep78::deploy
.
251-251
: Update deployment inshould_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 useTestCep78::deploy
.
277-277
: Update deployment inshould_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 useTestCep78::deploy
.
303-303
: Update deployment inshould_set_approval_for_all
test.The deployment call within the
should_set_approval_for_all
test function has been correctly updated to useTestCep78::deploy
.
349-349
: Update deployment inshould_revoke_approval_for_all
test.The deployment call within the
should_revoke_approval_for_all
test function has been correctly updated to useTestCep78::deploy
.
410-410
: Update deployment inshould_mint_with_valid_cep78_metadata
test.The deployment call within the
should_mint_with_valid_cep78_metadata
test function has been correctly updated to useTestCep78::deploy
.
433-433
: Update deployment inshould_mint_with_custom_metadata_validation
test.The deployment call within the
should_mint_with_custom_metadata_validation
test function has been correctly updated to useTestCep78::deploy
.
456-456
: Update deployment inshould_mint_with_raw_metadata
test.The deployment call within the
should_mint_with_raw_metadata
test function has been correctly updated to useTestCep78::deploy
.
473-473
: Update deployment inshould_mint_with_hash_identifier_mode
test.The deployment call within the
should_mint_with_hash_identifier_mode
test function has been correctly updated to useTestCep78::deploy
.
495-495
: Update deployment inshould_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 useTestCep78::deploy
.
515-515
: Update deployment inshould_approve_in_hash_identifier_mode
test.The deployment call within the
should_approve_in_hash_identifier_mode
test function has been correctly updated to useTestCep78::deploy
.
538-538
: Update deployment inshould_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 useTestCep78::deploy
.
563-563
: Update deployment inshould_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 useTestCep78::deploy
.
588-588
: Update deployment inshould_prevent_mint_to_unregistered_owner
test.The deployment call within the
should_prevent_mint_to_unregistered_owner
test function has been correctly updated to useTestCep78::deploy
.
605-605
: Update deployment inshould_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 useTestCep78::deploy
.
634-634
: Update deployment inshould_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 useTestCep78::deploy
.
676-676
: Update deployment inshould_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 useTestCep78::deploy
.
698-698
: Update deployment inshould_mint_with_transfer_only_reporting
test.The deployment call within the
should_mint_with_transfer_only_reporting
test function has been correctly updated to useTestCep78::deploy
.
720-720
: Update deployment inshould_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 useTestCep78::deploy
.
754-754
: Update deployment inshould_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 useTestCep78::deploy
.core/src/host.rs (16)
6-7
: Update imports to includeOdraContract
andHasIdent
.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
andHasIdent
traits are only included for non-WASM32 targets, ensuring compatibility with different target architectures.
50-52
: Add type parameter toHostRefLoader
trait.The
HostRefLoader
trait now includes a type parameter<T: HostRef>
, enhancing type safety by ensuring theload
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 toDeployer
trait and update method signatures.The
Deployer
trait now includes a type parameter<R: OdraContract>
, and thedeploy
method's signature has been updated to returnR::HostRef
. This change enhances type safety by ensuring the method returns a specific host reference type.
81-81
: Updatetry_deploy
method signature.The
try_deploy
method's signature has been updated to returnOdraResult<R::HostRef>
, enhancing type safety by ensuring the method returns a specific host reference type.
85-85
: UpdateInitArgs
trait to extendInto<RuntimeArgs>
.The
InitArgs
trait now extendsInto<RuntimeArgs>
, simplifying the conversion of initialization arguments.
94-94
: SimplifyInitArgs
implementation forNoArgs
.The
InitArgs
implementation forNoArgs
has been simplified by removing thevalidate
method.
102-103
: Conditional compilation for non-WASM32 architecture.The
Deployer
implementation forR
is only included for non-WASM32 targets, ensuring compatibility with different target architectures.
Line range hint
103-123
: UpdateDeployer
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
: UpdateHostRefLoader
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
: Addraw_call_contract
method toHostEnv
.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
: Implementraw_call_contract
method inHostEnv
.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
: ImplementContractRef
andOdraContract
forMockTestRef
.The
ContractRef
andOdraContract
traits have been implemented forMockTestRef
, ensuring compatibility with the new type parameters and method signatures.
642-642
: Updatetest_deploy_with_default_args
test.The
test_deploy_with_default_args
test has been updated to use the newdeploy
method signature, ensuring compatibility with the new type parameters.
Line range hint
647-675
: Updatetest_load_ref
test.The
test_load_ref
test has been updated to use the newload
method signature, ensuring compatibility with the new type parameters.modules/src/erc1155_token.rs (10)
189-189
: Update import forErc1155Receiver
.The import for
Erc1155Receiver
has been correctly updated to replaceErc1155ReceiverHostRef
.
191-191
: Update import forWrappedNativeToken
.The import for
WrappedNativeToken
has been correctly updated to replaceWrappedNativeTokenHostRef
.
199-200
: Update import forErc1155Token
.The import for
Erc1155Token
has been correctly updated to replaceErc1155TokenHostRef
.
214-214
: Update deployment insetup
function.The deployment call within the
setup
function has been correctly updated to useErc1155Token::deploy
.
829-829
: Update deployment insafe_transfer_to_valid_receiver
test.The deployment call within the
safe_transfer_to_valid_receiver
test function has been correctly updated to useErc1155Receiver::deploy
.
868-868
: Update deployment insafe_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 useErc1155Receiver::deploy
.
907-907
: Update deployment insafe_transfer_to_invalid_receiver
test.The deployment call within the
safe_transfer_to_invalid_receiver
test function has been correctly updated to useWrappedNativeToken::deploy
.
934-934
: Update deployment insafe_batch_transfer_to_valid_receiver
test.The deployment call within the
safe_batch_transfer_to_valid_receiver
test function has been correctly updated to useErc1155Receiver::deploy
.
980-980
: Update deployment insafe_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 useErc1155Receiver::deploy
.
1026-1026
: Update deployment insafe_batch_transfer_to_invalid_receiver
test.The deployment call within the
safe_batch_transfer_to_invalid_receiver
test function has been correctly updated to useWrappedNativeToken::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
andTestCep78::deploy
match the new references.Also applies to: 470-470
Verification successful
Function usage verification complete.
The new deployment references
MockCep78Operator::deploy
andTestCep78::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 referenceTestCep78HostRef::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 theTestCep78
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
toMockCep78Operator
and fromTestCep78HostRef
toTestCep78
is consistent and improves code readability.
49-49
: LGTM!The renaming from
TestCep78HostRef
toTestCep78
is consistent and improves code readability.
67-67
: LGTM!The renaming from
TestCep78HostRef
toTestCep78
is consistent and improves code readability.
120-120
: LGTM!The renaming from
TestCep78HostRef
toTestCep78
is consistent and improves code readability.
153-153
: LGTM!The renaming from
TestCep78HostRef
toTestCep78
is consistent and improves code readability.
Line range hint
177-187
: LGTM!The renaming from
MockCep78OperatorHostRef
toMockCep78Operator
and fromTestCep78HostRef
toTestCep78
is consistent and improves code readability.
Line range hint
204-214
: LGTM!The renaming from
MockCep78OperatorHostRef
toMockCep78Operator
and fromTestCep78HostRef
toTestCep78
is consistent and improves code readability.
Line range hint
228-239
: LGTM!The renaming from
MockCep78OperatorHostRef
toMockCep78Operator
and fromTestCep78HostRef
toTestCep78
is consistent and improves code readability.
Line range hint
273-287
: LGTM!The renaming from
MockCep78OperatorHostRef
toMockCep78Operator
and fromTestCep78HostRef
toTestCep78
is consistent and improves code readability.
Line range hint
301-313
: LGTM!The renaming from
MockCep78OperatorHostRef
toMockCep78Operator
and fromTestCep78HostRef
toTestCep78
is consistent and improves code readability.
Line range hint
330-342
: LGTM!The renaming from
MockCep78OperatorHostRef
toMockCep78Operator
and fromTestCep78HostRef
toTestCep78
is consistent and improves code readability.
Line range hint
366-376
: LGTM!The renaming from
MockCep78OperatorHostRef
toMockCep78Operator
and fromTestCep78HostRef
toTestCep78
is consistent and improves code readability.modules/src/access/ownable.rs (4)
341-341
: LGTM!The return type change from
OwnableHostRef
toOwnable
is consistent and improves code readability.
346-346
: LGTM!The return type change from
Ownable2StepHostRef
toOwnable2Step
is consistent and improves code readability.
351-352
: LGTM!The return type change from
RenounceableHostRef
toRenounceable
is consistent and improves code readability.
364-365
: LGTM!The return type change from
OwnableHostRef
toOwnable
and fromOwnable2StepHostRef
toOwnable2Step
is consistent and improves code readability.modules/src/cep18_token.rs (1)
406-406
: LGTM!The return type change from
Cep18HostRef
toCep18
is consistent and improves code readability.
…s a contract before loading it
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
Outside diff range, codebase verification and nitpick comments (1)
examples/bin/cep78_on_livenet.rs (1)
78-78
: Ensure all references toTestCep78HostRef
are updated toTestCep78
.The following instances of
TestCep78HostRef
need to be updated toTestCep78
:
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 ofTestCep78
instead ofTestCep78HostRef
.
Ensure all references to
TestCep78HostRef
are updated toTestCep78
.The
deploy_contract
function still returnsTestCep78HostRef
. Verify and update all instances ofTestCep78HostRef
toTestCep78
.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
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 checkingAddress::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 aContractPackageHash
, 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
Benchmark report
|
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)
- 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.
Benchmark report
|
Summary by CodeRabbit
New Features
OdraContract
trait to enhance modularity and organization within the deployment architecture.Bug Fixes
ExecutionError::MaxUserError
variant.Documentation
Chores
Cargo.toml
files, indicating a coordinated release of dependencies.