From 2d1c76efa5f0a906a67ec184946b7392908ac632 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Thu, 4 Apr 2024 12:35:12 +0200 Subject: [PATCH] dbc: include closing method in anchor --- dbc/src/anchor.rs | 14 ++++++-------- src/stl.rs | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dbc/src/anchor.rs b/dbc/src/anchor.rs index d3b248b7..fd3e2d22 100644 --- a/dbc/src/anchor.rs +++ b/dbc/src/anchor.rs @@ -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}; @@ -74,19 +73,18 @@ pub struct Anchor, M: DbcMethod = M /// Proof of the DBC commitment. pub dbc_proof: D, - #[doc(hidden)] - #[strict_type(skip)] - pub _method: PhantomData, + /// Method used by the anchor + pub method: M, } impl, M: DbcMethod> Anchor { /// 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, } } } @@ -116,7 +114,7 @@ impl, M: DbcMethod> Anchor { Ok(Anchor { mpc_proof: lnpbp4_proof, dbc_proof: self.dbc_proof, - _method: default!(), + method: self.method, }) } @@ -175,7 +173,7 @@ impl, M: DbcMethod> Anchor { Ok(Anchor { mpc_proof: lnpbp4_proof, dbc_proof: self.dbc_proof, - _method: default!(), + method: self.method, }) } diff --git a/src/stl.rs b/src/stl.rs index bebc03bb..562cd5cf 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -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 { LibBuilder::new(libname!(LIB_NAME_BPCORE), tiny_bset! {