-
Notifications
You must be signed in to change notification settings - Fork 176
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: use name for contract interface to be consistent #2482
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
kind = "Class" | ||
class_hash = "0x5c4271c8cd454ceb8049d2b0724c99d12c2ef8077fc6ad325b18978f614aab0" | ||
original_class_hash = "0x5c4271c8cd454ceb8049d2b0724c99d12c2ef8077fc6ad325b18978f614aab0" | ||
class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" | ||
original_class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" | ||
abi = "manifests/dev/base/abis/dojo-world.json" | ||
tag = "dojo-world" | ||
manifest_name = "dojo-world" |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
"items": [ | ||
{ | ||
"type": "function", | ||
"name": "contract_name", | ||
"name": "name", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Incomplete Renaming of "contract_name" in Rust Files! Ohayo, sensei! It looks like the renaming of "contract_name" to "name" in JSON ABI files was successful. However, there are still multiple instances of "contract_name" in Rust files that need to be updated for full consistency.
Please update these remaining instances to ensure the renaming is fully consistent across the entire codebase. 🔗 Analysis chainOhayo, sensei! The name change looks good! The renaming of "contract_name" to "name" in the IContract interface is consistent with the PR objectives. This change enhances clarity and maintains a uniform naming convention across contract interfaces. To ensure consistency, let's verify if this change has been applied uniformly across the codebase: If the script returns any results, we might need to update those occurrences as well for complete consistency, sensei. Ohayo, sensei! It looks like we need to ensure the renaming of "contract_name" to "name" is fully consistent across the codebase. To address the issues found: Let's run this updated script to ensure all instances are properly addressed. If any occurrences of "contract_name" remain, please update them accordingly for complete consistency. Ohayo, sensei! It seems we still have some instances of "contract_name" in Rust files, and the JSON ABI files path needs correction. Let's first locate all JSON ABI files to ensure we're searching in the right places: Ohayo, sensei! We've successfully located all JSON ABI files. Now, let's search for any remaining instances of "contract_name" within them to ensure complete renaming. Ohayo, sensei! It appears that "contract_name" is still present in Rust files, and our previous attempt to search JSON files encountered a path issue. Let's adjust our approach to accurately search within all JSON ABI files: Please run this updated script to identify any remaining instances of "contract_name" in both Rust and JSON ABI files. Addressing these will ensure complete consistency across the codebase. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for any remaining instances of "contract_name" in Rust files and contract ABIs
echo "Checking for 'contract_name' in Rust files:"
rg --type rust 'contract_name'
echo "Checking for 'contract_name' in contract ABI JSON files:"
rg --type json 'contract_name' '**/abis/**/*.json'
Length of output: 9186 Script: # !/bin/bash
# Description: Verify the complete renaming of "contract_name" to "name" in Rust files and contract ABIs
echo "Re-checking 'contract_name' in Rust files:"
rg --type rust 'contract_name'
echo "Re-checking 'contract_name' in contract ABI JSON files:"
rg --type json 'contract_name' 'examples/spawn-and-move/manifests/dev/base/abis/contracts/**/*.json'
Length of output: 9282 Script: #!/bin/bash
# Description: Locate all JSON ABI files in the repository
echo "Locating all JSON ABI files:"
fd --extension json
Length of output: 7478 Script: #!/bin/bash
# Description: Search for "contract_name" in all JSON ABI files
echo "Searching for 'contract_name' in JSON ABI files:"
rg --type json 'contract_name' '**/*.json'
Length of output: 205 Script: #!/bin/bash
# Description: Search for "contract_name" in all JSON ABI files without specifying a path pattern
echo "Searching for 'contract_name' in JSON ABI files:"
rg --type json 'contract_name'
Length of output: 143 |
||
"inputs": [], | ||
"outputs": [ | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
kind = "Class" | ||
class_hash = "0x5c4271c8cd454ceb8049d2b0724c99d12c2ef8077fc6ad325b18978f614aab0" | ||
original_class_hash = "0x5c4271c8cd454ceb8049d2b0724c99d12c2ef8077fc6ad325b18978f614aab0" | ||
class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" | ||
original_class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" | ||
abi = "manifests/dev/base/abis/dojo-world.json" | ||
tag = "dojo-world" | ||
manifest_name = "dojo-world" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
"items": [ | ||
{ | ||
"type": "function", | ||
"name": "contract_name", | ||
"name": "name", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Ohayo, sensei! It looks like the renaming of Affected Files:
Please update these instances to complete the renaming process. 🔗 Analysis chainOhayo, sensei! The name change looks good! The renaming of "contract_name" to "name" in the IContract interface is a positive change that aligns with the PR's objective of ensuring consistency. The new name is more concise while still clearly conveying the function's purpose. To ensure this change doesn't introduce any issues, please run the following script to check for any remaining occurrences of "contract_name" in the codebase: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Search for any remaining occurrences of "contract_name" in the codebase
# Test: Search for "contract_name" in all files. Expect: No occurrences found.
rg --type-add 'code:*.{rs,json,toml}' --type code 'contract_name'
# Test: Search for function calls using "contract_name". Expect: No occurrences found.
ast-grep --lang rust --pattern 'contract_name($$$)'
Length of output: 8934 |
||
"inputs": [], | ||
"outputs": [ | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[world] | ||
kind = "WorldContract" | ||
class_hash = "0x5c4271c8cd454ceb8049d2b0724c99d12c2ef8077fc6ad325b18978f614aab0" | ||
original_class_hash = "0x5c4271c8cd454ceb8049d2b0724c99d12c2ef8077fc6ad325b18978f614aab0" | ||
class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" | ||
original_class_hash = "0x6f38d5d9507c5d9546290e1a27e309efe5a9af3770b6cc1627db4a1b90a7dce" | ||
abi = "manifests/dev/deployment/abis/dojo-world.json" | ||
address = "0x15b584f1132fe386a0aa7a447e7073233a545ac4b84b361ed797edaa8f0f14" | ||
transaction_hash = "0x715b5d1bde9766b6db3f8b903a0626343c553a91e199f96d721644d121e676b" | ||
address = "0x46c1fd10836a8426197bf412fc5f26ea10f11a8d5c61474407f03f82c096593" | ||
transaction_hash = "0x7f540b040b1638b76a7f2a8fc13a33050d1c0556a63814f319a01d022b172cf" | ||
block_number = 3 | ||
seed = "dojo_examples" | ||
manifest_name = "dojo-world" | ||
|
@@ -23,9 +23,9 @@ manifest_name = "dojo-base" | |
|
||
[[contracts]] | ||
kind = "DojoContract" | ||
address = "0x54de18a0d4dcd51213c3375061fd5cd5a30dbefdb50c9718ae9a8004162abbd" | ||
class_hash = "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d" | ||
original_class_hash = "0x67a20ea91a4b9bb9cdb46cefc41dd6ca4c07c22d4d413205720963944fd817d" | ||
address = "0x7fed9d6acaa45011152ea992784d41df3ae74eedbc199feb91b3fcbdb78abad" | ||
class_hash = "0x2aaecb3ded9ebb721f13780007e9704cba0d96b48195f357a35f4969d1b1941" | ||
original_class_hash = "0x2aaecb3ded9ebb721f13780007e9704cba0d96b48195f357a35f4969d1b1941" | ||
base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" | ||
abi = "manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json" | ||
reads = [] | ||
|
@@ -47,9 +47,9 @@ manifest_name = "dojo_examples-actions-40b6994c" | |
|
||
[[contracts]] | ||
kind = "DojoContract" | ||
address = "0x3af2ea94daa59a22d5b979004019de544dbf92a2e4ff5f4869abb7ded9ca669" | ||
class_hash = "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d" | ||
original_class_hash = "0x4590a27e4ec7366358ba5f60323777f301435ebbdd113ab02c54b947717530d" | ||
address = "0x47dcd4e30618d32fd27951e977df1d819d6edff2506e52c653f658134062036" | ||
class_hash = "0x117e4d75bef86d66e413d13f30904d2c93798f513ffa0bf83b4fac3fdfc4a62" | ||
original_class_hash = "0x117e4d75bef86d66e413d13f30904d2c93798f513ffa0bf83b4fac3fdfc4a62" | ||
base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" | ||
abi = "manifests/dev/deployment/abis/contracts/dojo_examples-dungeon-6620e0e6.json" | ||
reads = [] | ||
|
@@ -61,9 +61,9 @@ manifest_name = "dojo_examples-dungeon-6620e0e6" | |
|
||
[[contracts]] | ||
kind = "DojoContract" | ||
address = "0x7ba7852396ce1e20e332e6ad1af1a978c866d61d8ad3d2d58f618dac027c8e1" | ||
class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" | ||
original_class_hash = "0x67edb33671cd2f5b766d073e3dec53b03400761a20f349ea9628cf4c883b393" | ||
address = "0x71c327d19b2d0c6a0f65cced59f60fe69776af6885e8f42d8f6775af00f5d5b" | ||
class_hash = "0x3ad65950996d7b0bc6c04a94d401cdb19bda3ab2cffc2098d90e25077dfa11a" | ||
original_class_hash = "0x3ad65950996d7b0bc6c04a94d401cdb19bda3ab2cffc2098d90e25077dfa11a" | ||
Comment on lines
+64
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Ohayo, sensei! Detected inconsistencies in DojoContracts' deployment info. Upon verification, it appears that some
🔗 Analysis chainOhayo, sensei! Remaining DojoContracts' deployment info updated. The addresses and class hashes for the remaining DojoContracts have been refreshed. These changes maintain consistency with the updates observed in the previous contract sections, indicating a systematic update across all contracts in the manifest. To verify the consistency of these updates, you might want to run the following command: This will help ensure that all contract-related hashes and addresses have been updated consistently throughout the manifest. Also applies to: 78-80 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify that all contract addresses and class hashes have been updated
# Test: Check if any old addresses or class hashes remain in the manifest
rg --type toml '0x[a-fA-F0-9]{40,64}' examples/spawn-and-move/manifests/dev/deployment/manifest.toml
Length of output: 3657 |
||
base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" | ||
abi = "manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" | ||
reads = [] | ||
|
@@ -75,9 +75,9 @@ manifest_name = "dojo_examples-mock_token-31599eb2" | |
|
||
[[contracts]] | ||
kind = "DojoContract" | ||
address = "0x3be251ef8450c757a5712e203eef1ce65a49678a3fe711df29012de99d61c8" | ||
class_hash = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" | ||
original_class_hash = "0x40e824b8814bafef18cce2cf68f5765e9c9a1c86f55a8491b0c2a4faebdcc87" | ||
address = "0x6a116545acc77daea729bf5f14a71f634ddddedb7e7e77f280d8d984054edaf" | ||
class_hash = "0x2331b72955719869459bdacf66061a55975d6c2bc379349b082ee9d9a350a18" | ||
original_class_hash = "0x2331b72955719869459bdacf66061a55975d6c2bc379349b082ee9d9a350a18" | ||
base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" | ||
abi = "manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json" | ||
reads = [] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
"items": [ | ||
{ | ||
"type": "function", | ||
"name": "contract_name", | ||
"name": "name", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Ohayo, sensei! It looks like there are still several instances of
🔗 Analysis chainOhayo, sensei! The name change looks good! The renaming of "contract_name" to "name" in the IContract interface aligns well with the PR objective of ensuring consistency in naming conventions. This change makes the function name more concise and consistent with other similar functions in the interface (like "namespace" and "tag"). To ensure this change doesn't break existing code, let's verify its usage across the codebase: This script will help us identify any places where the old function name might still be in use and confirm that the new function name is being used correctly. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for any remaining uses of 'contract_name' and new uses of 'name'
echo "Checking for remaining uses of 'contract_name':"
rg --type rust 'contract_name'
echo "Checking for new uses of 'name' function:"
rg --type rust 'fn name\('
Length of output: 11018 |
||
"inputs": [], | ||
"outputs": [ | ||
{ | ||
|
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.
💡 Codebase verification
Ohayo, sensei!
It looks like there are still a couple of places where
contract_name
is being used. You'll need to update these to ensure consistency across the codebase:crates/dojo-core/src/world/world_contract.cairo
crates/dojo-core/src/tests/world/resources.cairo
🔗 Analysis chain
Ohayo, sensei! The name change looks good!
The renaming of
contract_name
toname
aligns well with our consistency goals. It's a cleaner and more idiomatic approach. Nice work!Let's make sure this change doesn't cause any unexpected issues elsewhere in the dojo, sensei. Here's a quick check we can run:
Ohayo, sensei!
The initial scripts faced some hiccups, but don't worry—we've got this! Let's run the updated checks to ensure
contract_name
has been fully replaced andname
is being used correctly throughout the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 557
Script:
Length of output: 1601