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

Fix schema generation for generic types #505

Merged
merged 11 commits into from
Jul 26, 2024

Conversation

kpob
Copy link
Contributor

@kpob kpob commented Jul 25, 2024

Summary by CodeRabbit

  • New Features

    • Introduced new contract schemas for managing NFTs, including MockCep78Operator and MockCep78TransferFilter.
    • Added new enumerations to enhance contract functionalities with detailed categorization.
  • Improvements

    • Updated various contract versions to indicate potential enhancements or bug fixes.
    • Modified dependency specifications to enforce exact versioning for better stability and compatibility.
  • Bug Fixes

    • Enhanced event handling mechanisms to prevent duplicate entries, improving data integrity.
  • Chores

    • Updated project dependency management to utilize specific versions, ensuring consistent behavior across environments.
    • Upgraded Rust toolchain version across multiple files to incorporate the latest features and improvements.

@kpob kpob linked an issue Jul 25, 2024 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Jul 25, 2024

Walkthrough

The recent changes emphasize enforcing exact versions for serde and serde_json across multiple Cargo.toml files, enhancing project stability while limiting future flexibility. Additionally, numerous contract schemas have been revised to reflect new version increments and introduce features, including new enumerations. These updates aim to improve reliability and functionality, ensuring smoother operations within the development environment.

Changes

