hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
290 stars 129 forks source link

Deployment plan misses dependency #1463

Open obycode opened 1 month ago

obycode commented 1 month ago

Describe the bug In this repo when Clarinet generates a deployment plan, it fails to deploy the util contract before the asset-manager contract, causing:

error: use of unresolved contract 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.util'

To Reproduce Steps to reproduce the behavior:

  1. Clone the repo: git@github.com:CyrusVorwald/balanced-clarity-contracts.git
  2. Checkout the commit with the error: git checkout ef385bb57738de731902c6a372e77646ee281f87
  3. Run the check: clarinet check
  4. See error

Expected behavior This dependency should be detected and the contracts should be deployed in the correct order.

CyrusVorwald commented 1 month ago

cross posting from the discord:

i have the same issue in this project and commit https://github.com/CyrusVorwald/xcall-clarity-contracts/commit/ca75c114bdec3cb91a80b7909f1c1351f6815bc6

i ran clarinet check which added util at the end of deployments/default.simnet-plan.yaml. i manually moved it to the start of the list, but it still has the same error. also, i am importing other contracts (ie rlp-decode) without error and that is at the bottom of the list

i ran npm test which moved it to the bottom of the list and in both cases the error use of unresolved contract 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.util' occurs

CyrusVorwald commented 1 month ago

it seems that if i copy over util into the contract that's importing it and call directly from there, and then undo those changes, it works