From 2404da45cf54c5b164e7e62f9a31ea2bc09b099a Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 12 Oct 2024 13:23:10 +0200 Subject: [PATCH] chore: fix to use new DBC method APIs --- Cargo.lock | 12 ++++-------- Cargo.toml | 6 ++++++ psbt/src/csval/dbc.rs | 5 +++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d30973..c9182d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,8 +143,7 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3a99a46063d23d20a3177a04923652b245f31c2a04a6d0c47d5a93dc201a80" +source = "git+https://github.com/BP-WG/bp-core?branch=methods#725a24e3ec1d5e3951cb317eae95c200115295ff" dependencies = [ "amplify", "chrono", @@ -157,8 +156,7 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b8caf04291e2703ce267b1f8baf14f03879a6d1a5afe76e011ada489f172f9" +source = "git+https://github.com/BP-WG/bp-core?branch=methods#725a24e3ec1d5e3951cb317eae95c200115295ff" dependencies = [ "amplify", "bp-consensus", @@ -174,8 +172,7 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc4081db2147411381b9650765ce683e5065559f1125508696f79cc4cbfedf" +source = "git+https://github.com/BP-WG/bp-core?branch=methods#725a24e3ec1d5e3951cb317eae95c200115295ff" dependencies = [ "amplify", "base85", @@ -213,8 +210,7 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d607238c2bf2c34d048d14cd798a6365306e0fb6b02211235f3ccad0bc7fa8f1" +source = "git+https://github.com/BP-WG/bp-core?branch=methods#725a24e3ec1d5e3951cb317eae95c200115295ff" dependencies = [ "amplify", "baid64", diff --git a/Cargo.toml b/Cargo.toml index f38217e..978d01b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/psbt/src/csval/dbc.rs b/psbt/src/csval/dbc.rs index 1d7c4b5..9e13406 100644 --- a/psbt/src/csval/dbc.rs +++ b/psbt/src/csval/dbc.rs @@ -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() { @@ -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() {