Skip to content
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

Support: Clarinet Requirements to automatically add the Trait Dependencies #1651

Open
Tracked by #1672
BowTiedBlox opened this issue Jan 24, 2025 · 2 comments
Open
Tracked by #1672
Labels
bug Something isn't working

Comments

@BowTiedBlox
Copy link

BowTiedBlox commented Jan 24, 2025

Is your feature request related to a problem? Please describe.
When adding a smart contract that depends on a trait (e.g., impl-trait x), the required traits should be automatically included alongside other contract dependencies.

For example, in the smart contract SM1793C4R5PZ4NS4VQ4WMP7SKKYVH8JZEWSZ9HCCR.xyk-staking-sbtc-bdc-v-1-2.clar, the following trait dependency is declared:

(impl-trait .xyk-staking-trait-v-1-2.xyk-staking-trait)

Currently, this trait is not added to the .cache/requirements folder and the simnet-plan automatically.

Describe the solution you'd like
When running clarinet requirements add <contract-name>, any referenced traits should also be included in the .cache and simnet-plan.

Example:

clarinet requirements add SM1793C4R5PZ4NS4VQ4WMP7SKKYVH8JZEWSZ9HCCR.xyk-staking-sbtc-bdc-v-1-2.clar

Expected behavior: The associated traits should be added automatically.

Describe alternatives you've considered

  • Currently, traits must be added manually, for example:
clarinet requirements add SM1793C4R5PZ4NS4VQ4WMP7SKKYVH8JZEWSZ9HCCR.xyk-staking-trait-v-1-2

Additional context
Clarinet version used: 2.12.0
Might be related to #710 as the contract mentioned there, SPJ81C2WPQHFB6XTG518JKPABWM639R2X0B331XE.slimy-copper-walrus, uses traits as well.

@hugocaillard
Copy link
Collaborator

Hey @BowTiedBlox
What you describe is the expected behaviour (if you add SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335.megapont-ape-club-nft as a requirement, you'll see that the nft-trait and the commission traits are also added in .cache and deployment plan).
So there must be something we are not handling correctly with this particular contract or trait you mentions.
We'll investigate, thanks for the detailled issue

@hugocaillard hugocaillard removed the status in DevTools Feb 6, 2025
@hugocaillard hugocaillard moved this to 📋 Backlog in DevTools Feb 6, 2025
@hugocaillard hugocaillard added the bug Something isn't working label Feb 6, 2025
@hugocaillard
Copy link
Collaborator

Related to #1463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants