-
Notifications
You must be signed in to change notification settings - Fork 396
with_components support for ERC721Consecutive
#1660
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...s__test_with_components__cannot_use_erc721_consecutive_with_manual_erc721_enumerable.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| source: src/tests/test_with_components.rs | ||
| expression: result | ||
| snapshot_kind: text | ||
| --- | ||
| TokenStream: | ||
|
|
||
| None | ||
|
|
||
| Diagnostics: | ||
|
|
||
| ==== | ||
| Error: ERC721Enumerable and ERC721Consecutive interfere with each other in token ownership tracking and should not be used together. | ||
| ==== | ||
|
|
||
| AuxData: | ||
|
|
||
| None |
18 changes: 18 additions & 0 deletions
18
...s__test_with_components__cannot_use_erc721_enumerable_with_manual_erc721_consecutive.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| source: src/tests/test_with_components.rs | ||
| expression: result | ||
| snapshot_kind: text | ||
| --- | ||
| TokenStream: | ||
|
|
||
| None | ||
|
|
||
| Diagnostics: | ||
|
|
||
| ==== | ||
| Error: ERC721Enumerable and ERC721Consecutive interfere with each other in token ownership tracking and should not be used together. | ||
| ==== | ||
|
|
||
| AuxData: | ||
|
|
||
| None |
48 changes: 48 additions & 0 deletions
48
.../snapshots/openzeppelin_macros__tests__test_with_components__with_erc721_consecutive.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| --- | ||
| source: src/tests/test_with_components.rs | ||
| expression: result | ||
| snapshot_kind: text | ||
| --- | ||
| TokenStream: | ||
|
|
||
| #[starknet::contract] | ||
| pub mod MyContract { | ||
| use openzeppelin_token::erc721::extensions::DefaultConfig; | ||
| #[storage] | ||
| pub struct Storage { | ||
| #[substorage(v0)] | ||
| pub erc721_consecutive: ERC721ConsecutiveComponent::Storage, | ||
| } | ||
| use openzeppelin_token::erc721::extensions::ERC721ConsecutiveComponent; | ||
|
|
||
| component!( | ||
| path: ERC721ConsecutiveComponent, | ||
| storage: erc721_consecutive, | ||
| event: ERC721ConsecutiveEvent, | ||
| ); | ||
|
|
||
| impl ERC721ConsecutiveInternalImpl = ERC721ConsecutiveComponent::InternalImpl<ContractState>; | ||
|
|
||
| #[event] | ||
| #[derive(Drop, starknet::Event)] | ||
| enum Event { | ||
| #[flat] | ||
| ERC721ConsecutiveEvent: ERC721ConsecutiveComponent::Event, | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Diagnostics: | ||
|
|
||
| ==== | ||
| Warning: The ERC721Consecutive component requires calling both | ||
| `self.erc721_consecutive.before_update(...)` in `ERC721HooksTrait::before_update` | ||
| and `self.erc721_consecutive.after_update(...)` in `ERC721HooksTrait::after_update`, | ||
| and it looks like one or both are missing. | ||
|
|
||
| This may lead to incorrect ownership or burn tracking for consecutively minted tokens. | ||
| ==== | ||
|
|
||
| AuxData: | ||
|
|
||
| None |
52 changes: 52 additions & 0 deletions
52
...macros__tests__test_with_components__with_erc721_consecutive_custom_immutable_config.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| source: src/tests/test_with_components.rs | ||
| expression: result | ||
| snapshot_kind: text | ||
| --- | ||
| TokenStream: | ||
|
|
||
| #[starknet::contract] | ||
| pub mod MyContract { | ||
| use openzeppelin_token::erc721::extensions::ERC721ConsecutiveComponent; | ||
| pub impl ERC721ConsecutiveConfig of ERC721ConsecutiveComponent::ImmutableConfig { | ||
| const MAX_BATCH_SIZE: u64 = 4200; | ||
| const FIRST_CONSECUTIVE_ID: u64 = 42; | ||
| } | ||
| #[storage] | ||
| pub struct Storage { | ||
| #[substorage(v0)] | ||
| pub erc721_consecutive: ERC721ConsecutiveComponent::Storage, | ||
| } | ||
| use openzeppelin_token::erc721::extensions::ERC721ConsecutiveComponent; | ||
|
|
||
| component!( | ||
| path: ERC721ConsecutiveComponent, | ||
| storage: erc721_consecutive, | ||
| event: ERC721ConsecutiveEvent, | ||
| ); | ||
|
|
||
| impl ERC721ConsecutiveInternalImpl = ERC721ConsecutiveComponent::InternalImpl<ContractState>; | ||
|
|
||
| #[event] | ||
| #[derive(Drop, starknet::Event)] | ||
| enum Event { | ||
| #[flat] | ||
| ERC721ConsecutiveEvent: ERC721ConsecutiveComponent::Event, | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Diagnostics: | ||
|
|
||
| ==== | ||
| Warning: The ERC721Consecutive component requires calling both | ||
| `self.erc721_consecutive.before_update(...)` in `ERC721HooksTrait::before_update` | ||
| and `self.erc721_consecutive.after_update(...)` in `ERC721HooksTrait::after_update`, | ||
| and it looks like one or both are missing. | ||
|
|
||
| This may lead to incorrect ownership or burn tracking for consecutively minted tokens. | ||
| ==== | ||
|
|
||
| AuxData: | ||
|
|
||
| None |
54 changes: 54 additions & 0 deletions
54
.../openzeppelin_macros__tests__test_with_components__with_erc721_consecutive_no_config.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| --- | ||
| source: src/tests/test_with_components.rs | ||
| expression: result | ||
| snapshot_kind: text | ||
| --- | ||
| TokenStream: | ||
|
|
||
| #[starknet::contract] | ||
| pub mod MyContract { | ||
| #[storage] | ||
| pub struct Storage { | ||
| #[substorage(v0)] | ||
| pub erc721_consecutive: ERC721ConsecutiveComponent::Storage, | ||
| } | ||
| use openzeppelin_token::erc721::extensions::ERC721ConsecutiveComponent; | ||
|
|
||
| component!( | ||
| path: ERC721ConsecutiveComponent, | ||
| storage: erc721_consecutive, | ||
| event: ERC721ConsecutiveEvent, | ||
| ); | ||
|
|
||
| impl ERC721ConsecutiveInternalImpl = ERC721ConsecutiveComponent::InternalImpl<ContractState>; | ||
|
|
||
| #[event] | ||
| #[derive(Drop, starknet::Event)] | ||
| enum Event { | ||
| #[flat] | ||
| ERC721ConsecutiveEvent: ERC721ConsecutiveComponent::Event, | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Diagnostics: | ||
|
|
||
| ==== | ||
| Warning: The ERC721Consecutive component requires an ImmutableConfig implementation in scope and | ||
| it looks like it is missing. | ||
|
|
||
| You can use the default implementation by importing it: | ||
|
|
||
| `use openzeppelin_token::erc721::extensions::DefaultConfig;` | ||
| ======== | ||
| Warning: The ERC721Consecutive component requires calling both | ||
| `self.erc721_consecutive.before_update(...)` in `ERC721HooksTrait::before_update` | ||
| and `self.erc721_consecutive.after_update(...)` in `ERC721HooksTrait::after_update`, | ||
| and it looks like one or both are missing. | ||
|
|
||
| This may lead to incorrect ownership or burn tracking for consecutively minted tokens. | ||
| ==== | ||
|
|
||
| AuxData: | ||
|
|
||
| None |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.