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

Add macros package and the with_components macro #1282

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fde5105
feat: bump scarb
ericnordelo Dec 16, 2024
e311c2f
Merge branch 'feat/bump-scarb-to-2.9.2' into feat/add-macros-package
ericnordelo Dec 16, 2024
89d9ea4
feat: add crate
ericnordelo Dec 17, 2024
5bebd2d
feat: add oz_component file
ericnordelo Dec 18, 2024
b75027f
feat: add main logic
ericnordelo Jan 2, 2025
c164f00
Merge branch 'main' of github.com:OpenZeppelin/cairo-contracts into f…
ericnordelo Jan 2, 2025
acd4516
feat: add snapshot tests to macros
ericnordelo Jan 8, 2025
6814d0b
feat: format output
ericnordelo Jan 8, 2025
44c6491
feat: add warnings
ericnordelo Jan 8, 2025
72fdfeb
feat: add tests for new warnings
ericnordelo Jan 8, 2025
e81beec
feat: add snapshots
ericnordelo Jan 8, 2025
5762562
Merge branch 'main' of github.com:OpenZeppelin/cairo-contracts into f…
ericnordelo Jan 21, 2025
06705c6
feat: add more tests
ericnordelo Jan 21, 2025
d0d9faf
feat: add more tests and warnings
ericnordelo Jan 22, 2025
ba61a95
feat: remove unused dependency
ericnordelo Jan 22, 2025
81b9997
feat: add github action
ericnordelo Jan 22, 2025
0a2d5de
feat: add doc entry
ericnordelo Jan 22, 2025
b2f67e9
fix: typo
ericnordelo Jan 22, 2025
02daa77
feat: add accounts
ericnordelo Jan 22, 2025
edb6688
feat: update CHANGELOG
ericnordelo Jan 22, 2025
904b7f8
Merge branch 'main' of github.com:OpenZeppelin/cairo-contracts into f…
ericnordelo Jan 27, 2025
c58bae0
feat: test existing event struct
ericnordelo Jan 27, 2025
c8e802d
docs: finish with_components entry
ericnordelo Jan 27, 2025
e1e3db8
Update docs/modules/ROOT/pages/api/macros.adoc
ericnordelo Jan 29, 2025
8d25611
Update packages/macros/src/tests/test_with_components.rs
ericnordelo Jan 29, 2025
32754b9
Update packages/macros/src/tests/test_with_components.rs
ericnordelo Jan 29, 2025
6036d83
Update packages/macros/src/with_components.rs
ericnordelo Jan 29, 2025
455cc40
Update packages/macros/src/tests/test_with_components.rs
ericnordelo Jan 29, 2025
3c757b7
feat: apply review updates
ericnordelo Jan 29, 2025
408c318
Update packages/macros/src/with_components.rs
ericnordelo Feb 17, 2025
b3e9fec
Update packages/macros/src/with_components.rs
ericnordelo Feb 17, 2025
a542c28
Merge branch 'main' into feat/add-macros-package
ericnordelo Feb 24, 2025
fe0f47a
feat: apply review suggestions
ericnordelo Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update docs/modules/ROOT/pages/api/macros.adoc
Co-authored-by: Andrew Fleming <[email protected]>
  • Loading branch information
ericnordelo and andrew-fleming authored Jan 29, 2025
commit e1e3db8af7cd43acda38f58f8f1ca9e129977af3
12 changes: 6 additions & 6 deletions docs/modules/ROOT/pages/api/macros.adoc
Original file line number Diff line number Diff line change
@@ -18,12 +18,12 @@ openzeppelin_macros = "0.20.0"

This macro simplifies the syntax for adding a set of components to a contract. It:

- _Imports the corresponding components into the contract_
- _Adds the corresponding `component!` macro entries_
- _Adds the storage entries for each component to the Storage struct_
- _Adds the event entries for each component to the Event struct, or creates the struct if it is missing_
- _Brings the corresponding internal implementations into scope_
- _Provides some diagnostics for each specific component to help the developer avoid common mistakes_
- _Imports the corresponding components into the contract._
- _Adds the corresponding `component!` macro entries._
- _Adds the storage entries for each component to the Storage struct._
- _Adds the event entries for each component to the Event struct, or creates the struct if it is missing._
- _Brings the corresponding internal implementations into scope._
- _Provides some diagnostics for each specific component to help the developer avoid common mistakes._

CAUTION: Since the macro does not expose any external implementations, developers must make sure to specify explicitly
the ones required by the contract.