Skip to content

Commit

Permalink
seals: make TxoSealDef main commitment type
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Dec 23, 2024
1 parent 1b2df05 commit f42b774
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 4 additions & 2 deletions seals/src/txout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ impl StrictDumb for TxoSealExt {
/// informational purposes only. For all other uses please check [`TxoSeal`].
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Display)]
#[display("{primary}/{secondary}")]
#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)]

Check warning on line 236 in seals/src/txout.rs

View check run for this annotation

Codecov / codecov/patch

seals/src/txout.rs#L236

Added line #L236 was not covered by tests
#[strict_type(lib = dbc::LIB_NAME_BPCORE)]
#[derive(CommitEncode)]
#[commit_encode(strategy = strict, id = StrictHash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TxoSealDef {
pub primary: Outpoint,
Expand All @@ -252,8 +256,6 @@ impl<D: dbc::Proof> From<TxoSeal<D>> for TxoSealDef {
#[display("{primary}/{secondary}")]
#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)]

Check warning on line 257 in seals/src/txout.rs

View check run for this annotation

Codecov / codecov/patch

seals/src/txout.rs#L257

Added line #L257 was not covered by tests
#[strict_type(lib = dbc::LIB_NAME_BPCORE)]
#[derive(CommitEncode)]
#[commit_encode(strategy = strict, id = StrictHash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TxoSeal<D: dbc::Proof> {
pub primary: Outpoint,
Expand Down
5 changes: 2 additions & 3 deletions src/bin/bpcore-stl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ use bc::stl::{bp_consensus_stl, bp_tx_stl};
use bp::stl::bp_core_stl;
use commit_verify::stl::commit_verify_stl;
use commit_verify::CommitmentLayout;
use dbc::tapret::TapretProof;
use seals::TxoSeal;
use seals::TxoSealDef;
use strict_encoding::libname;
use strict_types::stl::std_stl;
use strict_types::{parse_args, SystemBuilder};
Expand Down Expand Up @@ -114,7 +113,7 @@ Seals vesper lexicon=types+commitments
"
)
.unwrap();
let layout = TxoSeal::<TapretProof>::commitment_layout();
let layout = TxoSealDef::commitment_layout();

Check warning on line 116 in src/bin/bpcore-stl.rs

View check run for this annotation

Codecov / codecov/patch

src/bin/bpcore-stl.rs#L116

Added line #L116 was not covered by tests
writeln!(file, "{layout}").unwrap();
let tt = sys.type_tree("BPCore.TxoSealTapretProof").unwrap();

Check warning on line 118 in src/bin/bpcore-stl.rs

View check run for this annotation

Codecov / codecov/patch

src/bin/bpcore-stl.rs#L118

Added line #L118 was not covered by tests
writeln!(file, "{tt}").unwrap();
Expand Down
2 changes: 1 addition & 1 deletion stl/Seals.vesper
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Seals vesper lexicon=types+commitments

commitment StrictHash, hasher SHA256, tagged urn:ubideco:strict-types:value-hash#2024-02-10
serialized TxoSealTapretProof
serialized TxoSealDef

rec TxoSealTapretProof
rec primary, Outpoint
Expand Down

0 comments on commit f42b774

Please sign in to comment.