mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 00:28:01 +00:00
Reformat types string for decl_storage (#1298)
* Clean space from types when converting to string * Missing cases. * Add unit test for complex type, complete clean fn.
This commit is contained in:
@@ -633,6 +633,10 @@ mod tests {
|
||||
|
||||
GETMAPU32MYDEF get(map_u32_getter_mydef): map u32 => String = "map".into();
|
||||
pub PUBGETMAPU32MYDEF get(pub_map_u32_getter_mydef): map u32 => String = "pubmap".into();
|
||||
|
||||
COMPLEX_TYPE1: ::std::vec::Vec<<T as Trait>::Origin>;
|
||||
COMPLEX_TYPE2: (Vec<Vec<(u16,Box<( )>)>>, u32);
|
||||
COMPLEX_TYPE3: ([u32;25]);
|
||||
}
|
||||
add_extra_genesis {
|
||||
build(|_, _, _| {});
|
||||
@@ -677,7 +681,7 @@ mod tests {
|
||||
StorageFunctionMetadata {
|
||||
name: DecodeDifferent::Encode("GETU32"),
|
||||
modifier: StorageFunctionModifier::Default,
|
||||
ty: StorageFunctionType::Plain(DecodeDifferent::Encode("T :: Origin")),
|
||||
ty: StorageFunctionType::Plain(DecodeDifferent::Encode("T::Origin")),
|
||||
documentation: DecodeDifferent::Encode(&[]),
|
||||
},
|
||||
StorageFunctionMetadata {
|
||||
@@ -796,6 +800,24 @@ mod tests {
|
||||
},
|
||||
documentation: DecodeDifferent::Encode(&[]),
|
||||
},
|
||||
StorageFunctionMetadata {
|
||||
name: DecodeDifferent::Encode("COMPLEX_TYPE1"),
|
||||
modifier: StorageFunctionModifier::Default,
|
||||
ty: StorageFunctionType::Plain(DecodeDifferent::Encode("::std::vec::Vec<<T as Trait>::Origin>")),
|
||||
documentation: DecodeDifferent::Encode(&[]),
|
||||
},
|
||||
StorageFunctionMetadata {
|
||||
name: DecodeDifferent::Encode("COMPLEX_TYPE2"),
|
||||
modifier: StorageFunctionModifier::Default,
|
||||
ty: StorageFunctionType::Plain(DecodeDifferent::Encode("(Vec<Vec<(u16, Box<()>)>>, u32)")),
|
||||
documentation: DecodeDifferent::Encode(&[]),
|
||||
},
|
||||
StorageFunctionMetadata {
|
||||
name: DecodeDifferent::Encode("COMPLEX_TYPE3"),
|
||||
modifier: StorageFunctionModifier::Default,
|
||||
ty: StorageFunctionType::Plain(DecodeDifferent::Encode("([u32; 25])")),
|
||||
documentation: DecodeDifferent::Encode(&[]),
|
||||
},
|
||||
])
|
||||
};
|
||||
|
||||
@@ -816,6 +838,7 @@ mod tests {
|
||||
assert_eq!(config.pub_u32_getter_with_config_mydef, 1u32);
|
||||
assert_eq!(config.pub_u32_getter_with_config_mydef_opt, 100u32);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user