Implement CheckedMetadataHashExtension (#211)

This commit is contained in:
Amar Singh
2024-10-28 13:59:30 -04:00
committed by GitHub
parent 46a9a3f4e8
commit 3df636d524
8 changed files with 28 additions and 14 deletions
+1
View File
@@ -31,6 +31,7 @@ smallvec = "1.11.0"
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
+3 -1
View File
@@ -20,6 +20,7 @@ smallvec = { workspace = true }
# Substrate
frame-benchmarking = { workspace = true, optional = true }
frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-benchmarking = { workspace = true, optional = true }
@@ -128,6 +129,7 @@ std = [
"fp-self-contained/std",
"frame-benchmarking?/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
@@ -185,7 +187,7 @@ std = [
"xcm/std",
]
async-backing = []
metadata-hash = [ "substrate-wasm-builder/metadata-hash" ]
runtime-benchmarks = [
"assets-common/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
+9 -6
View File
@@ -1,10 +1,13 @@
#[cfg(feature = "std")]
#[cfg(all(not(feature = "metadata-hash"), feature = "std"))]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
substrate_wasm_builder::WasmBuilder::build_using_defaults();
}
#[cfg(all(feature = "metadata-hash", feature = "std"))]
fn main() {
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("UNIT", 12)
.build();
}
/// The wasm builder is deactivated when compiling
+1
View File
@@ -75,6 +75,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);
+1
View File
@@ -29,6 +29,7 @@ smallvec = "1.11.0"
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, tag = "polkadot-stable2407-1" }
+3 -1
View File
@@ -20,6 +20,7 @@ smallvec = { workspace = true }
# Substrate
frame-benchmarking = { workspace = true, optional = true }
frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-benchmarking = { workspace = true, optional = true }
@@ -105,6 +106,7 @@ std = [
"cumulus-primitives-utility/std",
"frame-benchmarking?/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
@@ -157,7 +159,7 @@ std = [
"xcm/std",
]
async-backing = []
metadata-hash = [ "substrate-wasm-builder/metadata-hash" ]
runtime-benchmarks = [
"assets-common/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
+9 -6
View File
@@ -1,10 +1,13 @@
#[cfg(feature = "std")]
#[cfg(all(not(feature = "metadata-hash"), feature = "std"))]
fn main() {
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
substrate_wasm_builder::WasmBuilder::build_using_defaults();
}
#[cfg(all(feature = "metadata-hash", feature = "std"))]
fn main() {
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("UNIT", 12)
.build();
}
/// The wasm builder is deactivated when compiling
+1
View File
@@ -70,6 +70,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
);