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
307 stars 141 forks source link

Clarinet `requirements add` handling arguments weakly #878

Open mefrem opened 1 year ago

mefrem commented 1 year ago

Currently, Clarinet can add a project contract requirement by passing a principal contract in the cli like so:

clarinet requirements add SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait

What's not yet supported is passing trait references, like: clarinet requirements add SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait

Furthermore, as a bonus: It would be great to clarity or correct this hint/help text returned clarinet requirements add --help

Screenshot 2023-02-09 at 3 26 39 PM

Currently, passing clarinet requirements add "SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait" (note the double quotes, like as indicated in the help dialog) does not yield a correctly imported requirement. I had to pass the principal contract reference with no double quotes (or even the single quote prefix which is the Clarity type convention). The request to this issue would be to have a better help dialog without the quotes, or have an input formatter that can take a principal contract reference (or trait reference) with any style or quantity of quotes and find the correct contract on the Stacks chain to place inside the requirements-publish contract for the deployment plan.

hugocaillard commented 1 year ago

My approach for this one would be to simply update the --help doc and remove the ""