Skip to content

Commit ba600bf

Browse files
authored
feat: add metadata hash check also for standalone node (#837)
The node is used in SDK integration tests, so we need to have it in there to make sure having support for it works fine.
1 parent e8a8754 commit ba600bf

File tree

5 files changed

+41
-31
lines changed

5 files changed

+41
-31
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodes/standalone/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jsonrpsee = { workspace = true, features = ["server"] }
2727
serde_json = { workspace = true }
2828

2929
# Internal dependencies
30-
kestrel-runtime = { workspace = true, features = ["std"] }
30+
kestrel-runtime = { workspace = true, features = ["metadata-hash", "std"] }
3131
runtime-common = { workspace = true, features = ["std"] }
3232

3333
# Substrate dependencies

runtimes/kestrel/Cargo.toml

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,34 @@ kilt-runtime-api-public-credentials = { workspace = true }
3939
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
4040

4141
# Substrate dependencies
42-
frame-executive = { workspace = true }
43-
frame-support = { workspace = true }
44-
frame-system = { workspace = true }
45-
pallet-aura = { workspace = true }
46-
pallet-authorship = { workspace = true }
47-
pallet-balances = { workspace = true }
48-
pallet-grandpa = { workspace = true }
49-
pallet-indices = { workspace = true }
50-
pallet-multisig = { workspace = true }
51-
pallet-proxy = { workspace = true }
52-
pallet-session = { workspace = true }
53-
pallet-sudo = { workspace = true }
54-
pallet-timestamp = { workspace = true }
55-
pallet-transaction-payment = { workspace = true }
56-
pallet-utility = { workspace = true }
57-
sp-api = { workspace = true }
58-
sp-block-builder = { workspace = true }
59-
sp-consensus-aura = { workspace = true }
60-
sp-core = { workspace = true }
61-
sp-genesis-builder = { workspace = true }
62-
sp-inherents = { workspace = true }
63-
sp-offchain = { workspace = true }
64-
sp-runtime = { workspace = true }
65-
sp-session = { workspace = true }
66-
sp-std = { workspace = true }
67-
sp-transaction-pool = { workspace = true }
68-
sp-version = { workspace = true }
42+
frame-executive = { workspace = true }
43+
frame-metadata-hash-extension = { workspace = true }
44+
frame-support = { workspace = true }
45+
frame-system = { workspace = true }
46+
pallet-aura = { workspace = true }
47+
pallet-authorship = { workspace = true }
48+
pallet-balances = { workspace = true }
49+
pallet-grandpa = { workspace = true }
50+
pallet-indices = { workspace = true }
51+
pallet-multisig = { workspace = true }
52+
pallet-proxy = { workspace = true }
53+
pallet-session = { workspace = true }
54+
pallet-sudo = { workspace = true }
55+
pallet-timestamp = { workspace = true }
56+
pallet-transaction-payment = { workspace = true }
57+
pallet-utility = { workspace = true }
58+
sp-api = { workspace = true }
59+
sp-block-builder = { workspace = true }
60+
sp-consensus-aura = { workspace = true }
61+
sp-core = { workspace = true }
62+
sp-genesis-builder = { workspace = true }
63+
sp-inherents = { workspace = true }
64+
sp-offchain = { workspace = true }
65+
sp-runtime = { workspace = true }
66+
sp-session = { workspace = true }
67+
sp-std = { workspace = true }
68+
sp-transaction-pool = { workspace = true }
69+
sp-version = { workspace = true }
6970

7071
# Benchmarking dependencies
7172
frame-benchmarking = { workspace = true, optional = true }
@@ -76,6 +77,7 @@ frame-try-runtime = { workspace = true, optional = true }
7677

7778
[features]
7879
default = ["std"]
80+
metadata-hash = ["substrate-wasm-builder/metadata-hash"]
7981
runtime-benchmarks = [
8082
"attestation/runtime-benchmarks",
8183
"ctype/runtime-benchmarks",
@@ -107,6 +109,7 @@ std = [
107109
"did/std",
108110
"frame-benchmarking?/std",
109111
"frame-executive/std",
112+
"frame-metadata-hash-extension/std",
110113
"frame-support/std",
111114
"frame-system-benchmarking?/std",
112115
"frame-system-rpc-runtime-api/std",

runtimes/kestrel/build.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@
1919
use substrate_wasm_builder::WasmBuilder;
2020

2121
fn main() {
22-
WasmBuilder::new()
22+
let builder = WasmBuilder::new()
2323
.with_current_project()
2424
.export_heap_base()
25-
.import_memory()
26-
.build()
25+
.import_memory();
26+
27+
#[cfg(feature = "metadata-hash")]
28+
// TODO: Can we re-use some consts?
29+
let builder = builder.enable_metadata_hash("DILT", 15);
30+
31+
builder.build()
2732
}

runtimes/kestrel/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ pub type SignedExtra = (
797797
frame_system::CheckNonce<Runtime>,
798798
frame_system::CheckWeight<Runtime>,
799799
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
800+
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
800801
);
801802
/// Unchecked extrinsic type as expected by this runtime.
802803
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;

0 commit comments

Comments
 (0)