Skip to content

Commit

Permalink
add support for metadata hash extention
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyWooo committed Oct 4, 2024
1 parent a27f8bb commit bdeb4da
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 21 deletions.
55 changes: 55 additions & 0 deletions parachain/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "r
sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", default-features = false }
Expand Down
4 changes: 3 additions & 1 deletion parachain/runtime/litentry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }

frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
Expand Down Expand Up @@ -126,7 +127,7 @@ xcm-simulator = { workspace = true }
pallet-message-queue = { workspace = true, features = ["std"] }

[build-dependencies]
substrate-wasm-builder = { workspace = true }
substrate-wasm-builder = { workspace = true, features = ["metadata-hash"] }

[features]
default = ["std"]
Expand Down Expand Up @@ -186,6 +187,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system/std",
"frame-try-runtime?/std",
Expand Down
6 changes: 1 addition & 5 deletions parachain/runtime/litentry/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
use substrate_wasm_builder::WasmBuilder;

fn main() {
WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
WasmBuilder::init_with_defaults().enable_metadata_hash("LIT", 18).build();
}
3 changes: 2 additions & 1 deletion parachain/runtime/litentry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -224,7 +225,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9201,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
state_version: 0,
};

Expand Down
4 changes: 3 additions & 1 deletion parachain/runtime/paseo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }

frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
Expand Down Expand Up @@ -126,7 +127,7 @@ xcm-simulator = { workspace = true }
pallet-message-queue = { workspace = true, features = ["std"] }

[build-dependencies]
substrate-wasm-builder = { workspace = true }
substrate-wasm-builder = { workspace = true, features = ["metadata-hash"] }

[features]
default = ["std"]
Expand Down Expand Up @@ -191,6 +192,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system/std",
"frame-try-runtime?/std",
Expand Down
6 changes: 1 addition & 5 deletions parachain/runtime/paseo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
use substrate_wasm_builder::WasmBuilder;

fn main() {
WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
WasmBuilder::init_with_defaults().enable_metadata_hash("LIT", 18).build();
}
3 changes: 2 additions & 1 deletion parachain/runtime/paseo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -230,7 +231,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9201,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
state_version: 0,
};

Expand Down
4 changes: 3 additions & 1 deletion parachain/runtime/rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }

frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
Expand Down Expand Up @@ -126,7 +127,7 @@ xcm-simulator = { workspace = true }
pallet-message-queue = { workspace = true, features = ["std"] }

[build-dependencies]
substrate-wasm-builder = { workspace = true }
substrate-wasm-builder = { workspace = true, features = ["metadata-hash"] }

[features]
default = ["std"]
Expand Down Expand Up @@ -191,6 +192,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system/std",
"frame-try-runtime?/std",
Expand Down
6 changes: 1 addition & 5 deletions parachain/runtime/rococo/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@
use substrate_wasm_builder::WasmBuilder;

fn main() {
WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build()
WasmBuilder::init_with_defaults().enable_metadata_hash("LIT", 18).build();
}
3 changes: 2 additions & 1 deletion parachain/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -229,7 +230,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_version: 9201,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
transaction_version: 2,
state_version: 0,
};

Expand Down

0 comments on commit bdeb4da

Please sign in to comment.