mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
[Deps] Bump scale-info to match cumulus and polkadot (#13873)
* [Deps] Bump scale-info to match cumulus and polkadot * fix Cargo.lock * fix identity * more fixes * fix * fixes * more fixes
This commit is contained in:
@@ -442,7 +442,7 @@ mod tests {
|
||||
let mut registry = scale_info::Registry::new();
|
||||
let type_id = registry.register_type(&scale_info::meta_type::<Data>());
|
||||
let registry: scale_info::PortableRegistry = registry.into();
|
||||
let type_info = registry.resolve(type_id.id()).unwrap();
|
||||
let type_info = registry.resolve(type_id.id).unwrap();
|
||||
|
||||
let check_type_info = |data: &Data| {
|
||||
let variant_name = match data {
|
||||
@@ -453,20 +453,20 @@ mod tests {
|
||||
Data::ShaThree256(_) => "ShaThree256".to_string(),
|
||||
Data::Raw(bytes) => format!("Raw{}", bytes.len()),
|
||||
};
|
||||
if let scale_info::TypeDef::Variant(variant) = type_info.type_def() {
|
||||
if let scale_info::TypeDef::Variant(variant) = &type_info.type_def {
|
||||
let variant = variant
|
||||
.variants()
|
||||
.variants
|
||||
.iter()
|
||||
.find(|v| v.name() == &variant_name)
|
||||
.find(|v| v.name == variant_name)
|
||||
.expect(&format!("Expected to find variant {}", variant_name));
|
||||
|
||||
let field_arr_len = variant
|
||||
.fields()
|
||||
.fields
|
||||
.first()
|
||||
.and_then(|f| registry.resolve(f.ty().id()))
|
||||
.and_then(|f| registry.resolve(f.ty.id))
|
||||
.map(|ty| {
|
||||
if let scale_info::TypeDef::Array(arr) = ty.type_def() {
|
||||
arr.len()
|
||||
if let scale_info::TypeDef::Array(arr) = &ty.type_def {
|
||||
arr.len
|
||||
} else {
|
||||
panic!("Should be an array type")
|
||||
}
|
||||
@@ -474,7 +474,7 @@ mod tests {
|
||||
.unwrap_or(0);
|
||||
|
||||
let encoded = data.encode();
|
||||
assert_eq!(encoded[0], variant.index());
|
||||
assert_eq!(encoded[0], variant.index);
|
||||
assert_eq!(encoded.len() as u32 - 1, field_arr_len);
|
||||
} else {
|
||||
panic!("Should be a variant type")
|
||||
|
||||
Reference in New Issue
Block a user