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

⬆ Bump cosmwasm 2.0.x #605

Merged
merged 10 commits into from
Aug 7, 2024
Merged

⬆ Bump cosmwasm 2.0.x #605

merged 10 commits into from
Aug 7, 2024

Conversation

bdeneux
Copy link
Contributor

@bdeneux bdeneux commented Aug 1, 2024

This PR updates CosmWasm to v2.1.1 following the migration guide.

Additionally, a testing package has been added to provide common testing utility functions. Since CosmWasm 2.0.0 introduced a new API for mocking info and requires a valid address, this helper library has been created to avoid duplicating utility functions. It includes functions to generate valid addresses in the mocked environment, addressing the issue described in CosmWasm issue #2157.

Copy link

coderabbitai bot commented Aug 1, 2024

Walkthrough

The changes encompass significant updates to the dependencies and functionality across multiple projects within the CosmWasm ecosystem. Key adjustments include upgrading libraries, streamlining type declarations by removing unnecessary lifetime annotations, and enhancing test clarity through more consistent use of message info. The introduction of a local testing package facilitates better address handling and mock environment setup, contributing to improved testing practices and overall code maintainability.

Changes

Files Change Summary
Cargo.toml, Makefile.toml Upgraded dependencies for CosmWasm libraries, added local testing package, and modified minimum version for cosmwasm-check.
contracts/axone-cognitarium/... Streamlined type definitions by removing lifetime parameters and replaced mock_info with message_info in tests for consistency.
contracts/axone-dataverse/... Updated instantiate function to pass checksum as a slice. Replaced mock_info with message_info for clearer test cases.
contracts/axone-law-stone/... Enhanced test clarity by replacing mock_info with message_info, added new fields in Reply struct, and introduced workspace dependency for testing.
contracts/axone-objectarium/... Improved data handling in execute module by using vectors instead of tuples, standardized address handling using message_info, and added KEY_ELEMS.
packages/testing/... Introduced testing package with address handling functionality, added mock environment capabilities, and simplified main library definitions.
docs/... Updated metadata hashes for the rendered documents to reflect changes in corresponding JSON files without altering their functionality.

Sequence Diagram(s)

sequenceDiagram
    participant A as Contract
    participant B as Testing Framework
    participant C as Address Module

    A->>B: Send transaction request
    B->>C: Retrieve address info
    C->>B: Return address
    B->>A: Execute transaction with address
Loading

🐇 In the code, I hop and play,
With types so clear, I jump all day!
Mocking info, oh so bright,
Testing now feels so right.
Upgraded paths, new friends to find,
In this code, joy is entwined! 🐾


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.

@bot-anik
Copy link
Member

bot-anik commented Aug 1, 2024

size-limit report 📦

Path Size
target/wasm32-unknown-unknown/release/axone_objectarium.wasm 458.07 KB (+14.33% 🔺)
target/wasm32-unknown-unknown/release/axone_law_stone.wasm 649.42 KB (+8.34% 🔺)
target/wasm32-unknown-unknown/release/axone_cognitarium.wasm 831.35 KB (+9.07% 🔺)
target/wasm32-unknown-unknown/release/axone_dataverse.wasm 670.43 KB (+7.76% 🔺)

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
contracts/axone-cognitarium/src/contract.rs 99.54% <100.00%> (ø)
...ontracts/axone-cognitarium/src/state/namespaces.rs 95.05% <100.00%> (ø)
contracts/axone-cognitarium/src/state/store.rs 100.00% <ø> (ø)
contracts/axone-cognitarium/src/state/triples.rs 100.00% <100.00%> (ø)
contracts/axone-dataverse/src/contract.rs 96.23% <100.00%> (+0.17%) ⬆️
contracts/axone-dataverse/src/registrar/rdf.rs 92.97% <100.00%> (ø)
contracts/axone-dataverse/src/state.rs 100.00% <ø> (ø)
contracts/axone-law-stone/src/contract.rs 95.98% <100.00%> (+0.07%) ⬆️
contracts/axone-law-stone/src/state.rs 100.00% <ø> (ø)
contracts/axone-objectarium/src/contract.rs 99.89% <100.00%> (+<0.01%) ⬆️
... and 4 more

@bdeneux bdeneux marked this pull request as ready for review August 3, 2024 12:30
Copy link

@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 c8f0fa7 and 061419b.

Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing (27)
  • Cargo.toml (2 hunks)
  • Makefile.toml (1 hunks)
  • contracts/axone-cognitarium/Cargo.toml (1 hunks)
  • contracts/axone-cognitarium/src/contract.rs (23 hunks)
  • contracts/axone-cognitarium/src/state/blank_nodes.rs (1 hunks)
  • contracts/axone-cognitarium/src/state/namespaces.rs (2 hunks)
  • contracts/axone-cognitarium/src/state/store.rs (1 hunks)
  • contracts/axone-cognitarium/src/state/triples.rs (1 hunks)
  • contracts/axone-cognitarium/tests/e2e/main.rs (3 hunks)
  • contracts/axone-dataverse/Cargo.toml (1 hunks)
  • contracts/axone-dataverse/src/contract.rs (13 hunks)
  • contracts/axone-dataverse/src/registrar/rdf.rs (2 hunks)
  • contracts/axone-dataverse/src/state.rs (1 hunks)
  • contracts/axone-law-stone/Cargo.toml (1 hunks)
  • contracts/axone-law-stone/src/contract.rs (13 hunks)
  • contracts/axone-law-stone/src/state.rs (2 hunks)
  • contracts/axone-objectarium/Cargo.toml (1 hunks)
  • contracts/axone-objectarium/src/contract.rs (62 hunks)
  • contracts/axone-objectarium/src/crypto.rs (2 hunks)
  • contracts/axone-objectarium/src/state.rs (4 hunks)
  • docs/axone-cognitarium.md (1 hunks)
  • docs/axone-law-stone.md (1 hunks)
  • packages/testing/Cargo.toml (1 hunks)
  • packages/testing/Makefile.toml (1 hunks)
  • packages/testing/src/addr.rs (1 hunks)
  • packages/testing/src/lib.rs (1 hunks)
  • packages/testing/src/mock.rs (1 hunks)
Files skipped from review due to trivial changes (10)
  • contracts/axone-cognitarium/src/state/blank_nodes.rs
  • contracts/axone-cognitarium/src/state/store.rs
  • contracts/axone-dataverse/src/state.rs
  • contracts/axone-law-stone/src/state.rs
  • contracts/axone-objectarium/src/state.rs
  • docs/axone-cognitarium.md
  • docs/axone-law-stone.md
  • packages/testing/Cargo.toml
  • packages/testing/src/addr.rs
  • packages/testing/src/lib.rs
Additional comments not posted (77)
packages/testing/Makefile.toml (1)

1-1: File approved.

The new task schema is correctly added.

packages/testing/src/mock.rs (1)

1-9: File approved.

The function mock_env_addr correctly sets up a mock environment with the contract address.

contracts/axone-law-stone/Cargo.toml (1)

37-37: File approved.

The addition of the testing workspace dependency is appropriate, and the removal of the backtraces feature is noted.

contracts/axone-objectarium/Cargo.toml (2)

42-42: Verify the rationale behind commenting out the backtraces feature.

Commenting out the backtraces feature suggests a change in error handling or debugging strategy. Ensure this aligns with the project's error handling policies and consider documenting the rationale for future reference.


42-42: LGTM!

The addition of testing.workspace = true enhances the testing capabilities of the project by ensuring a properly set up testing environment within the workspace context.

contracts/axone-dataverse/Cargo.toml (2)

44-44: Verify the rationale behind removing the backtraces feature.

