Skip to content

Commit

Permalink
Merge branch 'anchor-method' into v0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Apr 4, 2024
2 parents c014bad + 2d1c76e commit 95f0ad8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions dbc/src/anchor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
//! defined by LNPBP-4.
use std::error::Error;
use std::marker::PhantomData;

use bc::Tx;
use commit_verify::mpc::{self, Message, ProtocolId};
Expand Down Expand Up @@ -74,19 +73,18 @@ pub struct Anchor<L: mpc::Proof + StrictDumb, D: dbc::Proof<M>, M: DbcMethod = M
/// Proof of the DBC commitment.
pub dbc_proof: D,

#[doc(hidden)]
#[strict_type(skip)]
pub _method: PhantomData<M>,
/// Method used by the anchor
pub method: M,
}

impl<L: mpc::Proof + StrictDumb, D: dbc::Proof<M>, M: DbcMethod> Anchor<L, D, M> {
/// Constructs anchor for a given witness transaction id, MPC and DBC
/// proofs.
pub fn new(mpc_proof: L, dbc_proof: D) -> Self {
pub fn new(mpc_proof: L, dbc_proof: D, method: M) -> Self {
Self {
mpc_proof,
dbc_proof,
_method: PhantomData,
method,
}
}
}
Expand Down Expand Up @@ -116,7 +114,7 @@ impl<D: dbc::Proof<M>, M: DbcMethod> Anchor<mpc::MerkleProof, D, M> {
Ok(Anchor {
mpc_proof: lnpbp4_proof,
dbc_proof: self.dbc_proof,
_method: default!(),
method: self.method,
})
}

Expand Down Expand Up @@ -175,7 +173,7 @@ impl<D: dbc::Proof<M>, M: DbcMethod> Anchor<mpc::MerkleBlock, D, M> {
Ok(Anchor {
mpc_proof: lnpbp4_proof,
dbc_proof: self.dbc_proof,
_method: default!(),
method: self.method,
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/stl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use strict_types::{CompileError, LibBuilder, TypeLib};
/// Strict types id for the library providing data types from [`dbc`] and
/// [`seals`] crates.
pub const LIB_ID_BPCORE: &str =
"urn:ubideco:stl:6skrch4mJzDzVaTYnCgCxFJLw23SSUxNhK7PKgPdSapR#roof-parent-reunion";
"urn:ubideco:stl:C5EbVby4rry8esHwoPrGUfhe7yqJgoyA1DBcyuBRf2rZ#granite-target-table";

fn _bp_core_stl() -> Result<TypeLib, CompileError> {
LibBuilder::new(libname!(LIB_NAME_BPCORE), tiny_bset! {
Expand Down

0 comments on commit 95f0ad8

Please sign in to comment.