Files/Paths Change Summary
Cargo.toml, benchmark/Cargo.toml, modules/Cargo.toml, odra-casper/rpc-client/Cargo.toml Updated serde and serde_json dependencies to exact versions for better compatibility and stability.
modules/resources/casper_contract_schemas/*.json Incremented contract_version from "1.0.0" to "1.1.0" in several schemas, indicating enhancements and new features. New enumerations added in cep18_schema.json.
justfile Updated CARGO_ODRA_GIT_REPO branch to release/0.1.3 and specified using the stable version for Cargo's grcov installation.
modules/src/lib.rs Removed recursion limit directive, allowing for deeper recursion within the module.
odra-macros/src/ast/event/mod.rs, odra-macros/src/ast/schema/custom_types.rs Enhanced event field handling and schema type collection through HashSet for uniqueness, improving the integrity of event data structures.
modules/resources/casper_contract_schemas/mock_cep78_operator_schema.json, mock_cep78_transfer_filter_schema.json, mock_dummy_contract_schema.json, ownable2_step_schema.json, ownable_schema.json, test_cep78_schema.json, wrapped_native_token_schema.json Introduced new contract schemas and updated existing ones with version increments and structural enhancements for improved functionality in the Casper ecosystem.
rust-toolchain Updated Rust toolchain version from nightly-2024-02-09 to nightly-2024-04-26, reflecting an upgrade to a newer nightly build that may include new features and bug fixes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Contract
    participant Schema

    User->>Contract: Interact with contract
    Contract->>Schema: Validate input data
    Schema-->>Contract: Return valid status
    Contract->>User: Send response
Loading

🐇 Hop and skip, with updates in tow,
Dependencies fixed, to help us grow.
Contract versions rise, oh what a feat,
New features abound, making it sweet!
In the code we trust, our journey's begun,
Thanks to these changes, we leap and run! 🌟


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.

@kpob kpob force-pushed the fix/custom-types-missing-from-schema branch from 5fecc07 to 7a29ab4 Compare July 25, 2024 11:39
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 (6)
modules/resources/casper_contract_schemas/mock_cep78_transfer_filter_schema.json (2)

13-14: Consider adding comments for empty sections.

The types and errors sections are empty. Consider adding a comment to indicate that these sections are intentionally left empty.

  "types": [],
+ // No types defined yet
  "errors": [],
+ // No errors defined yet

15-40: Add descriptions for entry points.

The description fields for the entry points are empty. Consider adding meaningful descriptions to improve documentation.

  "entry_points": [
    {
      "name": "set_return_value",
-     "description": "",
+     "description": "Sets the return value for the contract.",
      "is_mutable": true,
      "arguments": [
        {
          "name": "return_value",
          "description": null,
          "ty": "U8",
          "optional": false
        }
      ],
      "return_ty": "Unit",
      "is_contract_context": true,
      "access": "public"
    },
    {
      "name": "can_transfer",
-     "description": "",
+     "description": "Checks if the transfer can be performed.",
      "is_mutable": false,
      "arguments": [],
      "return_ty": "U8",
      "is_contract_context": true,
      "access": "public"
    }
  ]
odra-macros/src/ast/event/mod.rs (1)

25-36: Efficient uniqueness check using HashSet.

The changes enhance the uniqueness check for custom types using a HashSet, which is more efficient.

Consider renaming tmp to unique_types for better clarity.

- let mut tmp = HashSet::<String>::new();
+ let mut unique_types = HashSet::<String>::new();
odra-macros/src/ast/schema/custom_types.rs (1)

34-43: Efficient uniqueness check using HashSet.

The changes enhance the uniqueness check for schema types using a HashSet, which is more efficient.

Consider renaming tmp to unique_types for better clarity.

- let mut tmp = HashSet::<String>::new();
+ let mut unique_types = HashSet::<String>::new();
modules/resources/casper_contract_schemas/ownable2_step_schema.json (1)

12-12: Inconsistent Contract Version Update

The contract version update from "1.0.0" to "1.1.0" is not consistently applied across the codebase. The following files still contain the old version "1.0.0":

  • odra-casper/rpc-client/resources/test/cep18_schema.json
  • modules/resources/casper_contract_schemas/mock_contract_schema.json
  • modules/resources/casper_contract_schemas/mock_transfer_filter_contract_schema.json
  • examples/resources/casper_contract_schemas/token_schema.json
  • modules/resources/casper_contract_schemas/erc20_schema.json
  • examples/resources/casper_contract_schemas/signature_verifier_schema.json
  • examples/resources/casper_contract_schemas/time_lock_wallet_schema.json
  • examples/resources/casper_contract_schemas/public_wallet_schema.json
  • examples/resources/casper_contract_schemas/pauseable_counter_schema.json
  • examples/resources/casper_contract_schemas/dog_contract3_schema.json
  • examples/resources/casper_contract_schemas/owned_token_schema.json
  • examples/resources/casper_contract_schemas/owned_contract_schema.json
  • examples/resources/casper_contract_schemas/nested_odra_types_contract_schema.json
  • examples/resources/casper_contract_schemas/modules_contract_schema.json
  • examples/resources/casper_contract_schemas/party_contract_schema.json
  • examples/resources/casper_contract_schemas/math_engine_schema.json
  • examples/resources/casper_contract_schemas/livenet_contract_schema.json
  • examples/resources/casper_contract_schemas/token_manager_schema.json
  • examples/resources/casper_contract_schemas/dog_contract_schema.json
  • examples/resources/casper_contract_schemas/dog_contract2_schema.json
  • examples/resources/casper_contract_schemas/cross_contract_schema.json
  • examples/resources/casper_contract_schemas/cep18_schema.json
  • examples/resources/casper_contract_schemas/my_contract_schema.json
  • examples/resources/casper_contract_schemas/mock_moderated_schema.json
  • examples/resources/casper_contract_schemas/balance_checker_schema.json
  • examples/resources/test/cep18_schema.json
  • examples/resources/casper_contract_schemas/testing_contract_schema.json
  • examples/resources/casper_contract_schemas/reentrancy_mock_schema.json
  • examples/resources/casper_contract_schemas/host_contract_schema.json

Please update all instances of the contract version to "1.1.0" to ensure consistency.

Analysis chain

LGTM! But verify the consistency of the version update.

The version update from "1.0.0" to "1.1.0" is approved.

However, ensure that all references to the contract version are updated consistently across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of the contract version update.

# Test: Search for all occurrences of the contract version. Expect: Only occurrences of the new version.
rg --type json '"contract_version": "1.0.0"'

Length of output: 2930

modules/resources/casper_contract_schemas/cep18_client_contract_schema.json (1)

12-12: Inconsistent contract version update detected.

The contract version has been updated from "1.0.0" to "1.1.0" in modules/resources/casper_contract_schemas/cep18_client_contract_schema.json. However, there are multiple occurrences of the old version "1.0.0" across the codebase that need to be updated to ensure consistency.

Please update the following files to reflect the new contract version "1.1.0":

  • examples/resources/casper_contract_schemas/cross_contract_schema.json
  • examples/resources/casper_contract_schemas/signature_verifier_schema.json
  • examples/resources/casper_contract_schemas/token_schema.json
  • examples/resources/casper_contract_schemas/token_manager_schema.json
  • examples/resources/casper_contract_schemas/reentrancy_mock_schema.json
  • examples/resources/casper_contract_schemas/party_contract_schema.json
  • examples/resources/casper_contract_schemas/public_wallet_schema.json
  • examples/resources/casper_contract_schemas/pauseable_counter_schema.json
  • examples/resources/casper_contract_schemas/owned_token_schema.json
  • examples/resources/casper_contract_schemas/nested_odra_types_contract_schema.json
  • examples/resources/casper_contract_schemas/my_contract_schema.json
  • examples/resources/casper_contract_schemas/modules_contract_schema.json
  • examples/resources/casper_contract_schemas/mock_moderated_schema.json
  • examples/resources/casper_contract_schemas/testing_contract_schema.json
  • examples/resources/casper_contract_schemas/time_lock_wallet_schema.json
  • examples/resources/casper_contract_schemas/owned_contract_schema.json
  • examples/resources/casper_contract_schemas/livenet_contract_schema.json
  • examples/resources/casper_contract_schemas/host_contract_schema.json
  • examples/resources/casper_contract_schemas/dog_contract3_schema.json
  • examples/resources/casper_contract_schemas/dog_contract_schema.json
  • examples/resources/casper_contract_schemas/balance_checker_schema.json
  • examples/resources/casper_contract_schemas/dog_contract2_schema.json
  • examples/resources/test/cep18_schema.json
  • examples/resources/casper_contract_schemas/cep18_schema.json
  • examples/resources/casper_contract_schemas/math_engine_schema.json
  • modules/resources/casper_contract_schemas/mock_contract_schema.json
  • modules/resources/casper_contract_schemas/mock_transfer_filter_contract_schema.json
  • modules/resources/casper_contract_schemas/erc20_schema.json
  • odra-casper/rpc-client/resources/test/cep18_schema.json
Analysis chain

LGTM! But verify the consistency of the version update.

The version update from "1.0.0" to "1.1.0" is approved.

However, ensure that all references to the contract version are updated consistently across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of the contract version update.

# Test: Search for all occurrences of the contract version. Expect: Only occurrences of the new version.
rg --type json '"contract_version": "1.0.0"'

Length of output: 2930

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f17a38c and 9da9b8d.

Files selected for processing (24)
  • Cargo.toml (1 hunks)
  • benchmark/Cargo.toml (1 hunks)
  • justfile (2 hunks)
  • modules/Cargo.toml (1 hunks)
  • modules/resources/casper_contract_schemas/cep18_client_contract_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/cep18_schema.json (2 hunks)
  • modules/resources/casper_contract_schemas/erc1155_receiver_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/erc1155_token_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/erc721_receiver_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/erc721_token_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/mock_cep78_operator_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/mock_cep78_transfer_filter_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/mock_dummy_contract_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/ownable2_step_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/ownable_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/test_cep78_schema.json (1 hunks)
  • modules/resources/casper_contract_schemas/wrapped_native_token_schema.json (1 hunks)
  • modules/resources/legacy/mock_cep78_operator_schema.json (1 hunks)
  • modules/resources/legacy/mock_cep78_transfer_filter_schema.json (1 hunks)
  • modules/src/lib.rs (1 hunks)
  • odra-casper/rpc-client/Cargo.toml (1 hunks)
  • odra-macros/src/ast/event/mod.rs (2 hunks)
  • odra-macros/src/ast/schema/custom_types.rs (3 hunks)
  • odra-schema/src/custom_type.rs (2 hunks)
Files skipped from review due to trivial changes (5)
  • modules/resources/casper_contract_schemas/erc721_receiver_schema.json
  • modules/resources/casper_contract_schemas/erc721_token_schema.json
  • modules/resources/casper_contract_schemas/mock_dummy_contract_schema.json
  • modules/resources/casper_contract_schemas/ownable_schema.json
  • modules/resources/casper_contract_schemas/test_cep78_schema.json
Additional comments not posted (47)
modules/src/lib.rs (1)

Line range hint 1-12:
Verify the impact of removing the recursion limit directive.

The removal of #![recursion_limit = "256"] may affect the performance and behavior of recursive functions. Ensure that this change does not introduce stack overflow issues or other unintended side effects.

modules/resources/legacy/mock_cep78_transfer_filter_schema.json (1)

1-30: Verify the correctness and completeness of the JSON schema.

Ensure that the schema is well-formed and adheres to the expected structure. Verify the field types, required attributes, and overall schema validity.

benchmark/Cargo.toml (1)

13-13: LGTM! Verify the impact on dependency resolution.

The change to enforce the use of a specific version of serde_json ensures consistency across different environments. Verify the impact on dependency resolution and ensure no conflicts arise.

Verification successful

No conflicts found with serde_json dependency resolution.

The enforced version of serde_json (=1.0.113) is consistently used across the repository, ensuring no dependency conflicts arise.

  • Cargo.toml: serde_json = { version = "=1.0.113", default-features = false }
  • odra-build/Cargo.toml: serde_json = { workspace = true, default-features = false, features = ["alloc"] }
  • modules/Cargo.toml: serde_json = { version = "=1.0.113", default-features = false }
  • odra-casper/rpc-client/Cargo.toml: serde_json = { version = "=1.0.113", features = ["raw_value"] }
  • core/Cargo.toml: serde_json = { workspace = true, default-features = false, features = ["alloc"] }
  • benchmark/Cargo.toml: serde_json = "=1.0.113"
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact on dependency resolution.

# Test: Check for dependency conflicts. Expect: No conflicts.
cargo check

Length of output: 86


Script:

#!/bin/bash
# Searching for all occurrences of serde_json in Cargo.toml files to identify potential conflicts or multiple versions
rg 'serde_json' --glob '**/Cargo.toml' -A 2

