fix: wrap fakechain-port flag usage in feature always

This commit is contained in:
dr-frmr 2024-05-07 17:21:58 -06:00
parent 430d58695a
commit 22e676b9a3
No known key found for this signature in database

View File

@ -99,15 +99,22 @@ async fn main() {
.await
.expect("failed to save new eth provider config!");
}
let local_chain_port = matches
.get_one::<u16>("fakechain-port")
.cloned()
.unwrap_or(8545);
eth_provider_config.push(lib::eth::ProviderConfig {
chain_id: 31337,
trusted: true,
provider: lib::eth::NodeOrRpcUrl::RpcUrl(format!("ws://localhost:{}", local_chain_port)),
});
#[cfg(feature = "simulation-mode")]
{
let local_chain_port = matches
.get_one::<u16>("fakechain-port")
.cloned()
.unwrap_or(8545);
eth_provider_config.push(lib::eth::ProviderConfig {
chain_id: 31337,
trusted: true,
provider: lib::eth::NodeOrRpcUrl::RpcUrl(format!(
"ws://localhost:{}",
local_chain_port
)),
});
}
// kernel receives system messages via this channel, all other modules send messages
let (kernel_message_sender, kernel_message_receiver): (MessageSender, MessageReceiver) =