-
Notifications
You must be signed in to change notification settings - Fork 11
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
Tutorial step 3- Uplift to latest ink! and Openbrush #15
base: tutorial/trait-step3
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check comments
@@ -1,5 +1,4 @@ | |||
#![cfg_attr(not(feature = "std"), no_std)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add no_main
instance._init_with_owner(instance.env().caller()); | ||
let collection_id = instance.collection_id(); | ||
instance._set_attribute( | ||
let mut _instance = Self::default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove _
#[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 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
No description provided.