Skip to content

Commit

Permalink
chore: fix to use new DBC method APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 12, 2024
1 parent 95b8b89 commit 2404da4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@ getrandom = { version = "0.2", features = ["js"] }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3"

[patch.crates-io]
bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "methods" }
bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "methods" }
bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "methods" }
bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "methods" }
5 changes: 5 additions & 0 deletions psbt/src/csval/dbc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ impl Psbt {
}

pub trait DbcPsbtProof: dbc::Proof {
const METHOD: Method;
fn dbc_commit(output: &mut Output) -> Result<(mpc::MerkleBlock, Self), DbcPsbtError>;
}

impl DbcPsbtProof for TapretProof {
const METHOD: Method = Method::TapretFirst;

fn dbc_commit(output: &mut Output) -> Result<(mpc::MerkleBlock, Self), DbcPsbtError> {
let (commitment, mpc_proof) = output.mpc_commit()?;
if !output.is_tapret_host() {
Expand All @@ -101,6 +104,8 @@ impl DbcPsbtProof for TapretProof {
}

impl DbcPsbtProof for OpretProof {
const METHOD: Method = Method::OpretFirst;

fn dbc_commit(output: &mut Output) -> Result<(mpc::MerkleBlock, Self), DbcPsbtError> {
let (commitment, mpc_proof) = output.mpc_commit()?;
if !output.is_opret_host() {
Expand Down

0 comments on commit 2404da4

Please sign in to comment.