XXX: Use v15 docs

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-02-22 18:20:00 +02:00
parent 8911550234
commit 16d43d28af
13 changed files with 42 additions and 37 deletions
Generated
+16 -17
View File
@@ -957,6 +957,16 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "frame-metadata"
version = "15.0.0"
dependencies = [
"cfg-if",
"parity-scale-codec",
"scale-info",
"serde",
]
[[package]]
name = "frame-metadata"
version = "15.0.0"
@@ -968,17 +978,6 @@ dependencies = [
"scale-info",
]
[[package]]
name = "frame-metadata"
version = "15.0.0"
source = "git+https://github.com/paritytech/frame-metadata/?branch=lexnv/md_v15_test#35b8304e004f9a759aa2663e24c5f56e2a50c301"
dependencies = [
"cfg-if",
"parity-scale-codec",
"scale-info",
"serde",
]
[[package]]
name = "funty"
version = "2.0.0"
@@ -1508,7 +1507,7 @@ name = "integration-tests"
version = "0.25.0"
dependencies = [
"assert_matches",
"frame-metadata 15.0.0 (git+https://github.com/paritytech/frame-metadata/?branch=lexnv/md_v15_test)",
"frame-metadata 15.0.0",
"futures",
"hex",
"parity-scale-codec",
@@ -3338,7 +3337,7 @@ dependencies = [
"bitvec",
"blake2",
"derivative",
"frame-metadata 15.0.0 (git+https://github.com/paritytech/frame-metadata/?branch=lexnv/md_v15_test)",
"frame-metadata 15.0.0",
"futures",
"getrandom 0.2.8",
"hex",
@@ -3371,7 +3370,7 @@ version = "0.25.0"
dependencies = [
"clap 4.1.1",
"color-eyre",
"frame-metadata 15.0.0 (git+https://github.com/paritytech/frame-metadata/?branch=lexnv/md_v15_test)",
"frame-metadata 15.0.0",
"hex",
"jsonrpsee",
"parity-scale-codec",
@@ -3389,7 +3388,7 @@ version = "0.25.0"
dependencies = [
"bitvec",
"darling",
"frame-metadata 15.0.0 (git+https://github.com/paritytech/frame-metadata/?branch=lexnv/md_v15_test)",
"frame-metadata 15.0.0",
"heck",
"hex",
"jsonrpsee",
@@ -3435,7 +3434,7 @@ version = "0.25.0"
dependencies = [
"bitvec",
"criterion",
"frame-metadata 15.0.0 (git+https://github.com/paritytech/frame-metadata/?branch=lexnv/md_v15_test)",
"frame-metadata 15.0.0",
"parity-scale-codec",
"scale-info",
"sp-core-hashing",
@@ -3811,7 +3810,7 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
name = "ui-tests"
version = "0.25.0"
dependencies = [
"frame-metadata 15.0.0 (git+https://github.com/paritytech/frame-metadata/?branch=lexnv/md_v15_test)",
"frame-metadata 15.0.0",
"parity-scale-codec",
"scale-info",
"subxt",
+1 -1
View File
@@ -31,7 +31,7 @@ serde_json = "1.0.68"
# hex encoded metadata to bytes
hex = "0.4.3"
# actual metadata types
frame-metadata = { version = "15.0.0", git = "https://github.com/paritytech/frame-metadata/", branch = "lexnv/md_v15_test", default-features = false, features = ["std", "v14", "v15-unstable"] }
frame-metadata = { version = "15.0.0", path = "/home/lexnv/workspace/frame-metadata/frame-metadata", default-features = false, features = ["std", "v14", "v15-unstable"] }
# decode bytes into the metadata types
scale = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
# generate the item mod for codegen
+1 -1
View File
@@ -14,7 +14,7 @@ description = "Generate an API for interacting with a substrate node from FRAME
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full"] }
darling = "0.14.0"
frame-metadata = { version = "15.0.0", git = "https://github.com/paritytech/frame-metadata/", branch = "lexnv/md_v15_test", default-features = false, features = ["std", "v14", "v15-unstable"] }
frame-metadata = { version = "15.0.0", path = "/home/lexnv/workspace/frame-metadata/frame-metadata", default-features = false, features = ["std", "v14", "v15-unstable"] }
heck = "0.4.0"
proc-macro2 = "1.0.24"
proc-macro-error = "1.0.4"
+2 -2
View File
@@ -9,9 +9,9 @@ use crate::{
},
CratePath,
};
use frame_metadata::{
v15::RuntimeMetadataV15,
use frame_metadata::v15::{
PalletMetadata,
RuntimeMetadataV15,
};
use heck::{
ToSnakeCase as _,
+2 -2
View File
@@ -6,9 +6,9 @@ use crate::{
types::TypeGenerator,
CratePath,
};
use frame_metadata::{
v15::RuntimeMetadataV15,
use frame_metadata::v15::{
PalletMetadata,
RuntimeMetadataV15,
};
use heck::ToSnakeCase as _;
use proc_macro2::TokenStream as TokenStream2;
+1 -1
View File
@@ -6,7 +6,7 @@ use crate::{
types::TypeGenerator,
CratePath,
};
use frame_metadata::PalletMetadata;
use frame_metadata::v15::PalletMetadata;
use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use scale_info::form::PortableForm;
+2
View File
@@ -141,7 +141,9 @@ pub fn generate_runtime_api_from_bytes(
let decoded: Option<frame_metadata::OpaqueMetadata> = Decode::decode(&mut &*bytes)
.unwrap_or_else(|e| abort_call_site!("Failed to decode opaque metadata: {}", e));
let decoded = decoded.unwrap();
let bytes = &decoded.0;
let metadata: RuntimeMetadataPrefixed = Decode::decode(&mut &bytes[..])
.unwrap_or_else(|e| abort_call_site!("Failed to decode metadata: {}", e));
+4 -2
View File
@@ -7,8 +7,10 @@ use crate::{
CratePath,
};
use frame_metadata::{
v15::RuntimeMetadataV15,
PalletMetadata,
v15::{
PalletMetadata,
RuntimeMetadataV15,
},
StorageEntryMetadata,
StorageEntryModifier,
StorageEntryType,
+1 -1
View File
@@ -14,7 +14,7 @@ description = "Command line utilities for checking metadata compatibility betwee
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full"] }
frame-metadata = { version = "15.0.0", git = "https://github.com/paritytech/frame-metadata/", branch = "lexnv/md_v15_test", default-features = false, features = ["std", "v14", "v15-unstable"] }
frame-metadata = { version = "15.0.0", path = "/home/lexnv/workspace/frame-metadata/frame-metadata", default-features = false, features = ["std", "v14", "v15-unstable"] }
scale-info = "2.0.0"
sp-core-hashing = "6.0.0"
+9 -7
View File
@@ -377,7 +377,8 @@ pub fn get_metadata_hash(metadata: &RuntimeMetadataV15) -> [u8; 32] {
.pallets
.iter()
.map(|pallet| {
let hash = get_pallet_hash(&metadata.types, pallet);
// let hash = get_pallet_hash(&metadata.types, pallet);
let hash = [0u8; 32];
(&*pallet.name, hash)
})
.collect();
@@ -425,12 +426,13 @@ pub fn get_metadata_per_pallet_hash<T: AsRef<str>>(
let in_pallet = pallets
.iter()
.any(|pallet_ref| pallet_ref.as_ref() == pallet.name);
if in_pallet {
let hash = get_pallet_hash(&metadata.types, pallet);
Some((&*pallet.name, hash))
} else {
None
}
None
// if in_pallet {
// let hash = get_pallet_hash(&metadata.types, pallet);
// Some((&*pallet.name, hash))
// } else {
// None
// }
})
.collect();
+1 -1
View File
@@ -47,7 +47,7 @@ serde_json = { version = "1.0.64", features = ["raw_value"] }
thiserror = "1.0.24"
tracing = "0.1.34"
parking_lot = "0.12.0"
frame-metadata = { version = "15.0.0", git = "https://github.com/paritytech/frame-metadata/", branch = "lexnv/md_v15_test", default-features = false, features = ["std", "v14", "v15-unstable"] }
frame-metadata = { version = "15.0.0", path = "/home/lexnv/workspace/frame-metadata/frame-metadata", default-features = false, features = ["std", "v14", "v15-unstable"] }
derivative = "2.2.0"
subxt-macro = { version = "0.25.0", path = "../macro" }
+1 -1
View File
@@ -18,7 +18,7 @@ default = ["subxt/integration-tests"]
[dev-dependencies]
assert_matches = "1.5.0"
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] }
frame-metadata = { version = "15.0.0", git = "https://github.com/paritytech/frame-metadata/", branch = "lexnv/md_v15_test", default-features = false, features = ["std", "v14", "v15-unstable"] }
frame-metadata = { version = "15.0.0", path = "/home/lexnv/workspace/frame-metadata/frame-metadata", default-features = false, features = ["std", "v14", "v15-unstable"] }
futures = "0.3.13"
hex = "0.4.3"
regex = "1.5.0"
+1 -1
View File
@@ -11,6 +11,6 @@ publish = false
[dev-dependencies]
trybuild = "1.0.76"
scale-info = { version = "2.3.0", features = ["bit-vec"] }
frame-metadata = { version = "15.0.0", git = "https://github.com/paritytech/frame-metadata/", branch = "lexnv/md_v15_test", default-features = false, features = ["std", "v14", "v15-unstable"] }
frame-metadata = { version = "15.0.0", path = "/home/lexnv/workspace/frame-metadata/frame-metadata", default-features = false, features = ["std", "v14", "v15-unstable"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] }
subxt = { path = "../../subxt" }