Update scale-info to 2.5.0 (#896)

* Upodate scale-info to 2.5.0

* A couple more clippy fixes

* more deprecation things that appeared
This commit is contained in:
James Wilson
2023-04-03 12:52:25 +01:00
committed by GitHub
parent 34f0521fd2
commit c08eb6c8f1
25 changed files with 150 additions and 155 deletions
+5 -5
View File
@@ -155,16 +155,16 @@ where
}
StorageEntryType::Map { hashers, key, .. } => {
let ty = metadata
.resolve_type(key.id())
.ok_or_else(|| StorageAddressError::TypeNotFound(key.id()))?;
.resolve_type(key.id)
.ok_or(StorageAddressError::TypeNotFound(key.id))?;
// If the key is a tuple, we encode each value to the corresponding tuple type.
// If the key is not a tuple, encode a single value to the key type.
let type_ids = match ty.type_def() {
let type_ids = match &ty.type_def {
TypeDef::Tuple(tuple) => {
either::Either::Left(tuple.fields().iter().map(|f| f.id()))
either::Either::Left(tuple.fields.iter().map(|f| f.id))
}
_other => either::Either::Right(std::iter::once(key.id())),
_other => either::Either::Right(std::iter::once(key.id)),
};
if type_ids.len() != self.storage_entry_keys.len() {
+4 -4
View File
@@ -352,8 +352,8 @@ fn lookup_storage_return_type(
/// Fetch the return type out of a [`StorageEntryType`].
fn return_type_from_storage_entry_type(entry: &StorageEntryType<PortableForm>) -> u32 {
match entry {
StorageEntryType::Plain(ty) => ty.id(),
StorageEntryType::Map { value, .. } => value.id(),
StorageEntryType::Plain(ty) => ty.id,
StorageEntryType::Map { value, .. } => value.id,
}
}
@@ -367,8 +367,8 @@ fn decode_storage_with_metadata<T: DecodeWithMetadata>(
let ty = &metadata.pallet(pallet_name)?.storage(storage_entry)?.ty;
let id = match ty {
StorageEntryType::Plain(ty) => ty.id(),
StorageEntryType::Map { value, .. } => value.id(),
StorageEntryType::Plain(ty) => ty.id,
StorageEntryType::Map { value, .. } => value.id,
};
let val = T::decode_with_metadata(bytes, id, metadata)?;