Skip to content

Commit

Permalink
refactor: ♻️ switch back to disable-genesis-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmauro committed Jan 24, 2025
1 parent 261029d commit c4b071e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion runtime/common/src/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ macro_rules! impl_runtime_apis_plus_common {
}
}

#[cfg(feature = "genesis-builder")]
#[cfg(not(feature = "disable-genesis-builder"))]
impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
frame_support::genesis_builder_helper::build_state::<RuntimeGenesisConfig>(config)
Expand Down
11 changes: 8 additions & 3 deletions runtime/moonbase/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rlp = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, default-features = false, features = [
"alloc",
], optional = true }
] }
sha3 = { workspace = true, optional = true }
smallvec = { workspace = true }
strum = { workspace = true }
Expand Down Expand Up @@ -303,6 +303,7 @@ std = [
"parity-scale-codec/std",
"precompile-utils/std",
"scale-info/std",
"serde_json/std",
"session-keys-primitives/std",
"sp-api/std",
"sp-block-builder/std",
Expand Down Expand Up @@ -340,11 +341,15 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"]
# A feature that should be enabled when the runtime should be build for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = [
"metadata-hash",
"sp-api/disable-logging",
"disable-genesis-builder",
]

# When enabled, the GenesisBuilder API will be supported, GenesisConfig shall be
# stripped from the final binary
genesis-builder = ["serde_json"]
disable-genesis-builder = []

runtime-benchmarks = [
"cumulus-pallet-parachain-system/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonbase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

pub mod asset_config;
#[cfg(feature = "genesis-builder")]
#[cfg(not(feature = "disable-genesis-builder"))]
pub mod genesis_config_preset;
pub mod governance;
pub mod runtime_params;
Expand Down
11 changes: 8 additions & 3 deletions runtime/moonbeam/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rlp = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, default-features = false, features = [
"alloc",
], optional = true }
] }
sha3 = { workspace = true, optional = true }
smallvec = { workspace = true }
strum = { workspace = true }
Expand Down Expand Up @@ -297,6 +297,7 @@ std = [
"parity-scale-codec/std",
"precompile-utils/std",
"scale-info/std",
"serde_json/std",
"session-keys-primitives/std",
"sp-api/std",
"sp-block-builder/std",
Expand Down Expand Up @@ -329,11 +330,15 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"]
# A feature that should be enabled when the runtime should be build for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = [
"metadata-hash",
"sp-api/disable-logging",
"disable-genesis-builder",
]

# When enabled, the GenesisBuilder API will be supported, GenesisConfig shall be
# stripped from the final binary
genesis-builder = ["serde_json"]
disable-genesis-builder = []

runtime-benchmarks = [
"cumulus-pallet-parachain-system/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub use sp_runtime::BuildStorage;
pub type Precompiles = MoonbeamPrecompiles<Runtime>;

pub mod asset_config;
#[cfg(feature = "genesis-builder")]
#[cfg(not(feature = "disable-genesis-builder"))]
pub mod genesis_config_preset;
pub mod governance;
pub mod runtime_params;
Expand Down
11 changes: 8 additions & 3 deletions runtime/moonriver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rlp = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, default-features = false, features = [
"alloc",
], optional = true }
] }
sha3 = { workspace = true, optional = true }
smallvec = { workspace = true }
strum = { workspace = true }
Expand Down Expand Up @@ -297,6 +297,7 @@ std = [
"parity-scale-codec/std",
"precompile-utils/std",
"scale-info/std",
"serde_json/std",
"session-keys-primitives/std",
"sp-api/std",
"sp-block-builder/std",
Expand Down Expand Up @@ -334,11 +335,15 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"]
# A feature that should be enabled when the runtime should be build for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = [
"metadata-hash",
"sp-api/disable-logging",
"disable-genesis-builder",
]

# When enabled, the GenesisBuilder API will be supported, GenesisConfig shall be
# stripped from the final binary
genesis-builder = ["serde_json"]
disable-genesis-builder = []

runtime-benchmarks = [
"cumulus-pallet-parachain-system/runtime-benchmarks",
Expand Down
2 changes: 1 addition & 1 deletion runtime/moonriver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub use sp_runtime::BuildStorage;
pub type Precompiles = MoonriverPrecompiles<Runtime>;

pub mod asset_config;
#[cfg(feature = "genesis-builder")]
#[cfg(not(feature = "disable-genesis-builder"))]
pub mod genesis_config_preset;
pub mod governance;
pub mod runtime_params;
Expand Down

0 comments on commit c4b071e

Please sign in to comment.