Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,115 changes: 69 additions & 1,046 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ edition = "2024"
multiple_crate_versions = "allow"

[workspace.dependencies]
simplex-provider = { path = "./crates/provider" }
simplex-macros-core = { path = "./crates/macros-core", features = ["bincode", "serde"] }
simplex-template-gen-core = { path = "./crates/template-gen" }
simplex-macros = { path = "./crates/macros" }
simplex-template-gen-core = { path = "./crates/template-gen" }
simplex-test = { path = "./crates/test" }
simplex-regtest = { path = "./crates/regtest" }
simplex-sdk = { path = "./crates/sdk" }
simplex = { path = "./crates/simplex" }

Expand Down
Binary file added assets/electrs
Binary file not shown.
Binary file modified assets/elementsd
Binary file not shown.
7 changes: 2 additions & 5 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ path = "src/bin/main.rs"
workspace = true

[dependencies]
simplex-regtest = { workspace = true }
simplex-test = { workspace = true }
simplex-sdk = { workspace = true }
simplex-macros-core = { workspace = true }
Expand All @@ -33,9 +34,5 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
tracing = { version = "0.1.44" }
tracing-subscriber = { version = "0.3.22", features = ["env-filter"] }
ctrlc = { version = "3.5.2", features = ["termination"] }
glob = { version = "0.3.3"}
globwalk = { version = "0.9.1"}

[dev-dependencies]
tracing = { workspace = true }
tracing-appender = { version = "0.2.3" }
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
9 changes: 9 additions & 0 deletions crates/cli/Simplex.default.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# TEST CONFIG

# [test]
# esplora = "esplora_api_url"

# [test.rpc]
# url = "rpc_url"
# username = "username"
# password = "password"
1 change: 0 additions & 1 deletion crates/cli/Simplex.example.toml

This file was deleted.

4 changes: 0 additions & 4 deletions crates/cli/src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#![warn(clippy::all, clippy::pedantic)]

use clap::Parser;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let _ = dotenvy::dotenv();

simplex_cli::logging::init();

Box::pin(simplex_cli::cli::Cli::parse().run()).await?;

Ok(())
Expand Down
37 changes: 0 additions & 37 deletions crates/cli/src/cache_storage.rs

This file was deleted.

77 changes: 77 additions & 0 deletions crates/cli/src/cli.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
use std::path::PathBuf;

use clap::Parser;

use crate::commands::commands::Command;
use crate::commands::regtest::Regtest;
use crate::commands::test::Test;
use crate::config::{Config, INIT_CONFIG};
use crate::error::CliError;

#[derive(Debug, Parser)]
#[command(name = "Simplex")]
#[command(about = "Simplicity development framework")]
pub struct Cli {
pub config: Option<PathBuf>,

#[command(subcommand)]
pub command: Command,
}

impl Cli {
pub async fn run(&self) -> Result<(), CliError> {
match &self.command {
Command::Init => {
let config_path = Config::get_default_path()?;
std::fs::write(&config_path, INIT_CONFIG)?;

println!("Config written to: '{}'", config_path.display());

Ok(())
}
Command::Config => {
let config_path = Config::get_default_path()?;
let loaded_config = Config::load(config_path)?;

println!("{loaded_config:#?}");

Ok(())
}
Command::Test { command } => {
let config_path = Config::get_default_path()?;
let loaded_config = Config::load(config_path)?;

println!("{loaded_config:#?}");

let test_config = loaded_config.test.unwrap_or_default();

Ok(Test::run(test_config, command)?)
}
Command::Regtest => {
// TODO: pass config
Ok(Regtest::run()?)
}
Command::Build { out_dir: _out_dir } => {
// let loaded_config =
// Config::load_or_discover(self.config.clone()).map_err(|e| Error::ConfigDiscoveryFailure(e))?;

// if loaded_config.build_config.is_none() {
// return Err(Error::Config(
// "No build config to build contracts environment, please add appropriate config".to_string(),
// ));
// }

// let build_config = loaded_config.build_config.unwrap();
// if build_config.compile_simf.is_empty() {
// return Err(Error::Config("No files listed to build contracts environment, please check glob patterns or 'compile_simf' field in config.".to_string()));
// }

// CodeGenerator::generate_files(&build_config.out_dir, &build_config.compile_simf)?;

// println!("{build_config:#?}");

Ok(())
}
}
}
}
82 changes: 0 additions & 82 deletions crates/cli/src/cli/commands.rs

This file was deleted.

Loading
Loading