mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 09:51:10 +00:00
cargo +nightly fmt
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
|
||||
// see LICENSE for license details.
|
||||
|
||||
use std::{fs, path::Path};
|
||||
|
||||
use codec::Decode;
|
||||
use criterion::*;
|
||||
use frame_metadata::{v15::RuntimeMetadataV15, RuntimeMetadata, RuntimeMetadataPrefixed};
|
||||
use scale_info::{form::PortableForm, TypeDef, TypeDefVariant};
|
||||
use std::{fs, path::Path};
|
||||
use subxt_metadata::{
|
||||
get_call_hash, get_constant_hash, get_metadata_hash, get_pallet_hash, get_storage_hash,
|
||||
metadata_v14_to_latest,
|
||||
|
||||
@@ -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
@@ -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,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)]
|
||||
|
||||
Reference in New Issue
Block a user