Upgrade Scarb and Starknet Foundry#12
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates project dependencies, including Scarb, Starknet Foundry, and Cairo versions. It also introduces a test_address helper function to replace contract_address_const across test files. Feedback was provided regarding the potential risks of disabling libfunc validation in Scarb.toml and the suggestion to centralize the test_address utility to improve code maintainability.
| fn test_address(address: felt252) -> ContractAddress { | ||
| address.try_into().unwrap() | ||
| } |
There was a problem hiding this comment.
The test_address helper function is duplicated across multiple test files (metadata_generator.cairo, mint_tests.cairo, and tests.cairo). To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, consider moving this utility to a shared test helper module or an existing utility file that is accessible by all test modules.
There was a problem hiding this comment.
Pull request overview
This PR upgrades the project’s Cairo/Scarb/Starknet Foundry toolchain and updates the codebase (notably tests and build config) to remain compatible with the newer versions.
Changes:
- Bumped Cairo/Starknet dependency versions and updated dev dependency
snforge_stdto0.60.0(registry-based). - Replaced
contract_address_constusage in tests with a localtest_addresshelper that convertsfelt252toContractAddress. - Updated build configuration for the Starknet contract target and refreshed lockfile/docs/tool version pins.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests.cairo | Updates test address creation to use felt252 -> ContractAddress conversion helper. |
| src/mint_tests.cairo | Same test address helper migration across minting-related tests. |
| src/metadata_generator.cairo | Same test address helper migration in metadata generator tests. |
| Scarb.toml | Upgrades Cairo/Starknet dependencies, switches snforge_std to registry, and changes allowed-libfuncs configuration. |
| Scarb.lock | Refreshes lockfile to reflect new registry-sourced snforge_* packages and checksums. |
| README.md | Updates prerequisite tool versions to match new pins. |
| .tool-versions | Updates pinned Scarb and Starknet Foundry versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| use starknet::ContractAddress; | ||
|
|
||
| fn test_address(address: felt252) -> ContractAddress { | ||
| address.try_into().unwrap() |
| use starknet::ContractAddress; | ||
|
|
||
| fn test_address(address: felt252) -> ContractAddress { | ||
| address.try_into().unwrap() |
| use super::{Attribute, BeastSvgTrait, MetadataGeneratorTrait, PackableBeast}; | ||
|
|
||
| fn test_address(address: felt252) -> ContractAddress { | ||
| address.try_into().unwrap() |
|
|
||
| [[target.starknet-contract]] | ||
| allowed-libfuncs-list.name = "experimental" | ||
| allowed-libfuncs = false |
Summary
Verification
All verification commands completed with no warnings or errors.