We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Change proc_macro style to proc_macro_attribute style
proc_macro
proc_macro_attribute
#[extension_decl] mod extension_core { #[extension_decl::config] pub trait Config { type ExtensionId: Codec; } #[extension_decl::view_fns] pub trait ExtensionCore<T: Config> { fn has_extension(id: T::ExtensionId) -> bool; } } #[extension_decl] mod extension_fungibles { #[extension_decl::config] pub trait Config { type AssetId: Codec; type AccountId: Codec; type Balance: Codec; } #[extension_decl::view_fns] pub trait ExtensionFungibles<T: Config> { fn total_supply(asset: T::AssetId) -> T::Balance; fn balance(asset: T::AssetId, who: T::AccountId) -> T::Balance; } } #[extensions_impl] mod extensions_impl { #[extensions_impl::extensions_config] pub struct ExtensionsConfig; #[extensions_impl::extensions_struct] pub struct Extensions; #[extensions_impl::extensions_config_impl] impl extension_core::Config for ExtensionsConfig { type ExtensionId = u64; } #[extensions_impl::extensions_config_impl] impl extension_fungibles::Config for ExtensionsConfig { type AssetId = u32; type AccountId = [u8; 32]; type Balance = u64; } #[extensions_impl::extension_struct_impl] impl extension_core::ExtensionCore<ExtensionConfig> for Extensions { fn has_extension(id: u64) -> bool { matches!(id, 0 | 1) } } #[extensions_impl::extension_struct_impl] impl extension_fungibles::ExtensionFungibles<ExtensionConfig> for Extensions { fn total_supply(asset: u32) -> u64 { 200 } fn balance(asset: u32, who: [u8; 32]) -> u64 { 100 } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Change
proc_macro
style toproc_macro_attribute
styleThe text was updated successfully, but these errors were encountered: