From 7464550c46982e903b69d45fa07cd440b24eca75 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Thu, 10 Oct 2024 12:46:11 +0000 Subject: [PATCH] simplicity: swap program and witness data in satisfaction These are backward, which I noticed when constructing a Simplicity transaction for Liquid Testnet. There isn't an easy way to unit test this but I confirmed that the new order is the correct one on the live network. # # You are committing on CAMUS # # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch 2024-10--taproot-improvements # Changes to be committed: # modified: src/descriptor/tr.rs # --- src/descriptor/tr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/descriptor/tr.rs b/src/descriptor/tr.rs index 69bf3e88..36b49889 100644 --- a/src/descriptor/tr.rs +++ b/src/descriptor/tr.rs @@ -554,7 +554,7 @@ impl<'a, Pk: ToPublicKey, Ext: ParseableExt> TapLeafScript<'a, Pk, Ext> { let satisfier = crate::simplicity::SatisfierWrapper::new(satisfier); let program = sim.satisfy(&satisfier).map_err(|_| Error::CouldNotSatisfy)?; let (program_bytes, witness_bytes) = program.encode_to_vec(); - Ok(vec![program_bytes, witness_bytes]) + Ok(vec![witness_bytes, program_bytes]) } } }