Skip to content

Commit

Permalink
metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
enddynayn committed Jul 18, 2024
1 parent 723e75c commit 6e01ff4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify-pr-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ jobs:
uses: actions/checkout@v4
- name: Build Docs
run: |
rustup component add rust-src
rustup target add wasm32-unknown-unknown --toolchain nightly-2024-03-01
RUSTDOCFLAGS="--enable-index-page --check -Zunstable-options" cargo +nightly-2024-03-01 doc --no-deps --features frequency
rustup component add rust-src
verify-rust-packages-and-deps:
needs: changes
Expand Down
2 changes: 2 additions & 0 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "r
frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.8.0", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.8.0", default-features = false }
frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.8.0", default-features = false }
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.8.0", default-features = false }
sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.8.0", default-features = false }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.8.0", default-features = false }
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.8.0", default-features = false }
Expand Down
5 changes: 3 additions & 2 deletions node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ cli-opt = { default-features = false, path = "../cli-opt" }
frame-benchmarking = { workspace = true }
frame-benchmarking-cli = { workspace = true }
frame-system = { workspace = true }
frame-metadata-hash-extension = { workspace = true, optional = true }
pallet-transaction-payment-rpc = { workspace = true }
sc-basic-authorship = { workspace = true }
sc-chain-spec = { workspace = true }
Expand Down Expand Up @@ -122,8 +123,8 @@ runtime-benchmarks = [
"frequency-runtime/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
]
frequency = ["frequency-runtime"]
frequency-no-relay = ["frequency-runtime"]
frequency = ["frequency-runtime", "frame-metadata-hash-extension"]
frequency-no-relay = ["frequency-runtime", "frame-metadata-hash-extension"]
frequency-local = ["frequency-runtime"]
frequency-testnet = ["frequency-runtime"]
frequency-lint-check = [
Expand Down
1 change: 1 addition & 0 deletions runtime/frequency/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ frame-system = { workspace = true }
frame-system-benchmarking = { workspace = true, optional = true }
frame-system-rpc-runtime-api = { workspace = true }
frame-try-runtime = { workspace = true, optional = true }
frame-metadata-hash-extension = { workspace = true }

pallet-aura = { workspace = true }
pallet-authorship = { workspace = true }
Expand Down
22 changes: 17 additions & 5 deletions runtime/frequency/build.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
#[cfg(all(feature = "std", feature = "metadata-hash"))]
#[docify::export(template_enable_metadata_hash)]
fn main() {
// VSCode Users: Uncomment the following line to disable the ANSI color codes.
// The OUTPUT pane does not understand ANSI color codes and will show garbage without this.
// std::env::set_var("WASM_BUILD_NO_COLOR", "1");
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("UNIT", 12)
.enable_metadata_hash("FRQCY", 8)
.build();

substrate_wasm_builder::WasmBuilder::init_with_defaults()
.set_file_name("fast_runtime_binary.rs")
.enable_feature("fast-runtime")
.enable_metadata_hash("FRQCY", 8)
.build();
}

#[cfg(all(feature = "std", not(feature = "metadata-hash")))]
fn main() {
substrate_wasm_builder::WasmBuilder::build_using_defaults();

substrate_wasm_builder::WasmBuilder::init_with_defaults()
.set_file_name("fast_runtime_binary.rs")
.enable_feature("fast-runtime")
.build();
}

/// The wasm builder is deactivated when compiling
/// this crate for wasm to speed up the compilation.
#[cfg(not(feature = "std"))]
fn main() {}
5 changes: 3 additions & 2 deletions runtime/frequency/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ pub type SignedExtra = (
pallet_frequency_tx_payment::ChargeFrqTransactionPayment<Runtime>,
pallet_msa::CheckFreeExtrinsicUse<Runtime>,
pallet_handles::handles_signed_extension::HandlesSignedExtension<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
);
/// A Block signed with a Justification
pub type SignedBlock = generic::SignedBlock<Block>;
Expand Down Expand Up @@ -357,7 +358,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("frequency"),
impl_name: create_runtime_str!("frequency"),
authoring_version: 1,
spec_version: 97,
spec_version: 98,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand All @@ -371,7 +372,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("frequency-testnet"),
impl_name: create_runtime_str!("frequency"),
authoring_version: 1,
spec_version: 97,
spec_version: 98,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit 6e01ff4

Please sign in to comment.