Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement burn #3437

Merged
merged 24 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions crates/mockcore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub struct TransactionTemplate<'a> {
pub output_values: &'a [u64],
pub outputs: usize,
pub p2tr: bool,
pub receiver: Option<Address>,
}

#[derive(Serialize, Deserialize, Debug)]
Expand Down Expand Up @@ -185,6 +186,7 @@ impl<'a> Default for TransactionTemplate<'a> {
output_values: &[],
outputs: 1,
p2tr: false,
receiver: None,
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion crates/mockcore/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ impl State {
.get(i)
.cloned()
.unwrap_or(value_per_output),
script_pubkey: if template.p2tr {
script_pubkey: if template.receiver.is_some() {
template.receiver.as_ref().unwrap().script_pubkey()
} else if template.p2tr {
let secp = Secp256k1::new();
let keypair = KeyPair::new(&secp, &mut rand::thread_rng());
let internal_key = XOnlyPublicKey::from_keypair(&keypair);
Expand Down
Loading
Loading