starknet-foundry icon indicating copy to clipboard operation
starknet-foundry copied to clipboard

Add Scarb "features" support for snforge

Open piotmag769 opened this issue 10 months ago • 4 comments

Closes #2025

TODO:

  • tutorial in docs for mock contracts (contracts only for tests) that will not be compiled for default build

Introduced changes

  • as in the title. Scarb features are like Rust features https://doc.rust-lang.org/cargo/reference/features.html

Checklist

  • [x] Linked relevant issue
  • [x] Updated relevant documentation
  • [x] Added relevant tests
  • [x] Performed self-review of the code
  • [x] Added changes to CHANGELOG.md

piotmag769 avatar Apr 22 '24 14:04 piotmag769

This probably closes also https://github.com/software-mansion/scarb/issues/847 as it solves the purpose? @maciektr And the first part of the #471? @Arcticae @MaksymilianDemitraszek

piotmag769 avatar Apr 22 '24 14:04 piotmag769

Misleading title, better would be, add Scarb "features" support for snforge

MaksymilianDemitraszek avatar Apr 22 '24 15:04 MaksymilianDemitraszek

This PR adding the ability to have mock contracts only built when running tests will be beneficial for OZ users since now we have migrated to starknet foundry and had to include our mock contracts as part of the content of the released modules.

ericnordelo avatar Aug 02 '24 12:08 ericnordelo

cc @cptartur

piotmag769 avatar Aug 05 '24 11:08 piotmag769

From PR description:

TODO: tutorial in docs for mock contracts (contracts only for tests) that will not be compiled for default build

Please make sure it is done/issue is created 🙏 The flow may not be immediately obvious for less advanced users. Moreover, putting contracts in tests folder or code under #[cfg(test)] won't solve the issue, which may also be not obvious

piotmag769 avatar Aug 21 '24 10:08 piotmag769