Length of output: 1054

odra-casper/rpc-client/Cargo.toml (2)

17-17: Specify exact version for serde_json.

The version constraint for serde_json has been changed to =1.0.113. This ensures the project uses a specific version, which may include critical bug fixes or features, but reduces flexibility.


18-18: Reference serde from workspace.

The serde dependency is now referenced from the workspace. This change can improve dependency management and integration with other components within the workspace.

modules/Cargo.toml (2)

13-13: Upgrade serde to specific version.

The serde dependency has been upgraded to =1.0.195. This ensures the project uses a specific version, which may include critical bug fixes or features, but reduces flexibility.


14-14: Upgrade serde_json to specific version.

The serde_json dependency has been upgraded to =1.0.113. This ensures the project uses a specific version, which may include critical bug fixes or features, but reduces flexibility.

Cargo.toml (2)

40-40: Specify exact version for serde.

The version constraint for serde has been changed to =1.0.195. This ensures the project uses a specific version, which may include critical bug fixes or features, but reduces flexibility.


41-41: Specify exact version for serde_json.

The version constraint for serde_json has been changed to =1.0.113. This ensures the project uses a specific version, which may include critical bug fixes or features, but reduces flexibility.

modules/resources/casper_contract_schemas/mock_cep78_transfer_filter_schema.json (2)