The removal of the backtraces feature suggests a change in error handling or debugging strategy. Ensure this aligns with the project's error handling policies and consider documenting the rationale for future reference.


44-44: LGTM!

The addition of testing.workspace = true enhances the testing capabilities of the project by ensuring a properly set up testing environment within the workspace context.

contracts/axone-cognitarium/Cargo.toml (1)

44-44: LGTM!

The addition of testing.workspace = true enhances the testing capabilities of the project by ensuring a properly set up testing environment within the workspace context.

Cargo.toml (7)

28-28: Upgrade cosmwasm-schema to version 2.1.1.

The dependency cosmwasm-schema has been upgraded from 1.5.5 to 2.1.1. Ensure that the new version is compatible with the rest of the codebase and that any breaking changes are addressed.


29-29: Upgrade cosmwasm-std to version 2.1.1 with feature cosmwasm_2_1.

The dependency cosmwasm-std has been upgraded from 1.5.5 to 2.1.1 with a feature change from cosmwasm_1_2 to cosmwasm_2_1. Ensure that the new version and feature are compatible with the rest of the codebase and that any breaking changes are addressed.


31-31: Upgrade cw-multi-test to version 2.1.0.

The dependency cw-multi-test has been upgraded from 0.20.1 to 2.1.0. Ensure that the new version is compatible with the rest of the codebase and that any breaking changes are addressed.


32-32: Upgrade cw-storage-plus to version 2.0.0.

The dependency cw-storage-plus has been upgraded from 1.2.0 to 2.0.0. Ensure that the new version is compatible with the rest of the codebase and that any breaking changes are addressed.


33-33: Upgrade cw-utils to version 2.0.0.

The dependency cw-utils has been upgraded from 1.0.3 to 2.0.0. Ensure that the new version is compatible with the rest of the codebase and that any breaking changes are addressed.


34-34: Upgrade cw2 to version 2.0.0.

The dependency cw2 has been upgraded from 1.1.1 to 2.0.0. Ensure that the new version is compatible with the rest of the codebase and that any breaking changes are addressed.


44-44: Add local dependency testing.

A new dependency testing has been added, pointing to a local package. Ensure that the local package exists and is correctly referenced.

contracts/axone-objectarium/src/crypto.rs (2)

126-126: Add KEY_ELEMS constant to KeyDeserialize for Hash.

The KEY_ELEMS constant has been added to the KeyDeserialize trait implementation for Hash, improving clarity and type safety.


136-136: Add KEY_ELEMS constant to KeyDeserialize for &Hash.

The KEY_ELEMS constant has been added to the KeyDeserialize trait implementation for &Hash, improving clarity and type safety.

contracts/axone-cognitarium/tests/e2e/main.rs (2)

6-6: Add message_info import.

The message_info import has been added to support the updated initialization method.


30-30: Update info initialization to use message_info.

The initialization of the info field in SmartContractWorld has been updated to use message_info with an address derived from the addr function, improving the realism of the test setup.

contracts/axone-cognitarium/src/state/triples.rs (1)

Line range hint 23-27:
Simplified return type improves flexibility.

The removal of the lifetime parameter 'a from the return type of the triples function simplifies the function signature and potentially allows for more flexible use of the IndexedMap.

contracts/axone-cognitarium/src/state/namespaces.rs (2)

10-10: Simplified type signature improves clarity.

The removal of the lifetime parameter '_' from the type signature of the NAMESPACE_KEY_INCREMENT constant makes the definition cleaner and potentially easier to use.


Line range hint 35-39:
Simplified return type improves flexibility.

The removal of the lifetime parameter 'a from the return type of the namespaces function simplifies the function signature and potentially allows for more flexible use of the IndexedMap.

contracts/axone-dataverse/src/registrar/rdf.rs (2)

271-273: Improved handling of byte data.

The change from serialization_res.unwrap().0 to serialization_res.unwrap().to_vec() ensures that the byte data is correctly transformed into a vector before being converted to a UTF-8 string, preventing potential issues related to ownership or borrowing.


