Skip to content

Commit

Permalink
Integrate GlobalConfig to ChainConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita committed Nov 30, 2021
1 parent c49e1fe commit d3b0af2
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion fuel-core/src/args.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::global_config::GlobalConfig;
use crate::chain_config::GlobalConfig;
use crate::service::{Config, DbType};
use std::{env, io, net, path::PathBuf, string::ToString};
use structopt::StructOpt;
Expand Down
10 changes: 10 additions & 0 deletions fuel-core/src/chain_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct ChainConfig {
pub parent_network: BaseChainConfig,
#[serde(default)]
pub initial_state: Option<StateConfig>,
pub global_config: Option<GlobalConfig>,
}

impl ChainConfig {
Expand All @@ -43,6 +44,9 @@ impl ChainConfig {
coins: Some(initial_coins),
..StateConfig::default()
}),
global_config: Some(GlobalConfig {
vm_backtrace: false,
}),
}
}
}
Expand All @@ -64,6 +68,12 @@ impl FromStr for ChainConfig {
}
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
pub struct GlobalConfig {
pub vm_backtrace: bool,
}

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub enum ProductionStrategy {
Instant,
Expand Down
6 changes: 0 additions & 6 deletions fuel-core/src/global_config.rs

This file was deleted.

1 change: 0 additions & 1 deletion fuel-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod chain_config;
pub mod database;
pub mod executor;
pub mod global_config;
pub mod model;
pub mod schema;
pub mod service;
Expand Down
1 change: 0 additions & 1 deletion fuel-core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod args;
pub(crate) mod chain_config;
pub mod database;
pub(crate) mod executor;
pub mod global_config;
pub mod model;
pub mod schema;
pub mod service;
Expand Down
2 changes: 1 addition & 1 deletion fuel-core/src/schema/tx.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::chain_config::GlobalConfig;
use crate::database::{transaction::OwnedTransactionIndexCursor, Database, KvStoreError};
use crate::global_config::GlobalConfig;
use crate::schema::scalars::{HexString, HexString256};
use crate::state::IterDirection;
use crate::tx_pool::TxPool;
Expand Down
3 changes: 1 addition & 2 deletions fuel-core/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::chain_config::{ChainConfig, ContractConfig, StateConfig};
use crate::chain_config::{ChainConfig, ContractConfig, GlobalConfig, StateConfig};
use crate::database::Database;
use crate::global_config::GlobalConfig;
use crate::model::coin::{Coin, CoinStatus, UtxoId};
use crate::tx_pool::TxPool;
use fuel_storage::{MerkleStorage, Storage};
Expand Down

0 comments on commit d3b0af2

Please sign in to comment.