Skip to content
Merged

Dev #76

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
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# Changelog

## [Unreleased]
## [0.0.5]

### Simplex

- Added some documentation to the public simplex functions.
- Implemented "global configuration" singleton in the SDK.
- Added `TxReceipt` object that gets returned upon transaction broadcasting for blocks confirmation convenience.
- Fixed `FinalTransaction` issuance inputs that didn't work correctly with inflation tokens.
- Renamed `with_pub_key` program method to `with_taproot_pubkey`.
- Added `asset` and `amount` methods to the `UTXO` struct.
- Refactored `simplex test` command:
- Added compatibility for custom test name filters.
- Added `--target` flag that isolates tests to a specific integration test module.
- Added `--no-fail-fast` flag to allow tests to keep running even if one fails.
- Added `--quiet` flag to suppress some simplex logging.
- Refactored `simplex new` command to set up a new project by accepting a directory name.
- Added `NetworkUtils` to `TestContext` for some "network cheatcodes":
- The `mine_until_height` function is provided.
- Added a `-v` flag to `simplex test` that logs simplicity pruning traces.
- Fixed `rustfmt` warning on generated artifacts. Now they are skipped.
- Added fixtures for simplex integration tests.

### Simplexup

- Added ability to fetch specific simplex commits.

## [0.0.4]

- Sped up regtest setup 3x times by mining a block after tokens sweep.
Expand Down
51 changes: 12 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 17 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
[workspace]
resolver = "3"
members = [
"crates/*",
]
members = ["crates/*"]
exclude = ["examples/basic", "fixtures"]

[workspace.package]
license = "MIT"
edition = "2024"

[workspace.lints.clippy]
multiple_crate_versions = "allow"

[workspace.dependencies]
smplx-macros = { path = "./crates/macros", version = "0.0.4" }
smplx-build = { path = "./crates/build", version = "0.0.4" }
smplx-test = { path = "./crates/test", version = "0.0.4" }
smplx-regtest = { path = "./crates/regtest", version = "0.0.4" }
smplx-sdk = { path = "./crates/sdk", version = "0.0.4" }
smplx-std = { path = "./crates/simplex", version = "0.0.4" }
smplx-macros = { path = "./crates/macros", version = "0.0.5" }
smplx-build = { path = "./crates/build", version = "0.0.5" }
smplx-test = { path = "./crates/test", version = "0.0.5" }
smplx-regtest = { path = "./crates/regtest", version = "0.0.5" }
smplx-sdk = { path = "./crates/sdk", version = "0.0.5" }
smplx-std = { path = "./crates/simplex", version = "0.0.5" }

serde = { version = "1.0.228", features = ["derive"]}
serde = { version = "1.0.228", features = ["derive"] }
hex = { version = "0.4.3" }
hmac = { version = "0.12.1" }
sha2 = { version = "0.10.9", features = ["compress"] }
thiserror = { version = "2.0.18" }
toml = { version = "0.9.8" }
minreq = { version = "2.14.1", features = ["https", "json-using-serde"] }

electrsd = { version = "0.29.0", features = ["legacy"] }
simplicityhl = { version = "0.5.0" }

simplicityhl = { version = "0.5.0-rc.0" }
[workspace.lints.rust]
rust_2018_idioms = "warn"
unused_lifetimes = "warn"
unreachable_pub = "warn"
deprecated_in_future = "warn"