304-306: Improved handling of byte data.

The change from serialization_res.unwrap().0 to serialization_res.unwrap().to_vec() ensures that the byte data is correctly transformed into a vector before being converted to a UTF-8 string, preventing potential issues related to ownership or borrowing.

Makefile.toml (1)

627-627: Update dependency version.

The version of cosmwasm-check has been updated from 1.5.3 to 2.1.1. Ensure that the new version is compatible with the rest of the codebase and that any breaking changes are addressed.

contracts/axone-dataverse/src/contract.rs (12)

34-34: Improve type safety.

Passing checksum as a slice using checksum.as_slice() improves type safety and compatibility with the expected parameter type.


150-150: Enhance clarity in test cases.

Replacing mock_info with message_info improves the clarity and consistency of address handling in the test cases.


152-152: Improve type instantiation.

Using Binary::new() for instantiation is more explicit and improves code readability.


191-192: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.


226-226: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.


275-275: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.


343-346: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.


408-411: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.


427-430: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.


449-452: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.


471-474: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.


522-525: Promote better practices.

Using message_info and constants for addresses reduces the risk of errors due to string mismatches and promotes better code management practices.

contracts/axone-law-stone/src/contract.rs (9)

288-288: Enhance clarity in test cases.

Replacing mock_info with message_info improves the clarity and consistency of address handling in the test cases.


300-300: Streamline object construction.

Using a constructor method to initialize ContractInfoResponse directly with parameters simplifies the code and enhances maintainability.


698-699: Expand functionality of Reply struct.

Adding new fields payload and gas_used to the Reply struct allows for more comprehensive handling of contract interactions.


357-357: Promote better practices.

Using constants for CREATOR and SENDER reduces the risk of errors due to string mismatches and promotes better code management practices.


397-397: Promote better practices.

Using constants for CREATOR and SENDER reduces the risk of errors due to string mismatches and promotes better code management practices.


892-892: Promote better practices.

Using constants for CREATOR and SENDER reduces the risk of errors due to string mismatches and promotes better code management practices.


937-946: Promote better practices.

Using constants for CREATOR and SENDER reduces the risk of errors due to string mismatches and promotes better code management practices.


1060-1063: Promote better practices.

Using constants for CREATOR and SENDER reduces the risk of errors due to string mismatches and promotes better code management practices.


1122-1131: Promote better practices.

Using constants for CREATOR and SENDER reduces the risk of errors due to string mismatches and promotes better code management practices.

contracts/axone-cognitarium/src/contract.rs (3)

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

The code changes are approved.

However, ensure that all function calls to message_info match the new usage.


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

The code changes are approved.

However, ensure that all function calls to message_info match the new usage.

Verification successful

Verified: The usage of message_info matches the new pattern throughout the codebase.

The instances of message_info in the codebase are consistent with the new usage pattern as shown in the provided snippet.

  • contracts/axone-cognitarium/src/contract.rs
  • contracts/axone-dataverse/src/contract.rs
  • contracts/axone-objectarium/src/contract.rs
  • contracts/axone-law-stone/src/contract.rs
  • contracts/axone-cognitarium/tests/e2e/main.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `message_info` match the new usage.

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

Length of output: 51210


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

The code changes are approved.

However, ensure that all function calls to message_info match the new usage.

contracts/axone-objectarium/src/contract.rs (28)

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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.
[


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

The transition from data.0 to data.to_vec() enhances flexibility and correctness of data handling.

However, ensure that all function calls to store_object match the new data handling approach.


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases use the new message_info approach.

The change from mock_info to message_info has been consistently applied across the test cases.

  • Verified in contracts/axone-dataverse/src/contract.rs
  • Verified in contracts/axone-objectarium/src/contract.rs
  • Verified in contracts/axone-cognitarium/src/contract.rs
  • Verified in contracts/axone-law-stone/src/contract.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification successful: All test cases use the new message_info approach.

The transition from mock_info to message_info has been consistently applied across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification successful: All test cases use the new message_info approach.

The transition from mock_info to message_info has been thoroughly implemented across the codebase.

  • contracts/axone-law-stone/src/contract.rs
  • contracts/axone-objectarium/src/contract.rs
  • contracts/axone-cognitarium/src/contract.rs
  • contracts/axone-dataverse/src/contract.rs
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


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

The transition from data.0 to data for compression enhances flexibility and correctness of data handling.

However, ensure that all function calls to store_object match the new data handling approach.

Verification successful

Verification successful.

All instances of the store_object function match the new data handling approach using data directly.

  • contracts/axone-objectarium/src/contract.rs: All calls and definitions of store_object use the data parameter correctly.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `store_object` match the new data handling approach.

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

Length of output: 15480


Script:

#!/bin/bash
# Description: Verify all function calls to `store_object` match the new data handling approach.

# Test: Search for the function usage with more context lines. Expect: Only occurrences of the new approach.
rg --type rust -A 10 -B 10 $'store_object'

Length of output: 36904


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification Successful: All test cases use the new message_info approach.

The transition from mock_info to message_info has been fully implemented across the codebase, ensuring consistency and clarity in the test cases.

  • No instances of mock_info were found in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that there are no remaining instances of the old `mock_info` approach.

# Test: Search for the old `mock_info` function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases have been updated to use the new message_info approach.

  • No instances of the old mock_info function were found in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that no test cases use the old `mock_info` approach.

# Test: Search for any remaining usage of the old `mock_info` function. Expect: No occurrences.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases have been updated to use message_info.

The search did not return any instances of mock_info, confirming that the update has been consistently applied across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify no test cases use the old `mock_info` approach.

# Test: Search for the function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification Successful

All test cases have been updated to use the new message_info approach. No instances of the old mock_info were found in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that no test cases use the old `mock_info` approach.

# Test: Search for the function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases use the new message_info approach.

The verification confirms that mock_info has been completely replaced by message_info across the codebase.

  • No instances of mock_info were found.
  • Multiple instances of message_info were found, confirming its consistent usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that `mock_info` has been completely replaced by `message_info`.

# Test: Search for any remaining occurrences of `mock_info`. Expect: No occurrences.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases have been successfully updated to use the new message_info approach.

  • No occurrences of the old mock_info function were found in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that the old `mock_info` function is no longer used in the codebase.

# Test: Search for any occurrences of `mock_info`. Expect: No occurrences.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification Successful: All test cases use the new message_info approach.

  • The transition from mock_info to message_info has been completed successfully across the codebase.
  • No instances of mock_info were found.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that there are no remaining instances of `mock_info` in the codebase.

# Test: Search for the function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification successful: All test cases use the new message_info approach.

The search for mock_info returned no results, indicating that all instances have been replaced with message_info.

  • No occurrences of mock_info found in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify all test cases have replaced `mock_info` with `message_info`.

# Test: Search for any remaining instances of `mock_info`. Expect: No occurrences.
rg --type rust $'mock_info'

Length of output: 26


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification complete: All test cases use the new message_info approach.

The search for mock_info returned no results, confirming that the transition to message_info has been fully implemented across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that there are no remaining instances of the old `mock_info` function.

# Test: Search for the old function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases use the new message_info approach.

The transition from mock_info to message_info has been fully implemented across the codebase, ensuring clarity and consistency in the test cases.

  • No occurrences of mock_info were found.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that the old `mock_info` function is no longer used in the codebase.

# Test: Search for any occurrences of `mock_info`. Expect: No occurrences.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases use the new message_info approach.

The transition from mock_info to message_info has been successfully completed across the codebase.

  • No instances of mock_info were found.
  • message_info is used consistently in test cases.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that there are no remaining instances of the old `mock_info` function.

# Test: Search for the function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases use the new message_info approach.

The search for mock_info returned no results, confirming that all test cases have been updated to use the new message_info approach.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that there are no remaining instances of the old `mock_info` function in the codebase.

# Test: Search for the old function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification successful: All test cases use the new message_info approach.

The search confirmed that there are no remaining instances of the old mock_info function in the codebase. All test cases have been updated to use message_info, ensuring clarity and consistency.

  • No occurrences of mock_info found.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that no test cases use the old `mock_info` approach.

# Test: Search for the function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases now use the message_info approach.

The transition from mock_info to message_info has been successfully completed across the codebase.

  • No instances of mock_info were found.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that there are no remaining instances of `mock_info` in the codebase.

# Test: Search for the old function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases use the new message_info approach.

The verification confirms that no instances of the old mock_info approach remain in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that no test cases use the old `mock_info` approach.

# Test: Search for the function usage. Expect: No occurrences of the old approach.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification successful: All test cases use the new message_info approach.

  • The search for mock_info returned no results, confirming the complete transition to message_info.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that `mock_info` is no longer in use.

# Test: Search for any remaining instances of `mock_info`. Expect: No occurrences of the old approach.
rg --type rust $'mock_info'

Length of output: 26


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification successful: All test cases use the new message_info approach.

  • The search results confirmed that mock_info has been fully replaced by message_info.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that `mock_info` has been fully replaced by `message_info` in the codebase.

# Search for any occurrences of `mock_info` in the codebase.
rg --type rust 'mock_info'

Length of output: 26


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification Successful: All test cases use the new message_info approach.

The codebase has fully transitioned from mock_info to message_info, ensuring consistency and clarity in the test cases.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that the old `mock_info` function is no longer used in the codebase.

# Test: Search for any occurrences of the old `mock_info` function.
rg --type rust $'mock_info'

Length of output: 26


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases use the new message_info approach.

The verification confirms that there are no remaining instances of mock_info in the codebase, indicating a successful transition to message_info.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that no test cases use the old `mock_info` approach.

# Test: Search for any occurrences of the old `mock_info` function.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

Verification complete: All test cases use the new message_info approach.

The search did not return any instances of mock_info, confirming that the transition to message_info is complete across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that no test cases use the old `mock_info` approach.

# Test: Search for any occurrences of the old `mock_info` function.
rg --type rust -A 5 $'mock_info'

Length of output: 31


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

The change from mock_info to message_info improves clarity and consistency in the test cases.

However, ensure that all test cases use the new message_info approach.

Verification successful

All test cases use the new message_info approach, and no instances of mock_info were found in the codebase.

  • The transition from mock_info to message_info is complete.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test cases use the new `message_info` approach.

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

Length of output: 51210


Script:

#!/bin/bash
# Description: Verify that the old `mock_info` function is not used anywhere in the codebase.

# Test: Search for any occurrences of `mock_info`. Expect: No occurrences.
rg --type rust -A 5 $'mock_info'

Length of output: 31

@bdeneux bdeneux requested review from ccamel and amimart August 3, 2024 12:36
Copy link
Member

@ccamel ccamel left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@amimart amimart left a comment

Choose a reason for hiding this comment

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

Nice thanks 🙏

I noticed the addition of the payload field when using sub messages to avoid storing temporary context: CosmWasm/cosmwasm#2008
Maybe we could take the opportunity to use it in the law stone instantiation, we can do that in another PR if you prefer

@bdeneux
Copy link
Contributor Author

bdeneux commented Aug 7, 2024

@amimart Yes, I will do the changes but like you say, I prefer to do it in another PR. I merge this one.

@bdeneux bdeneux merged commit 18e2930 into main Aug 7, 2024
17 checks passed
@bdeneux bdeneux deleted the chore/bump-cosmwasm-2.0.x branch August 7, 2024 09:03
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.

4 participants