1-12: Metadata section looks good.

The metadata section is correctly formatted and provides necessary information about the schema.


43-66: Call section looks good.

The call section is well-defined with necessary attributes and descriptions.

odra-macros/src/ast/event/mod.rs (1)

Line range hint 73-83:
Function implementation looks good.

The custom_struct function is well-implemented and does not require changes.

odra-macros/src/ast/schema/custom_types.rs (1)

Line range hint 55-61:
Function implementation looks good.

The try_from function is well-implemented and does not require changes.

modules/resources/legacy/mock_cep78_operator_schema.json (11)

1-2: LGTM!

The "name" field is set correctly.


3-3: LGTM!

The "events" field is set correctly.


5-20: LGTM!

The "set_address" entry point is well-formed and follows the expected structure.


21-43: LGTM!

The "mint" entry point is well-formed and follows the expected structure.


44-66: LGTM!

The "mint_with_hash" entry point is well-formed and follows the expected structure.


67-82: LGTM!

The "burn" entry point is well-formed and follows the expected structure.


83-105: LGTM!

The "mint_for" entry point is well-formed and follows the expected structure.


106-128: LGTM!

The "transfer" entry point is well-formed and follows the expected structure.


129-158: LGTM!

The "transfer_from" entry point is well-formed and follows the expected structure.


