mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 21:17:56 +00:00
Make the codegen more accessible for running in WASM (#1154)
* minor api changes * parsing instead of format_ident! * fix self issue * expose types on typegen * web wasm support via feature flag * fmt and clippy * small adjustments * remove exposing of types() in type generator * adjust compile error * remove little any flag * Need access to the type registry from the typegen again * Bump proc-macro2 from 1.0.66 to 1.0.67 (#1164) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.66 to 1.0.67. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.66...1.0.67) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump serde_json from 1.0.106 to 1.0.107 (#1166) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.106 to 1.0.107. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.106...v1.0.107) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump trybuild from 1.0.84 to 1.0.85 (#1167) Bumps [trybuild](https://github.com/dtolnay/trybuild) from 1.0.84 to 1.0.85. - [Release notes](https://github.com/dtolnay/trybuild/releases) - [Commits](https://github.com/dtolnay/trybuild/compare/1.0.84...1.0.85) --- updated-dependencies: - dependency-name: trybuild dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump Swatinem/rust-cache from 2.6.2 to 2.7.0 (#1168) Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.6.2 to 2.7.0. - [Release notes](https://github.com/swatinem/rust-cache/releases) - [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md) - [Commits](https://github.com/swatinem/rust-cache/compare/e207df5d269b42b69c8bc5101da26f7d31feddb4...a95ba195448af2da9b00fb742d14ffaaf3c21f43) --- updated-dependencies: - dependency-name: Swatinem/rust-cache dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump jsonrpsee from 0.20.0 to 0.20.1 (#1165) Bumps [jsonrpsee](https://github.com/paritytech/jsonrpsee) from 0.20.0 to 0.20.1. - [Release notes](https://github.com/paritytech/jsonrpsee/releases) - [Changelog](https://github.com/paritytech/jsonrpsee/blob/v0.20.1/CHANGELOG.md) - [Commits](https://github.com/paritytech/jsonrpsee/compare/v0.20.0...v0.20.1) --- updated-dependencies: - dependency-name: jsonrpsee dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump clap from 4.4.2 to 4.4.3 (#1163) Bumps [clap](https://github.com/clap-rs/clap) from 4.4.2 to 4.4.3. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.2...v4.4.3) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix double quote import introduced by merge * clippy * put ensure_unique_types on metadata, revert toml changes * fmt * solve frame_metadata import * tidy fetch-metadata and non_exhaustive on errors * remove the getrandom thing * fix toml autoformatting --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
+22
-29
@@ -13,7 +13,6 @@ use scale_info::Variant;
|
||||
|
||||
use subxt_metadata::{
|
||||
ConstantMetadata, Metadata, PalletMetadata, RuntimeApiMetadata, StorageEntryMetadata,
|
||||
StorageEntryType,
|
||||
};
|
||||
|
||||
/// Explore the differences between two nodes
|
||||
@@ -220,40 +219,34 @@ impl StorageEntryDiff {
|
||||
metadata_1: &Metadata,
|
||||
metadata_2: &Metadata,
|
||||
) -> Self {
|
||||
let value_1_ty_id = match storage_entry_1.entry_type() {
|
||||
StorageEntryType::Plain(value_ty) | StorageEntryType::Map { value_ty, .. } => value_ty,
|
||||
};
|
||||
let value_1_ty_id = storage_entry_1.entry_type().value_ty();
|
||||
let value_1_hash = metadata_1
|
||||
.type_hash(*value_1_ty_id)
|
||||
.type_hash(value_1_ty_id)
|
||||
.expect("type should be present");
|
||||
let value_2_ty_id = match storage_entry_2.entry_type() {
|
||||
StorageEntryType::Plain(value_ty) | StorageEntryType::Map { value_ty, .. } => value_ty,
|
||||
};
|
||||
let value_2_ty_id = storage_entry_2.entry_type().value_ty();
|
||||
let value_2_hash = metadata_1
|
||||
.type_hash(*value_2_ty_id)
|
||||
.type_hash(value_2_ty_id)
|
||||
.expect("type should be present");
|
||||
let value_different = value_1_hash != value_2_hash;
|
||||
|
||||
let key_1_hash = match storage_entry_1.entry_type() {
|
||||
StorageEntryType::Plain(_) => None,
|
||||
StorageEntryType::Map { key_ty, .. } => Some(*key_ty),
|
||||
}
|
||||
.map(|key_ty| {
|
||||
metadata_1
|
||||
.type_hash(key_ty)
|
||||
.expect("type should be present")
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let key_2_hash = match storage_entry_2.entry_type() {
|
||||
StorageEntryType::Plain(_) => None,
|
||||
StorageEntryType::Map { key_ty, .. } => Some(*key_ty),
|
||||
}
|
||||
.map(|key_ty| {
|
||||
metadata_2
|
||||
.type_hash(key_ty)
|
||||
.expect("type should be present")
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let key_1_hash = storage_entry_1
|
||||
.entry_type()
|
||||
.key_ty()
|
||||
.map(|key_ty| {
|
||||
metadata_1
|
||||
.type_hash(key_ty)
|
||||
.expect("type should be present")
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let key_2_hash = storage_entry_2
|
||||
.entry_type()
|
||||
.key_ty()
|
||||
.map(|key_ty| {
|
||||
metadata_2
|
||||
.type_hash(key_ty)
|
||||
.expect("type should be present")
|
||||
})
|
||||
.unwrap_or_default();
|
||||
let key_different = key_1_hash != key_2_hash;
|
||||
|
||||
StorageEntryDiff {
|
||||
|
||||
Reference in New Issue
Block a user