Skip to content

Commit ab4cea1

Browse files
committed
Merge #111: Update simplicity
d528401 chore: Update rust-simplicity (Christian Lewe) 5752dfc chore: Update flake (Christian Lewe) c175f6f fix: Make integration tests run (Christian Lewe) Pull request description: Update rust-simplicity for pruning support. Update the nix flake. ACKs for top commit: apoelstra: ACK d528401; successfully ran local tests; did not check the flake in any way Tree-SHA512: e4fa6f3d0884ec8d957ba0672a57738fdc4faeb1ad0e02c8bc211fa542666bd592af20b63843b4c1ca9716a763e8da604ee34abda9479250f3f1b3cf5f5137a3
2 parents 14604fb + d528401 commit ab4cea1

File tree

8 files changed

+31
-29
lines changed

8 files changed

+31
-29
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pest = "2.1.3"
2727
pest_derive = "2.7.1"
2828
serde = { version = "1.0.188", features = ["derive"], optional = true }
2929
serde_json = { version = "1.0.105", optional = true }
30-
simplicity-lang = { git = "https://github.com/BlockstreamResearch/rust-simplicity", rev = "fbe88d6f703c2f3b74f52eb3eebf60411606ed42" }
30+
simplicity-lang = { git = "https://github.com/BlockstreamResearch/rust-simplicity", rev = "ca0c0ebee295937ab021ad018acc44a5aaa12649" }
3131
miniscript = "12.2.0"
3232
either = "1.12.0"
3333
itertools = "0.13.0"

bitcoind-tests/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bitcoind-tests/tests/spend_utxo.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,15 @@ fn hodl_vault(sighash_all: [u8; 32]) -> simfony::WitnessValues {
7979
fn p2pk_args() -> simfony::Arguments {
8080
simfony::Arguments::from(HashMap::from([(
8181
WitnessName::from_str_unchecked("ALICE_PUBLIC_KEY"),
82-
Value::byte_array(util::xonly_public_key(0).to_byte_array()),
82+
Value::u256(util::xonly_public_key(1)),
8383
)]))
8484
}
8585

8686
fn p2pk(sighash_all: [u8; 32]) -> simfony::WitnessValues {
87-
let mut witness_values = HashMap::new();
88-
witness_values
89-
.insert(
90-
WitnessName::from_str_unchecked("SIG"),
91-
Value::byte_array(util::sign_schnorr(1, sighash_all)),
92-
)
93-
.unwrap();
94-
simfony::WitnessValues::from(witness_values)
87+
simfony::WitnessValues::from(HashMap::from([(
88+
WitnessName::from_str_unchecked("ALICE_SIGNATURE"),
89+
Value::byte_array(util::sign_schnorr(1, sighash_all)),
90+
)]))
9591
}
9692

9793
fn p2pkh(sighash_all: [u8; 32]) -> simfony::WitnessValues {

flake.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description = "Simfony";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
66
flake-utils.url = "github:numtide/flake-utils";
77
rust-overlay.url = "github:oxalica/rust-overlay";
88
};

justfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ build_fuzz:
4949
build_integration:
5050
cargo test --no-run --manifest-path ./bitcoind-tests/Cargo.toml
5151

52+
# Run integration tests (requires custom elementsd)
53+
check_integration:
54+
cargo test --manifest-path ./bitcoind-tests/Cargo.toml
55+
5256
# Build code for the WASM target
5357
build_wasm:
5458
cargo check --target wasm32-unknown-unknown

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ impl CompiledProgram {
137137
.is_consistent(&self.witness_types)
138138
.map_err(|e| e.to_string())?;
139139
let simplicity_witness = named::to_witness_node(&self.simplicity, witness_values);
140-
let simplicity_redeem = simplicity_witness.finalize().map_err(|e| e.to_string())?;
140+
let simplicity_redeem = simplicity_witness
141+
.finalize_unpruned()
142+
.map_err(|e| e.to_string())?;
141143
Ok(SatisfiedProgram {
142144
simplicity: simplicity_redeem,
143145
debug_symbols: self.debug_symbols.clone(),

0 commit comments

Comments
 (0)