159-181: LGTM!

The "approve" entry point is well-formed and follows the expected structure.


182-197: LGTM!

The "revoke" entry point is well-formed and follows the expected structure.

modules/resources/casper_contract_schemas/erc1155_receiver_schema.json (1)

12-12: Version Update: Ensure backward compatibility.

The contract version has been updated from "1.0.0" to "1.1.0". Verify that this version update maintains backward compatibility and that all dependent systems are updated accordingly.

modules/resources/casper_contract_schemas/mock_cep78_operator_schema.json (1)

1-227: New Schema: Verify completeness and correctness.

This is a new JSON schema file for the MockCep78Operator contract. Ensure that:

  1. All entry points are correctly defined.
  2. Argument types and return types are accurate.
  3. There are no missing elements or inconsistencies.
justfile (2)

2-2: Branch Update: Ensure compatibility with the new branch.

The branch reference for CARGO_ODRA_GIT_REPO has been updated from release/0.1.2 to release/0.1.3. Verify that this new branch is compatible with the rest of the codebase and does not introduce any breaking changes.


39-39: Specify Stable Version for grcov Installation.

The command for installing grcov has been updated to use the stable version of Cargo. This enhances stability and ensures compatibility with the latest version of the Cargo Odra repository.

odra-schema/src/custom_type.rs (14)

58-62: LGTM!

The changes correctly update the trait bound and the schema_types method implementation.


64-68: LGTM!

The changes correctly update the trait bound and the schema_types method implementation.


70-77: LGTM!

The changes correctly update the trait bounds and the schema_types method implementation.


79-86: LGTM!

The changes correctly update the trait bounds and the schema_types method implementation.


88-92: LGTM!

The changes correctly update the trait bound and the schema_types method implementation.


94-101: LGTM!

The changes correctly update the trait bounds and the schema_types method implementation.


103-113: LGTM!

The changes correctly update the trait bounds and the schema_types method implementation.


183-187: LGTM!

The changes correctly update the trait bound and the custom_types method implementation.


189-193: LGTM!

The changes correctly update the trait bound and the custom_types method implementation.


195-202: LGTM!

The changes correctly update the trait bounds and the custom_types method implementation.


204-211: LGTM!

The changes correctly update the trait bounds and the custom_types method implementation.


213-217: LGTM!

The changes correctly update the trait bound and the custom_types method implementation.


219-226: LGTM!

The changes correctly update the trait bounds and the custom_types method implementation.


228-238: LGTM!

The changes correctly update the trait bounds and the custom_types method implementation.

modules/resources/casper_contract_schemas/wrapped_native_token_schema.json (1)

12-12: Verify the changes associated with the new contract version.

The contract_version has been updated from "1.0.0" to "1.1.0". Ensure that all changes associated with the new version are correctly implemented and tested.

