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
190 changes: 112 additions & 78 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
resolver = "3"
members = [
"crates/*",
"examples/options",
"examples/p2pk",
"examples/test_usage",
"example",
]

[workspace.package]
Expand All @@ -21,6 +19,7 @@ simplex-macros = { path = "./crates/macros" }
simplex-test = { path = "./crates/test" }
simplex-sdk = { path = "./crates/sdk" }
simplex = { path = "./crates/simplex" }
simplex-user = { path = "./crates/user" }

async-trait = { version = "0.1.89" }
bincode = { version = "2.0.1", features = ["serde"] }
Expand Down
4 changes: 0 additions & 4 deletions Simplex.toml

This file was deleted.

3 changes: 2 additions & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ electrsd = { workspace = true }
thiserror = { workspace = true }
serde = { workspace = true }
toml = { workspace = true }

anyhow = "1"
dotenvy = "0.15"
clap = { version = "4", features = ["derive", "env"] }
Expand All @@ -36,4 +37,4 @@ glob = { version = "0.3.3"}
[dev-dependencies]
tracing = { workspace = true }
tracing-appender = { version = "0.2.3" }
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
11 changes: 0 additions & 11 deletions crates/cli/README.md

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion crates/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::io;
use std::path::{Path, PathBuf};
use std::str::FromStr;

pub const DEFAULT_CONFIG: &str = include_str!("../../../Simplex.example.toml");
pub const DEFAULT_CONFIG: &str = include_str!("../Simplex.example.toml");
const CONFIG_FILENAME: &str = "Simplex.toml";

#[derive(thiserror::Error, Debug)]
Expand Down
8 changes: 4 additions & 4 deletions crates/macros-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ serde = ["bincode", "dep:serde"]
default = ["bincode", "serde"]

[dependencies]
simplicityhl = { workspace = true }
simplex-test = { workspace = true }
thiserror = { workspace = true }

proc-macro-error = { version = "1.0" }
proc-macro2 = { version = "1.0.106", features = ["span-locations"] }
syn = { version = "2.0.114", default-features = false, features = ["proc-macro", "full", "parsing", "derive", "clone-impls", "extra-traits", "printing"] }
thiserror = { workspace = true }
quote = { version = "1.0.44" }
simplicityhl = { workspace = true }
simplex-test = { workspace = true }
serde = { version = "1.0.228", optional = true }
pathdiff = { version = "0.2.3" }
prettyplease = { version = "0.2.37" }