[patch.crates-io]
simplicity-sys = { git = "https://github.com/BlockstreamResearch/rust-simplicity", tag = "simplicity-sys-0.6.1" }
[workspace.lints.clippy]
multiple_crate_versions = "allow"
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
![](https://github.com/user-attachments/assets/c4661df7-6101-4c46-9376-dedaeef8056b)

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Tests](https://github.com/BlockstreamResearch/smplx/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/BlockstreamResearch/smplx/workflows/ci.yml)
[![Tests](https://github.com/BlockstreamResearch/smplx/actions/workflows/crates.yml/badge.svg?branch=master)](https://github.com/BlockstreamResearch/smplx/workflows/crates.yml)
[![Integration](https://github.com/BlockstreamResearch/smplx/actions/workflows/fixtures.yml/badge.svg?branch=master)](https://github.com/BlockstreamResearch/smplx/workflows/fixtures.yml)
[![Community](https://img.shields.io/endpoint?color=neon&logo=telegram&label=Chat&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fsimplicity_community)](https://t.me/simplicity_community)

# Smplx
Expand Down Expand Up @@ -40,7 +41,7 @@ cargo add --dev smplx-std
Optionally, initialize a new project:

```bash
simplex init
simplex init <name>
```

## Usage
Expand All @@ -66,6 +67,7 @@ rpc_password = "password"
[test]
mnemonic = "exist carry drive collect lend cereal occur much tiger just involve mean"
bitcoins = 10_000_000
verbosity = 3 # 1 - none, 2 - warning, 3 - debug, 4 - trace

[test.esplora]
url = "<esplora url>"
Expand Down Expand Up @@ -93,6 +95,7 @@ Where:
- `test` (`simplex test` config)
- `mnemonic` - The signer's mnemonic internal regtest will send initial funds to.
- `bitcoins` - Initial coins available to the signer.
- `verbosity` - Simplicity pruning log level.
- `esplora`
- `url` - Esplora API endpoint url.
- `network` - Esplora network type (`Liquid`, `LiquidTestnet`, `ElementsRegtest`).
Expand Down
2 changes: 1 addition & 1 deletion crates/build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smplx-build"
version = "0.0.4"
version = "0.0.5"
description = "Simplex build command internal implementation"
license.workspace = true
edition.workspace = true
Expand Down
18 changes: 15 additions & 3 deletions crates/build/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,44 +175,53 @@ impl ArtifactsGenerator {
impl #program_name {
pub const SOURCE: &'static str = #include_simf_module::#include_simf_source_const;

#[must_use]
pub fn new(arguments: impl ArgumentsTrait + 'static) -> Self {
Self {
program: Program::new(Self::SOURCE, Box::new(arguments)),
}
}

pub fn with_pub_key(mut self, pub_key: XOnlyPublicKey) -> Self {
self.program = self.program.with_pub_key(pub_key);
#[must_use]
pub fn with_taproot_pubkey(mut self, pub_key: XOnlyPublicKey) -> Self {
self.program = self.program.with_taproot_pubkey(pub_key);

self
}

#[must_use]
pub fn with_storage_capacity(mut self, capacity: usize) -> Self {
self.program = self.program.with_storage_capacity(capacity);

self
}

#[must_use]
pub fn set_storage_at(&mut self, index: usize, new_value: [u8; 32]) {
self.program.set_storage_at(index, new_value);
}

#[must_use]
pub fn get_storage_len(&self) -> usize {
self.program.get_storage_len()
}

#[must_use]
pub fn get_storage(&self) -> &[[u8; 32]] {
self.program.get_storage()
}

#[must_use]
pub fn get_storage_at(&self, index: usize) -> [u8; 32] {
self.program.get_storage_at(index)
}

#[must_use]
pub fn get_script_pubkey(&self, network: &SimplicityNetwork) -> Script {
self.program.get_script_pubkey(network)
}

#[must_use]
pub fn get_script_hash(&self, network: &SimplicityNetwork) -> [u8; 32] {
self.program.get_script_hash(network)
}
Expand Down Expand Up @@ -242,7 +251,10 @@ impl ArtifactsGenerator {
let code = quote! {
#![allow(clippy::all)]

#(pub mod #mod_names);*;
#(
#[rustfmt::skip]
pub mod #mod_names;
)*
};

Ok(code)
Expand Down
2 changes: 1 addition & 1 deletion crates/build/src/macros/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct SynFilePath {
}

impl Parse for SynFilePath {
fn parse(input: ParseStream) -> syn::Result<Self> {
fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
let expr = input.parse::<Expr>()?;

let span_file = expr.span().file();
Expand Down
3 changes: 1 addition & 2 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smplx-cli"
version = "0.0.4"
version = "0.0.5"
description = "Simplex cli with various utilities to manage a simplicity project"
license.workspace = true
edition.workspace = true
Expand Down Expand Up @@ -28,7 +28,6 @@ minreq = { workspace = true }
anyhow = "1"
dotenvy = "0.15"
clap = { version = "4", features = ["derive", "env"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
toml_edit = { version = "0.23.9" }
ctrlc = { version = "3.5.2", features = ["termination"] }
serde_json = { version = "1.0.149" }
1 change: 1 addition & 0 deletions crates/cli/assets/Simplex.default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# [test]
# mnemonic = "exist carry drive collect lend cereal occur much tiger just involve mean"
# bitcoins = 10_000_000
# verbosity = 3

# [test.esplora]
# url = "<esplora url>"
Expand Down
5 changes: 2 additions & 3 deletions crates/cli/src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use clap::Parser;

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

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

Ok(())
}
Loading