mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +00:00
Enhance decl storage (#777)
* enhance macro decl_storage() * update the state root hash * fix one comment
This commit is contained in:
@@ -11,6 +11,7 @@ parity-codec = { version = "2.0", default-features = false }
|
||||
substrate-metadata = { path = "../metadata", default-features = false }
|
||||
sr-std = { path = "../../core/sr-std", default-features = false }
|
||||
sr-io = { path = "../../core/sr-io", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
mashup = "0.1.7"
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -26,6 +27,7 @@ std = [
|
||||
"sr-io/std",
|
||||
"parity-codec/std",
|
||||
"sr-std/std",
|
||||
"sr-primitives/std",
|
||||
"substrate-metadata/std",
|
||||
]
|
||||
nightly = []
|
||||
|
||||
@@ -29,6 +29,8 @@ extern crate serde;
|
||||
|
||||
extern crate sr_std as rstd;
|
||||
extern crate sr_io as runtime_io;
|
||||
#[cfg(feature = "std")]
|
||||
pub extern crate sr_primitives as runtime_primitives;
|
||||
extern crate substrate_metadata;
|
||||
|
||||
extern crate mashup;
|
||||
|
||||
@@ -188,7 +188,11 @@ mod tests {
|
||||
|
||||
decl_storage! {
|
||||
trait Store for Module<T: Trait> as TestStorage {
|
||||
StorageMethod : u32;
|
||||
StorageMethod : Option<u32>;
|
||||
}
|
||||
add_extra_genesis {
|
||||
config(_marker) : ::std::marker::PhantomData<T>;
|
||||
build(|_, _| {});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -312,7 +316,7 @@ mod tests {
|
||||
functions: DecodeDifferent::Encode(&[
|
||||
StorageFunctionMetadata {
|
||||
name: DecodeDifferent::Encode("StorageMethod"),
|
||||
modifier: StorageFunctionModifier::None,
|
||||
modifier: StorageFunctionModifier::Optional,
|
||||
ty: StorageFunctionType::Plain(DecodeDifferent::Encode("u32")),
|
||||
documentation: DecodeDifferent::Encode(&[]),
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user