-
Notifications
You must be signed in to change notification settings - Fork 0
V2 feat update #1
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
Conversation
- add get_contracts_by_code_hash() to find verified contracts by hash - add get_contracts_count() to return total verified contracts - add unit tests for new functions - update rust toolchain to 1.85.0 - update dependencies
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.
Pull request overview
This PR updates the build environment to Rust 1.86.0 and adds two new query methods to the SourceScan contract for retrieving verified contract information by code hash and getting contract counts. The changes also include comprehensive unit tests for the new functionality.
Key Changes:
- Upgraded Rust toolchain and Docker build environment
- Added
get_contracts_by_code_hashmethod to query contracts sharing the same code hash - Added
get_contracts_countmethod to return total verified contract count
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib.rs |
Added two new public query methods with comprehensive unit tests |
rust-toolchain.toml |
Updated Rust version (with version mismatch issue) |
Cargo.toml |
Updated Docker image and modified container build command |
Cargo.lock |
Updated dependency versions to match new toolchain |
.gitignore |
Added /backups directory to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| # the command may be any combination of flags of `cargo-near`, | ||
| # supported by respective version of binary inside the container besides `--no-locked` flag | ||
| container_build_command = ["cargo", "near", "build"] | ||
| container_build_command = ["cargo", "near", "build", "non-reproducible-wasm", "--locked"] |
Copilot
AI
Dec 2, 2025
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.
The build command includes non-reproducible-wasm as a positional argument, but based on the cargo-near CLI structure, this should be prefixed with -- as a flag. The correct format should be --non-reproducible-wasm.
| container_build_command = ["cargo", "near", "build", "non-reproducible-wasm", "--locked"] | |
| container_build_command = ["cargo", "near", "build", "--non-reproducible-wasm", "--locked"] |
| @@ -1,4 +1,4 @@ | |||
| [toolchain] | |||
| channel = "1.73.0" | |||
| channel = "1.85.0" | |||
Copilot
AI
Dec 2, 2025
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.
The rust version is updated to "1.85.0" but the PR description and Cargo.toml specify Rust 1.86.0. This inconsistency could lead to build issues. The version should be "1.86.0" to match the docker image sourcescan/cargo-near:0.17.0-rust-1.86.0.
| channel = "1.85.0" | |
| channel = "1.86.0" |
This pull request updates the build environment and adds new query methods to the
SourceScancontract, along with corresponding tests to ensure correct behavior. The changes improve compatibility with newer Rust versions and enhance contract querying capabilities.Build environment updates:
Cargo.tomlandrust-toolchain.tomlto use Rust 1.86.0 andsourcescan/cargo-near:0.17.0, ensuring compatibility with newer tools and features. [1] [2]non-reproducible-wasmand--lockedflags for more robust builds.New contract query methods:
get_contracts_by_code_hashmethod toSourceScan, allowing retrieval of all verified contracts sharing the same code hash. This helps identify contracts deployed to multiple accounts with identical code.get_contracts_countmethod to return the total number of verified contracts, providing a simple way to monitor contract volume.Testing enhancements: