You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to have a compiling Scarb package containing contracts with duplicated names e.g.
src/
lib.rs <- Contract named MyContract
tests/
contracts.rs <- Contract named MyContract
In starknet_artifacts.json file they are correctly distinguished by their full paths and two .contract_class files are generated. However we have no logic to handle duplicated names and since we handle contract by names using a hashmap, which contract will be collected is undefined. This may result in different contracts being used between different tests runs.
We should introduce a logic to handle these duplicated entries and update the syntax of declare cheatcode:
If there is only one implementation under given <ContractName> allow declaring with declare(<ContractName>).
If there are duplicated names, require declaring with full path (declare(full::path::<ContractName>)) and fail otherwise (consider panic since it's a code error).
The text was updated successfully, but these errors were encountered:
It is possible to have a compiling Scarb package containing contracts with duplicated names e.g.
In
starknet_artifacts.json
file they are correctly distinguished by their full paths and two.contract_class
files are generated. However we have no logic to handle duplicated names and since we handle contract by names using a hashmap, which contract will be collected is undefined. This may result in different contracts being used between different tests runs.We should introduce a logic to handle these duplicated entries and update the syntax of
declare
cheatcode:If there is only one implementation under given
<ContractName>
allow declaring withdeclare(<ContractName>)
.If there are duplicated names, require declaring with full path (
declare(full::path::<ContractName>)
) and fail otherwise (consider panic since it's a code error).The text was updated successfully, but these errors were encountered: