Tutorial step 3- Uplift to latest ink! and Openbrush#15
Open
bobo-k2 wants to merge 3 commits intotutorial/trait-step3from
Open
Tutorial step 3- Uplift to latest ink! and Openbrush#15bobo-k2 wants to merge 3 commits intotutorial/trait-step3from
bobo-k2 wants to merge 3 commits intotutorial/trait-step3from
Conversation
Maar-io
requested changes
Jul 31, 2023
| @@ -1,5 +1,4 @@ | |||
| #![cfg_attr(not(feature = "std"), no_std)] | |||
| instance._init_with_owner(instance.env().caller()); | ||
| let collection_id = instance.collection_id(); | ||
| instance._set_attribute( | ||
| let mut _instance = Self::default(); |
Comment on lines
21
to
17
| #[openbrush::trait_definition] | ||
| pub trait PayableMintImpl: psp34::InternalImpl { | ||
| #[ink(message, payable)] | ||
| fn mint(&mut self, account: AccountId, id: Id) -> Result<(), PSP34Error> { | ||
| if Self::env().transferred_value() != 1_000_000_000_000_000_000 { | ||
| return Err(PSP34Error::Custom(String::from("BadMintValue"))) | ||
| return Err(PSP34Error::Custom(String::from("BadMintValue"))); | ||
| } | ||
| self._mint_to(account, id) | ||
|
|
||
| psp34::InternalImpl::_mint_to(self, account, id) | ||
| } | ||
| } No newline at end of file | ||
| } |
Member
There was a problem hiding this comment.
This look to me like the overide of the mint() psp34:InternalImpl.
This chapter was about how to create custom trait, while the code is just overriding OB mint function.
I feel the best would be to delete this whole step in the code and in the doc merge chapters
- Custom Trait
- PayableMint trait
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.