Move seed and env_config outside Start command

This commit is contained in:
Daniel Karzel 2021-03-31 16:40:40 +11:00
parent d9d697821e
commit f5e81bb0ee

View File

@ -68,13 +68,13 @@ async fn main() -> Result<()> {
let db = Database::open(config.data.dir.join(db_path).as_path())
.context("Could not open database")?;
match opt.cmd {
Command::Start { max_buy } => {
let seed = Seed::from_file_or_generate(&config.data.dir)
.expect("Could not retrieve/initialize seed");
let seed =
Seed::from_file_or_generate(&config.data.dir).expect("Could not retrieve/initialize seed");
let env_config = env::Testnet::get_config();
match opt.cmd {
Command::Start { max_buy } => {
let bitcoin_wallet = init_bitcoin_wallet(&config, &seed, env_config).await?;
let monero_wallet = init_monero_wallet(&config, env_config).await?;