-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(metadata): basic metadata api support (#38)
* Modify xcq-types * add metadata api
- Loading branch information
1 parent
2350545
commit 38a9804
Showing
38 changed files
with
1,133 additions
and
571 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
use parity_scale_codec::{Decode, Encode}; | ||
use scale_info::prelude::vec::Vec; | ||
use xcq_extension::extension; | ||
use parity_scale_codec::Encode; | ||
use xcq_extension::decl_extensions; | ||
|
||
#[extension] | ||
pub trait ExtensionCore { | ||
type Config: Config; | ||
fn has_extension(id: <Self::Config as Config>::ExtensionId) -> bool; | ||
// crypto functions | ||
// fn blake2_64(data: Vec<u8>) -> [u8; 8]; | ||
// fn blake2_128(data: Vec<u8>) -> [u8; 16]; | ||
// fn blake2_256(data: Vec<u8>) -> [u8; 32]; | ||
// fn twox_64(data: Vec<u8>) -> [u8; 8]; | ||
// fn read_storage(key: Vec<u8>) -> Option<Vec<u8>>; | ||
} | ||
pub trait Config { | ||
type ExtensionId: Decode; | ||
type ExtensionId: Encode; | ||
} | ||
|
||
decl_extensions! { | ||
pub trait ExtensionCore { | ||
type Config: Config; | ||
fn has_extension(id: <Self::Config as Config>::ExtensionId) -> bool; | ||
// crypto functions | ||
// fn blake2_64(data: Vec<u8>) -> [u8; 8]; | ||
// fn blake2_128(data: Vec<u8>) -> [u8; 16]; | ||
// fn blake2_256(data: Vec<u8>) -> [u8; 32]; | ||
// fn twox_64(data: Vec<u8>) -> [u8; 8]; | ||
// fn read_storage(key: Vec<u8>) -> Option<Vec<u8>>; | ||
} | ||
} |
This file contains 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
Oops, something went wrong.