modules/resources/casper_contract_schemas/erc1155_token_schema.json (1)

12-12: Verify the changes associated with the new contract version.

The contract_version has been updated from "1.0.0" to "1.1.0". Ensure that all changes associated with the new version are correctly implemented and tested.

modules/resources/casper_contract_schemas/cep18_schema.json (3)

12-12: Verify the version increment.

The contract version has been updated from "1.0.0" to "1.1.0". Ensure that this version increment is consistent with the changes made in the contract.


203-222: Verify the integration and usage of Cep18Modality.

The new enumeration Cep18Modality with variants None and MintAndBurn has been added. Ensure that this new enumeration is correctly integrated and used within the contract.


223-247: Verify the integration and usage of SecurityBadge.

The new enumeration SecurityBadge with variants Admin, Minter, and None has been added. Ensure that this new enumeration is correctly integrated and used within the contract.

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 9da9b8d and d311367.

Files selected for processing (1)
  • rust-toolchain (1 hunks)
Files skipped from review due to trivial changes (1)
  • rust-toolchain

Copy link

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🟢 -3.605047733 CSPR (2.29%)
Contract Call Entry point: set_variable 🔴 +0.00004801 CSPR (0.03%)
Contract Call Entry point: get_variable 🟢 -0.00008687 CSPR (0.02%)
Contract Call Entry point: set_struct_variable 🟢 -0.00000504 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🟢 -0.0000726 CSPR (0.02%)
Contract Call Entry point: set_mapping 🔴 +0.00004505 CSPR (0.03%)
Contract Call Entry point: get_mapping 🟢 -0.00008919 CSPR (0.02%)
Contract Call Entry point: push_list 🔴 +0.00001331 CSPR (0.00%)
Contract Call Entry point: get_list 🟢 -0.00009097 CSPR (0.02%)
Contract Call Entry point: init_submodule 🔴 +0.00008755 CSPR (0.01%)
Contract Call Entry point: call_submodule 🟢 -0.00013446 CSPR (0.03%)
Contract Call Entry point: call_payable 🟢 -0.00011609 CSPR (0.00%)
Contract Call Entry point: transfer_back 🔴 +0.00003142 CSPR (0.00%)
Contract Call Entry point: emit_event 🟢 -0.00010794 CSPR (0.08%)
Contract Call Entry point: set_named_key 🟢 -0.00003882 CSPR (0.02%)
Contract Call Entry point: get_named_key 🟢 -0.00008065 CSPR (0.02%)
Contract Call Entry point: set_dictionary 🟢 -0.00004568 CSPR (0.02%)
Contract Call Entry point: get_dictionary 🟢 -0.00003033 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 d311367 and a6d800d.

Files selected for processing (4)
  • benchmark/rust-toolchain (1 hunks)
  • core/src/address.rs (1 hunks)
  • modules/src/cep78/metadata.rs (1 hunks)
  • modules/src/cep78/modalities.rs (1 hunks)
Files skipped from review due to trivial changes (3)
  • benchmark/rust-toolchain
  • modules/src/cep78/metadata.rs
  • modules/src/cep78/modalities.rs
Additional comments not posted (1)
core/src/address.rs (1)

206-206: Acknowledgement: Suppression of Clippy lint warning.

The addition of #[allow(clippy::to_string_trait_impl)] suppresses the Clippy lint warning related to implementing the ToString trait. This indicates a conscious decision to maintain the implementation despite potential conflicts with the standard library's ToString implementation.