8 changes: 4 additions & 4 deletions crates/macros-core/src/attr/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl WitnessStruct {
use ::simplicityhl::str::WitnessName;
use ::simplicityhl::types::TypeConstructible;
use ::simplicityhl::value::ValueConstructible;
use ::simplex::simplex_sdk::arguments::ArgumentsTrait;
use ::simplex::simplex_sdk::program::ArgumentsTrait;
use ::simplex::bincode::*;
},
struct_token_stream: quote! {
Expand All @@ -134,7 +134,7 @@ impl WitnessStruct {

}

impl ::simplex::simplex_sdk::arguments::ArgumentsTrait for #struct_name {
impl ::simplex::simplex_sdk::program::ArgumentsTrait for #struct_name {
/// Build Simplicity arguments for contract instantiation.
#[must_use]
fn build_arguments(&self) -> ::simplicityhl::Arguments {
Expand Down Expand Up @@ -190,7 +190,7 @@ impl WitnessStruct {
use simplicityhl::str::WitnessName;
use simplicityhl::types::TypeConstructible;
use simplicityhl::value::ValueConstructible;
use ::simplex::simplex_sdk::witness::WitnessTrait;
use ::simplex::simplex_sdk::program::WitnessTrait;
},
struct_token_stream: quote! {
#generated_struct
Expand All @@ -209,7 +209,7 @@ impl WitnessStruct {
}
}

impl ::simplex::simplex_sdk::witness::WitnessTrait for #struct_name {
impl ::simplex::simplex_sdk::program::WitnessTrait for #struct_name {
/// Build Simplicity witness values for contract execution.
#[must_use]
fn build_witness(&self) -> ::simplicityhl::WitnessValues {
Expand Down
17 changes: 8 additions & 9 deletions crates/macros-core/src/env/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,27 @@ impl<'b> CodeGenerator {

let code = quote! {
use simplex::simplex_macros::include_simf;
use simplex::simplex_sdk::arguments::ArgumentsTrait;
use simplex::simplex_sdk::program::Program;
use simplex::simplex_sdk::program::{ArgumentsTrait, Program};
use simplicityhl::elements::secp256k1_zkp::XOnlyPublicKey;

pub struct #program_name<'a> {
program: Program<'a>,
pub struct #program_name {
program: Program,
}

impl<'a> #program_name<'a> {
impl #program_name {
pub const SOURCE: &'static str = #include_simf_module::#include_simf_source_const;

pub fn new(public_key: &'a XOnlyPublicKey, arguments: &'a impl ArgumentsTrait) -> Self {
pub fn new(public_key: XOnlyPublicKey, arguments: impl ArgumentsTrait + 'static) -> Self {
Self {
program: Program::new(Self::SOURCE, public_key, arguments),
program: Program::new(Self::SOURCE, public_key, Box::new(arguments)),
}
}

pub fn get_program(&self) -> &Program<'a> {
pub fn get_program(&self) -> &Program {
&self.program
}

pub fn get_program_mut(&mut self) -> &mut Program<'a> {
pub fn get_program_mut(&mut self) -> &mut Program {
&mut self.program
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ workspace = true

[dependencies]
simplex-macros-core = { workspace = true }

serde = { version = "1.0.228", optional = true }
syn = { version = "2.0.114", default-features = false, features = ["parsing", "proc-macro"] }
11 changes: 0 additions & 11 deletions crates/macros/README.md

This file was deleted.

1 change: 1 addition & 0 deletions crates/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ workspace = true
simplicityhl = { workspace = true }
thiserror = { workspace = true }
electrsd = { workspace = true }

async-trait = { version = "0.1.89" }
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
minreq = { version = "2.14", features = ["https", "json-using-serde"] }
Expand Down
7 changes: 0 additions & 7 deletions crates/provider/README.md

This file was deleted.

6 changes: 6 additions & 0 deletions crates/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ thiserror = { workspace = true }
sha2 = { workspace = true }
minreq = { workspace = true }
simplicityhl = { workspace = true }

hex = { version = "0.4" }
serde = { version = "1.0.228", features = ["derive"]}
elements-miniscript = { version = "0.4", features = ["base64", "serde"] }
bip39 = { version = "2.0.0", features = ["rand"] }
dyn-clone = { version = "1.0.20" }
5 changes: 0 additions & 5 deletions crates/sdk/src/arguments.rs

This file was deleted.

4 changes: 4 additions & 0 deletions crates/sdk/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ impl SimplicityNetwork {
}
}

pub fn is_mainnet(&self) -> bool {
self == &Self::Liquid
}

pub const fn address_params(&self) -> &'static elements::AddressParams {
match self {
Self::Liquid => &elements::AddressParams::LIQUID,
Expand Down
66 changes: 0 additions & 66 deletions crates/sdk/src/error.rs

This file was deleted.

7 changes: 1 addition & 6 deletions crates/sdk/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#![warn(clippy::all, clippy::pedantic)]

pub mod arguments;
pub mod constants;

Check warning on line 1 in crates/sdk/src/lib.rs

View workflow job for this annotation

GitHub Actions / Format and Clippy

Diff in /home/runner/work/simplex/simplex/crates/sdk/src/lib.rs
pub mod error;
pub mod presets;
pub mod program;
pub mod transaction;
pub mod provider;
pub mod signer;
pub mod utils;
pub mod witness;
pub mod witness_transaction;
3 changes: 3 additions & 0 deletions crates/sdk/src/presets/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
pub mod p2pk;

pub use p2pk::P2PK;
pub use p2pk::p2pk_build::{P2PKArguments, P2PKWitness};
Loading
Loading