diff --git a/crates/chain-config/Cargo.toml b/crates/chain-config/Cargo.toml index 39a98115eea..cb0bdf17f06 100644 --- a/crates/chain-config/Cargo.toml +++ b/crates/chain-config/Cargo.toml @@ -14,7 +14,7 @@ description = "Fuel Chain config types" anyhow = { workspace = true } bech32 = "0.9.0" fuel-core-storage = { workspace = true } -fuel-core-types = { workspace = true, default-features = false, features = ["random", "serde"] } +fuel-core-types = { workspace = true, default-features = false, features = ["serde"] } hex = { version = "0.4", features = ["serde"] } itertools = { workspace = true } postcard = { version = "1.0", features = ["use-std"] } @@ -29,5 +29,6 @@ insta = { workspace = true } serde_json = { version = "1.0", features = ["raw_value"] } [features] -default = ["std"] +default = ["random", "std"] +random = ["fuel-core-types/random"] std = ["dep:serde_json", "fuel-core-types/std", "anyhow/std"] diff --git a/crates/chain-config/src/config/chain.rs b/crates/chain-config/src/config/chain.rs index 0c432091508..e783e039047 100644 --- a/crates/chain-config/src/config/chain.rs +++ b/crates/chain-config/src/config/chain.rs @@ -81,6 +81,7 @@ impl Default for ChainConfig { impl ChainConfig { pub const BASE_ASSET: AssetId = AssetId::zeroed(); + #[cfg(feature = "random")] pub fn local_testnet() -> Self { // endow some preset accounts with an initial balance tracing::info!("Initial Accounts"); @@ -139,6 +140,7 @@ impl FromStr for ChainConfig { fn from_str(s: &str) -> Result { match s { + #[cfg(feature = "random")] LOCAL_TESTNET => Ok(Self::local_testnet()), s => { // Attempt to load chain config from path