Copy link

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🟢 -3.605047733 CSPR (2.29%)
Contract Call Entry point: set_variable 🔴 +0.00004801 CSPR (0.03%)
Contract Call Entry point: get_variable 🟢 -0.00008687 CSPR (0.02%)
Contract Call Entry point: set_struct_variable 🟢 -0.00000504 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🟢 -0.0000726 CSPR (0.02%)
Contract Call Entry point: set_mapping 🔴 +0.00004505 CSPR (0.03%)
Contract Call Entry point: get_mapping 🟢 -0.00008919 CSPR (0.02%)
Contract Call Entry point: push_list 🔴 +0.00001331 CSPR (0.00%)
Contract Call Entry point: get_list 🟢 -0.00009097 CSPR (0.02%)
Contract Call Entry point: init_submodule 🔴 +0.00008755 CSPR (0.01%)
Contract Call Entry point: call_submodule 🟢 -0.00013446 CSPR (0.03%)
Contract Call Entry point: call_payable 🟢 -0.00011609 CSPR (0.00%)
Contract Call Entry point: transfer_back 🔴 +0.00003142 CSPR (0.00%)
Contract Call Entry point: emit_event 🟢 -0.00010794 CSPR (0.08%)
Contract Call Entry point: set_named_key 🟢 -0.00003882 CSPR (0.02%)
Contract Call Entry point: get_named_key 🟢 -0.00008065 CSPR (0.02%)
Contract Call Entry point: set_dictionary 🟢 -0.00004568 CSPR (0.02%)
Contract Call Entry point: get_dictionary 🟢 -0.00003033 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 a6d800d and 22978f4.

Files selected for processing (6)
  • examples/ourcoin/rust-toolchain (1 hunks)
  • templates/blank/rust-toolchain (1 hunks)
  • templates/cep18/rust-toolchain (1 hunks)
  • templates/cep78/rust-toolchain (1 hunks)
  • templates/full/rust-toolchain (1 hunks)
  • templates/workspace/rust-toolchain (1 hunks)
Files skipped from review due to trivial changes (5)
  • examples/ourcoin/rust-toolchain
  • templates/blank/rust-toolchain
  • templates/cep18/rust-toolchain
  • templates/full/rust-toolchain
  • templates/workspace/rust-toolchain
Additional comments not posted (1)
templates/cep78/rust-toolchain (1)

1-1: Verify compatibility with the new Rust toolchain version.

The Rust toolchain version has been updated to nightly-2024-04-26. Ensure that the codebase is compatible with this version and that there are no breaking changes introduced by the new nightly build.

Copy link

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🟢 -3.605047733 CSPR (2.29%)
Contract Call Entry point: set_variable 🔴 +0.00004801 CSPR (0.03%)
Contract Call Entry point: get_variable 🟢 -0.00008687 CSPR (0.02%)
Contract Call Entry point: set_struct_variable 🟢 -0.00000504 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🟢 -0.0000726 CSPR (0.02%)
Contract Call Entry point: set_mapping 🔴 +0.00004505 CSPR (0.03%)
Contract Call Entry point: get_mapping 🟢 -0.00008919 CSPR (0.02%)
Contract Call Entry point: push_list 🔴 +0.00001331 CSPR (0.00%)
Contract Call Entry point: get_list 🟢 -0.00009097 CSPR (0.02%)
Contract Call Entry point: init_submodule 🔴 +0.00008755 CSPR (0.01%)
Contract Call Entry point: call_submodule 🟢 -0.00013446 CSPR (0.03%)
Contract Call Entry point: call_payable 🟢 -0.00011609 CSPR (0.00%)
Contract Call Entry point: transfer_back 🔴 +0.00003142 CSPR (0.00%)
Contract Call Entry point: emit_event 🟢 -0.00010794 CSPR (0.08%)
Contract Call Entry point: set_named_key 🟢 -0.00003882 CSPR (0.02%)
Contract Call Entry point: get_named_key 🟢 -0.00008065 CSPR (0.02%)
Contract Call Entry point: set_dictionary 🟢 -0.00004568 CSPR (0.02%)
Contract Call Entry point: get_dictionary 🟢 -0.00003033 CSPR (0.01%)

@kpob kpob merged commit dc80c41 into release/1.2.0 Jul 26, 2024
5 checks passed
@kpob kpob deleted the fix/custom-types-missing-from-schema branch July 26, 2024 09:07
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.

Custom types missing from schema
2 participants