Skip to content

Commit b6537bf

Browse files
authored
Merge branch 'master' into send_tx_new_peer_subscription
2 parents f4a45e8 + 408c468 commit b6537bf

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ benches/benches-outputs/src/test_gas_costs_output.rs
1616
node_modules/
1717
package-lock.json
1818
package.json
19+
bin/fuel-core/chainspec/local-testnet/state_transition_bytecode.wasm
1920

Binary file not shown.

crates/chain-config/src/config/chain.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl Default for ChainConfig {
5454
fuel_core_types::blockchain::header::LATEST_STATE_TRANSITION_VERSION,
5555
),
5656
// Note: It is invalid bytecode.
57-
state_transition_bytecode: vec![123; 1024],
57+
state_transition_bytecode: vec![],
5858
consensus: ConsensusConfig::default_poa(),
5959
}
6060
}
@@ -78,13 +78,17 @@ impl ChainConfig {
7878
})?;
7979

8080
let bytecode_path = path.with_file_name(BYTECODE_NAME);
81-
let bytecode = std::fs::read(bytecode_path).map_err(|e| {
82-
anyhow::Error::new(e).context(format!(
83-
"an error occurred while loading the state transition bytecode: {:?}",
84-
path.to_str()
85-
))
86-
})?;
8781

82+
let bytecode = if bytecode_path.exists() {
83+
std::fs::read(bytecode_path).map_err(|e| {
84+
anyhow::Error::new(e).context(format!(
85+
"an error occurred while loading the state transition bytecode: {:?}",
86+
path.to_str()
87+
))
88+
})?
89+
} else {
90+
Vec::new()
91+
};
8892
chain_config.state_transition_bytecode = bytecode;
8993

9094
Ok(chain_config)

tests/tests/local_node.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use fuel_core_types::{
1111
blockchain::header::LATEST_STATE_TRANSITION_VERSION,
1212
fuel_tx::GasCosts,
1313
};
14-
use fuel_core_upgradable_executor::WASM_BYTECODE;
1514
use test_helpers::fuel_core_driver::FuelCoreDriver;
1615

1716
#[test]
@@ -29,7 +28,6 @@ fn local_chainconfig_validity() -> anyhow::Result<()> {
2928
.set_gas_costs(benchmark_gas_costs);
3029

3130
if env::var_os("OVERRIDE_CHAIN_CONFIGS").is_some() {
32-
chain_config.state_transition_bytecode = WASM_BYTECODE.to_vec();
3331
chain_config.genesis_state_transition_version =
3432
Some(LATEST_STATE_TRANSITION_VERSION);
3533
std::fs::remove_file(&stored_snapshot.chain_config)?;

0 commit comments

Comments
 (0)