cargo +nightly fmt

This commit is contained in:
Tadeo hepperle
2023-05-10 14:26:10 +02:00
parent 213bc4c47a
commit a3419a6f44
94 changed files with 326 additions and 259 deletions
-1
View File
@@ -6,7 +6,6 @@ mod retain;
mod validation;
use frame_metadata::{v14::RuntimeMetadataV14, v15::RuntimeMetadataV15};
pub use retain::retain_metadata_pallets;
pub use validation::{
get_call_hash, get_constant_hash, get_metadata_hash, get_metadata_per_pallet_hash,
+10 -7
View File
@@ -4,15 +4,16 @@
//! Utility functions to generate a subset of the metadata.
use frame_metadata::v15::{
ExtrinsicMetadata, PalletMetadata, RuntimeApiMetadata, RuntimeMetadataV15, StorageEntryType,
};
use scale_info::{form::PortableForm, interner::UntrackedSymbol, TypeDef};
use std::{
any::TypeId,
collections::{BTreeMap, HashSet},
};
use frame_metadata::v15::{
ExtrinsicMetadata, PalletMetadata, RuntimeApiMetadata, RuntimeMetadataV15, StorageEntryType,
};
use scale_info::{form::PortableForm, interner::UntrackedSymbol, TypeDef};
/// Collect all type IDs needed to represent the provided pallet.
fn collect_pallet_types(pallet: &PalletMetadata<PortableForm>, type_ids: &mut HashSet<u32>) {
if let Some(storage) = &pallet.storage {
@@ -249,11 +250,13 @@ where
#[cfg(test)]
mod tests {
use super::*;
use crate::metadata_v14_to_latest;
use std::{fs, path::Path};
use codec::Decode;
use frame_metadata::{v15::RuntimeMetadataV15, RuntimeMetadata, RuntimeMetadataPrefixed};
use std::{fs, path::Path};
use super::*;
use crate::metadata_v14_to_latest;
fn load_metadata() -> RuntimeMetadataV15 {
let bytes = fs::read(Path::new("../artifacts/polkadot_metadata.scale"))
+4 -2
View File
@@ -4,12 +4,13 @@
//! Utility functions for metadata validation.
use std::collections::HashSet;
use frame_metadata::v15::{
ExtrinsicMetadata, PalletMetadata, RuntimeApiMetadata, RuntimeApiMethodMetadata,
RuntimeMetadataV15, StorageEntryMetadata, StorageEntryType,
};
use scale_info::{form::PortableForm, Field, PortableRegistry, TypeDef, Variant};
use std::collections::HashSet;
/// Start with a predefined hashing value for the pallets.
const MAGIC_PALLET_VALUE: &[u8] = &[19];
@@ -576,7 +577,6 @@ pub enum NotFound {
#[cfg(test)]
mod tests {
use super::*;
use bitvec::{order::Lsb0, vec::BitVec};
use frame_metadata::v15::{
ExtrinsicMetadata, PalletCallMetadata, PalletConstantMetadata, PalletErrorMetadata,
@@ -585,6 +585,8 @@ mod tests {
};
use scale_info::meta_type;
use super::*;
// Define recursive types.
#[allow(dead_code)]
#[derive(scale_info::TypeInfo)]