From 32f9a142d2edfaed6846ff5f3f849f716fb73336 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 17 Sep 2024 22:55:01 +0200 Subject: [PATCH 1/8] dbc: remove closing method from anchors; rely on DBC proof instead --- dbc/src/anchor.rs | 22 +++---- src/stl.rs | 2 +- stl/Anchor.MerkleBlock.Tapret.vesper | 1 - stl/Anchor.MerkleProof.Tapret.vesper | 1 - stl/Anchor.MerkleTree.Opret.vesper | 1 - stl/Anchor.MerkleTree.Tapret.vesper | 1 - stl/BPCore@0.1.0.sta | 82 +++++++++++++-------------- stl/BPCore@0.1.0.stl | Bin 3488 -> 3248 bytes stl/BPCore@0.1.0.sty | 38 +++++-------- 9 files changed, 61 insertions(+), 87 deletions(-) diff --git a/dbc/src/anchor.rs b/dbc/src/anchor.rs index bdec4761..ad946701 100644 --- a/dbc/src/anchor.rs +++ b/dbc/src/anchor.rs @@ -25,6 +25,7 @@ //! defined by LNPBP-4. use std::error::Error; +use std::marker::PhantomData; use bc::Tx; use commit_verify::mpc::{self, Message, ProtocolId}; @@ -73,8 +74,9 @@ pub struct Anchor, M: DbcMethod = M /// Proof of the DBC commitment. pub dbc_proof: D, - /// Method used by the anchor - pub method: M, + #[strict_type(skip)] + #[cfg_attr(feature = "serde", serde(skip))] + _method: PhantomData, } impl, M: DbcMethod> Anchor { @@ -84,7 +86,7 @@ impl, M: DbcMethod> Anchor Self { mpc_proof, dbc_proof, - method: D::METHOD, + _method: PhantomData, } } @@ -96,9 +98,7 @@ impl, M: DbcMethod> Anchor /// producing the same commitments. #[inline] pub fn matches(&self, other: &Self) -> bool { - self.mpc_proof.matches(&other.mpc_proof) - && self.dbc_proof == other.dbc_proof - && self.method == other.method + self.mpc_proof.matches(&other.mpc_proof) && self.dbc_proof == other.dbc_proof } } @@ -113,9 +113,6 @@ pub enum MergeError { /// anchors can't be merged since they have different DBC proofs. DbcMismatch, - - /// anchors can't be merged since they use different method. - MethodMismatch, } impl, M: DbcMethod> Anchor { @@ -130,7 +127,7 @@ impl, M: DbcMethod> Anchor { Ok(Anchor { mpc_proof: lnpbp4_proof, dbc_proof: self.dbc_proof, - method: self.method, + _method: PhantomData, }) } @@ -187,7 +184,7 @@ impl, M: DbcMethod> Anchor { Ok(Anchor { mpc_proof: lnpbp4_proof, dbc_proof: self.dbc_proof, - method: self.method, + _method: PhantomData, }) } @@ -201,9 +198,6 @@ impl, M: DbcMethod> Anchor { /// Merges two anchors keeping revealed data. pub fn merge_reveal(mut self, other: Self) -> Result { - if self.method != other.method { - return Err(MergeError::MethodMismatch); - } if self.dbc_proof != other.dbc_proof { return Err(MergeError::DbcMismatch); } diff --git a/src/stl.rs b/src/stl.rs index 4b7a6ca9..10133aae 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 = - "stl:plmyUC!D-McOhrYb-CqRG83D-ffi4IOH-5XLHooj-h1Ef7tA#totem-holiday-helena"; + "stl:VhPW19SH-c5lzr1y-TLIsx8z-Z5nB!$Q-IgwrAQA-OqXLwUg#austin-story-retro"; fn _bp_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_BPCORE), tiny_bset! { diff --git a/stl/Anchor.MerkleBlock.Tapret.vesper b/stl/Anchor.MerkleBlock.Tapret.vesper index ce59b292..9eb0988a 100644 --- a/stl/Anchor.MerkleBlock.Tapret.vesper +++ b/stl/Anchor.MerkleBlock.Tapret.vesper @@ -28,4 +28,3 @@ AnchorMerkleBlockTapretProof rec some union TapretNodePartner option wrapped tag=1 rightBranch rec TapretRightBranch wrapped tag=2 nonce is U8 - method enum Method opretFirst=0 tapretFirst=1 diff --git a/stl/Anchor.MerkleProof.Tapret.vesper b/stl/Anchor.MerkleProof.Tapret.vesper index 47d6fa30..dd18c240 100644 --- a/stl/Anchor.MerkleProof.Tapret.vesper +++ b/stl/Anchor.MerkleProof.Tapret.vesper @@ -9,4 +9,3 @@ AnchorMerkleProofTapretProof rec some union TapretNodePartner option wrapped tag=1 rightBranch rec TapretRightBranch wrapped tag=2 nonce is U8 - method enum Method opretFirst=0 tapretFirst=1 diff --git a/stl/Anchor.MerkleTree.Opret.vesper b/stl/Anchor.MerkleTree.Opret.vesper index fd8890ad..dbcb800b 100644 --- a/stl/Anchor.MerkleTree.Opret.vesper +++ b/stl/Anchor.MerkleTree.Opret.vesper @@ -18,4 +18,3 @@ AnchorMerkleTreeOpretProof rec _ bytes len=32 aka=ProtocolId _ bytes len=32 aka=Message dbcProof is Unit aka=OpretProof - method enum Method opretFirst=0 tapretFirst=1 diff --git a/stl/Anchor.MerkleTree.Tapret.vesper b/stl/Anchor.MerkleTree.Tapret.vesper index e2af6808..e61fb2fe 100644 --- a/stl/Anchor.MerkleTree.Tapret.vesper +++ b/stl/Anchor.MerkleTree.Tapret.vesper @@ -22,4 +22,3 @@ AnchorMerkleTreeTapretProof rec some union TapretNodePartner option wrapped tag=1 rightBranch rec TapretRightBranch wrapped tag=2 nonce is U8 - method enum Method opretFirst=0 tapretFirst=1 diff --git a/stl/BPCore@0.1.0.sta b/stl/BPCore@0.1.0.sta index 9e3617d8..490973c9 100644 --- a/stl/BPCore@0.1.0.sta +++ b/stl/BPCore@0.1.0.sta @@ -1,11 +1,11 @@ -----BEGIN STRICT TYPE LIB----- -Id: stl:plmyUC!D-McOhrYb-CqRG83D-ffi4IOH-5XLHooj-h1Ef7tA#totem-holiday-helena +Id: stl:VhPW19SH-c5lzr1y-TLIsx8z-Z5nB!$Q-IgwrAQA-OqXLwUg#austin-story-retro Name: BPCore Dependencies: CommitVerify#miller-pancake-elastic, Std#ralph-blue-lucky, Bitcoin#signal-color-cipher -Check-SHA256: 199478d5cc4e56653166f7bcb8e805afe732be8e5f3cee3cc0a4aee9db2a00cb +Check-SHA256: ffe8ef061b2a6733287e1874f8781a637640f3c99f05eb07d25c3a0aa5ed269e 20~CnZ*pY=dIK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+dB4&6(-0xu1a@zAbOQBk6JjIwIj2eqliWu}$@z+_xPw?-wb>Rw7=FYk8VVufK10Q-T=FR=Q=>S+XYD&< +oK4xzy{V5hX&1W5Lv;{EcyMfKV`+3#WnpYocxhw?0|sqnbZBp60WP-?CAn^87TS9h9ibhaZ&^Bcn*B*; +w|~I;-PD|t>jZRoX=DQRY!hN5_Bp3Y36tDMM#=e#tGI($UA5U3KNx<*C>jc*fi7rMzqbp}mkbZBp60|E+faB^jIMrm?$bN~xM0`+VY +Vk7oBr%DNv+($;q`HHK!gIHa)*%m(-e#9sm3NgE`=!A)P#jpo4axu-4_As_7EzOC4+`8Vyy2R;!*#QZ1 +X=iA3Ol4ta00jX8^=uPjBlbC`N(qzPM@Gr{imSMTSY5T*7C#t%#3&jHU#!_}M0RemmT>wB!7L}MA7sFvK +#<=RP4S#T1Vv-hhTICs&5e05N37a&BR4P-_D9Y!hN5_Bp3Y36tDMM#=e#tGI($UA5U3KNx<*C>jc> +g@kugo@o29zwXDHA;ech!BqJAy+4@X(~&*rw>NkZRAF#(Wpq+$XJ~Xna$#;`Xa)idY-MJ2PH$voNMUnm +0`+VYVk7oBr%DNv+($;q`HHK!gIHa)*%m(-e#9sm3NgE`=!A)P#jpo4axu-4_As_7EzOC4+`8Vyy2R;! +*$r}OXJ~XzZ)9aiVRL8#^=uPjBlbC`N(qzPM@Gr{imSMTSY5T*7C#t%#3&jHF}tqlgo$^>um>@6G0l?p +Ft#Zz&53{9y57aQ#OZ(81yp!YbaDg&010<#bZ%vHb5wW$00035ba-iG00jX8^=uPjBlbC`N(qzPM@Gr{ +imSMTSY5T*7C#t%#3&jHqk=;7%h%D+p%U7S;b1RT)c9`>#Kd;Rz-U=aO9W+B -----END STRICT TYPE LIB----- diff --git a/stl/BPCore@0.1.0.stl b/stl/BPCore@0.1.0.stl index 228f70142568bef0d5357de43de090e0ebb009c4..b3ed8f823486fb01b09f9e8461d3734dac603879 100644 GIT binary patch delta 146 zcmZ1=y+LwAC^I9|WI>jY$*Y(ZPjZBWswEz(3-q~Rco?5tHR`TRynwcm#h@B86icfss5-YXid&!^O}5{4Q5Ivo7QAs Lc7@GT*}2&O1??;w delta 169 zcmdlWxj=eDC^IATWJ5Ns$qme2lOJ+uOg_ad2N%(rY|Ekm7L8?*g^F6RYE3>56@AYF zQ)|Hr)-5aLn3tT9U*wxwl%10rQk0tNUr>}<5>S+%pT-8VCuH&}X0VBJ(&#Ef5>b_w MfGpm;l#QDW0ATetZvX%Q diff --git a/stl/BPCore@0.1.0.sty b/stl/BPCore@0.1.0.sty index dd6c4712..08188457 100644 --- a/stl/BPCore@0.1.0.sty +++ b/stl/BPCore@0.1.0.sty @@ -1,5 +1,5 @@ {- - Id: stl:plmyUC!D-McOhrYb-CqRG83D-ffi4IOH-5XLHooj-h1Ef7tA#totem-holiday-helena + Id: stl:VhPW19SH-c5lzr1y-TLIsx8z-Z5nB!$Q-IgwrAQA-OqXLwUg#austin-story-retro Name: BPCore Version: 0.1.0 Description: Bitcoin client-side-validation library @@ -34,35 +34,23 @@ import Bitcoin#signal-color-cipher use XOnlyPk#clever-swim-carpet -@mnemonic(evita-escape-jessica) -data AnchorMerkleBlockOpretProof : mpcProof CommitVerify.MerkleBlock - , dbcProof OpretProof - , method Method +@mnemonic(bread-poncho-pattern) +data AnchorMerkleBlockOpretProof : mpcProof CommitVerify.MerkleBlock, dbcProof OpretProof -@mnemonic(bicycle-scroll-dynasty) -data AnchorMerkleBlockTapretProof : mpcProof CommitVerify.MerkleBlock - , dbcProof TapretProof - , method Method +@mnemonic(madrid-vampire-little) +data AnchorMerkleBlockTapretProof : mpcProof CommitVerify.MerkleBlock, dbcProof TapretProof -@mnemonic(wonder-club-good) -data AnchorMerkleProofOpretProof : mpcProof CommitVerify.MerkleProof - , dbcProof OpretProof - , method Method +@mnemonic(almond-gilbert-urban) +data AnchorMerkleProofOpretProof : mpcProof CommitVerify.MerkleProof, dbcProof OpretProof -@mnemonic(select-infant-precise) -data AnchorMerkleProofTapretProof : mpcProof CommitVerify.MerkleProof - , dbcProof TapretProof - , method Method +@mnemonic(llama-colony-juice) +data AnchorMerkleProofTapretProof : mpcProof CommitVerify.MerkleProof, dbcProof TapretProof -@mnemonic(educate-halt-nobody) -data AnchorMerkleTreeOpretProof : mpcProof CommitVerify.MerkleTree - , dbcProof OpretProof - , method Method +@mnemonic(season-perform-tropic) +data AnchorMerkleTreeOpretProof : mpcProof CommitVerify.MerkleTree, dbcProof OpretProof -@mnemonic(castro-visitor-grid) -data AnchorMerkleTreeTapretProof : mpcProof CommitVerify.MerkleTree - , dbcProof TapretProof - , method Method +@mnemonic(europe-mister-imitate) +data AnchorMerkleTreeTapretProof : mpcProof CommitVerify.MerkleTree, dbcProof TapretProof @mnemonic(report-process-stuart) data BlindSealTxPtr : method Method From ec9b6120513c6e3ef05fd841c58edfd10b62a196 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 12 Oct 2024 13:07:34 +0200 Subject: [PATCH 2/8] dbc: convert method information for DBC proofs from const to fn --- dbc/src/opret/mod.rs | 3 ++- dbc/src/proof.rs | 4 ++-- dbc/src/tapret/mod.rs | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dbc/src/opret/mod.rs b/dbc/src/opret/mod.rs index 610d323b..fff30f69 100644 --- a/dbc/src/opret/mod.rs +++ b/dbc/src/opret/mod.rs @@ -72,7 +72,8 @@ impl StrictDeserialize for OpretProof {} impl Proof for OpretProof { type Error = EmbedVerifyError; - const METHOD: Method = Method::OpretFirst; + + fn method(&self) -> Method { Method::OpretFirst } fn verify(&self, msg: &Commitment, tx: &Tx) -> Result<(), EmbedVerifyError> { tx.verify(msg, self) diff --git a/dbc/src/proof.rs b/dbc/src/proof.rs index 8ffeae92..8cc512a1 100644 --- a/dbc/src/proof.rs +++ b/dbc/src/proof.rs @@ -91,8 +91,8 @@ pub trait Proof: /// Verification error. type Error: Error; - /// Returns DBC method used by the proof. - const METHOD: M; + /// Returns a single-use seal closing method used by the DBC proof. + fn method(&self) -> M; /// Verifies DBC proof against the provided transaction. fn verify(&self, msg: &mpc::Commitment, tx: &Tx) -> Result<(), Self::Error>; diff --git a/dbc/src/tapret/mod.rs b/dbc/src/tapret/mod.rs index f88a7256..a45a1aac 100644 --- a/dbc/src/tapret/mod.rs +++ b/dbc/src/tapret/mod.rs @@ -377,7 +377,8 @@ impl TapretProof { impl Proof for TapretProof { type Error = ConvolveVerifyError; - const METHOD: Method = Method::TapretFirst; + + fn method(&self) -> Method { Method::TapretFirst } fn verify(&self, msg: &Commitment, tx: &Tx) -> Result<(), ConvolveVerifyError> { ConvolveCommitProof::<_, Tx, _>::verify(self, msg, tx) From 9d8bd113bb12dc1caa2d87b3643195f71fc1e0ff Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 12 Oct 2024 18:31:04 +0200 Subject: [PATCH 3/8] seals: add derives for Witness --- seals/src/txout/witness.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/seals/src/txout/witness.rs b/seals/src/txout/witness.rs index 75f77a1e..d2fef193 100644 --- a/seals/src/txout/witness.rs +++ b/seals/src/txout/witness.rs @@ -31,6 +31,7 @@ use crate::SealCloseMethod; /// Witness of a bitcoin-based seal being closed. Includes both transaction and /// extra-transaction data. +#[derive(Clone, Eq, PartialEq, Hash, Debug)] pub struct Witness, M: DbcMethod = Method> { /// Witness transaction: transaction which contains commitment to the /// message over which the seal is closed. From 28a9f8f401538ec76c5c72e8e903d59975092f6d Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 13 Oct 2024 11:06:47 +0200 Subject: [PATCH 4/8] chore: fix fmt with new style_edition fmt keeps changing all the time. Now they introduced new "editions" feature, which by default does a lot of changes to the codebase by mingling with alphabetical sorting of all imports, doing them in case-insentive way. This PR allows to avoid that dramatic changes --- .rustfmt.toml | 2 +- consensus/src/timelocks.rs | 24 ++++++++++++++++++++---- consensus/src/tx.rs | 6 +++++- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.rustfmt.toml b/.rustfmt.toml index 98e9b851..57040085 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,5 +1,5 @@ edition = "2021" -version = "Two" +style_edition = "2021" max_width = 100 array_width = 100 diff --git a/consensus/src/timelocks.rs b/consensus/src/timelocks.rs index 52902500..946dd512 100644 --- a/consensus/src/timelocks.rs +++ b/consensus/src/timelocks.rs @@ -108,7 +108,11 @@ impl LockTime { /// `None` is returned. #[inline] pub const fn from_height(height: u32) -> Option { - if height < LOCKTIME_THRESHOLD { Some(Self(height)) } else { None } + if height < LOCKTIME_THRESHOLD { + Some(Self(height)) + } else { + None + } } /// Creates absolute time lock with the given UNIX timestamp value. @@ -117,7 +121,11 @@ impl LockTime { /// `None` is returned. #[inline] pub const fn from_unix_timestamp(timestamp: u32) -> Option { - if timestamp < LOCKTIME_THRESHOLD { None } else { Some(Self(timestamp)) } + if timestamp < LOCKTIME_THRESHOLD { + None + } else { + Some(Self(timestamp)) + } } /// Converts into full u32 representation of `nLockTime` value as it is @@ -196,7 +204,11 @@ impl LockTimestamp { /// `None` is returned. #[inline] pub fn from_unix_timestamp(timestamp: u32) -> Option { - if timestamp < LOCKTIME_THRESHOLD { None } else { Some(Self(timestamp)) } + if timestamp < LOCKTIME_THRESHOLD { + None + } else { + Some(Self(timestamp)) + } } #[inline] @@ -300,7 +312,11 @@ impl LockHeight { /// `None` is returned. #[inline] pub fn from_height(height: u32) -> Option { - if height < LOCKTIME_THRESHOLD { Some(Self(height)) } else { None } + if height < LOCKTIME_THRESHOLD { + Some(Self(height)) + } else { + None + } } #[inline] diff --git a/consensus/src/tx.rs b/consensus/src/tx.rs index 9218a284..56dc0a0d 100644 --- a/consensus/src/tx.rs +++ b/consensus/src/tx.rs @@ -401,7 +401,11 @@ impl TxVer { pub const fn try_from_standard(ver: i32) -> Result> { let ver = TxVer::from_consensus_i32(ver); - if !ver.is_standard() { Err(NonStandardValue::with(ver.0, "TxVer")) } else { Ok(ver) } + if !ver.is_standard() { + Err(NonStandardValue::with(ver.0, "TxVer")) + } else { + Ok(ver) + } } #[inline] From 726f77376040a17da9365ff650ef0aee3d6a0a6f Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 13 Oct 2024 11:34:45 +0200 Subject: [PATCH 5/8] chore: update dependencies --- Cargo.lock | 179 ++++++++++++++++++++++++++++--------------------- Cargo.toml | 18 +++-- dbc/Cargo.toml | 4 +- 3 files changed, 117 insertions(+), 84 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f088271..6e1e7df1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,6 +77,12 @@ dependencies = [ "libc", ] +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "ascii" version = "1.1.0" @@ -101,9 +107,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "baid64" @@ -132,6 +138,22 @@ dependencies = [ "thiserror", ] +[[package]] +name = "bitcoin-io" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "340e09e8399c7bd8912f495af6aa58bea0c9214773417ffaa8f6460f93aaee56" + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative", +] + [[package]] name = "bitflags" version = "2.6.0" @@ -149,7 +171,7 @@ dependencies = [ [[package]] name = "bp-consensus" -version = "0.11.0-beta.8" +version = "0.11.0-beta.9" dependencies = [ "amplify", "chrono", @@ -162,7 +184,7 @@ dependencies = [ [[package]] name = "bp-core" -version = "0.11.0-beta.8" +version = "0.11.0-beta.9" dependencies = [ "amplify", "bp-consensus", @@ -181,7 +203,7 @@ dependencies = [ [[package]] name = "bp-dbc" -version = "0.11.0-beta.8" +version = "0.11.0-beta.9" dependencies = [ "amplify", "base85", @@ -194,7 +216,7 @@ dependencies = [ [[package]] name = "bp-seals" -version = "0.11.0-beta.8" +version = "0.11.0-beta.9" dependencies = [ "amplify", "baid64", @@ -221,9 +243,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.13" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "shlex", ] @@ -250,9 +272,8 @@ dependencies = [ [[package]] name = "commit_encoding_derive" -version = "0.11.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca41bd14a6c400486463a5b0e7e8916b1c7bad554a382f62c3b11bd58dea5934" +version = "0.11.0-beta.9" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" dependencies = [ "amplify", "amplify_syn", @@ -263,9 +284,8 @@ dependencies = [ [[package]] name = "commit_verify" -version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a1982dc6c54d2dcfa2bf4398d97e4e80a93f24d2537e58d6110b2b272cff0c" +version = "0.11.0-beta.9" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" dependencies = [ "amplify", "commit_encoding_derive", @@ -296,9 +316,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -370,9 +390,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -380,11 +400,20 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -405,9 +434,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", "hashbrown", @@ -415,18 +444,18 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.156" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "log" @@ -461,9 +490,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "paste" @@ -482,18 +511,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -554,10 +583,11 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "secp256k1" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" dependencies = [ + "bitcoin_hashes", "rand", "secp256k1-sys", "serde", @@ -565,31 +595,31 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1433bd67156263443f14d603720b082dd3121779323fce20cba2aa07b874bc1b" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" dependencies = [ "cc", ] [[package]] name = "serde" -version = "1.0.208" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.79", ] [[package]] @@ -621,9 +651,8 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "single_use_seals" -version = "0.11.0-beta.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a4c51f21507cf63984c367507f281215073e85b08711ed7da4fc63dbd709e0" +version = "0.11.0-beta.9" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" dependencies = [ "amplify_derive", ] @@ -693,9 +722,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.74" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -704,22 +733,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.79", ] [[package]] @@ -730,9 +759,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "version_check" @@ -768,9 +797,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -779,24 +808,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -806,9 +835,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -816,28 +845,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-bindgen-test" -version = "0.3.43" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68497a05fb21143a08a7d24fc81763384a3072ee43c44e86aad1744d6adef9d9" +checksum = "d381749acb0943d357dcbd8f0b100640679883fcdeeef04def49daf8d33a5426" dependencies = [ "console_error_panic_hook", "js-sys", @@ -850,20 +879,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.43" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8220be1fa9e4c889b30fd207d4906657e7e90b12e0e6b0c8b8d8709f5de021" +checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.79", ] [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -978,5 +1007,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.79", ] diff --git a/Cargo.toml b/Cargo.toml index bd496009..a46300ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ default-members = [ ] [workspace.package] -version = "0.11.0-beta.8" +version = "0.11.0-beta.9" authors = ["Dr Maxim Orlovsky "] homepage = "https://github.com/BP-WG" repository = "https://github.com/BP-WG/bp-core" @@ -25,12 +25,12 @@ license = "Apache-2.0" amplify = "4.7.0" strict_encoding = "2.7.0" strict_types = "2.7.0" -commit_verify = "0.11.0-beta.8" -single_use_seals = "0.11.0-beta.8" -bp-consensus = { version = "0.11.0-beta.8", path = "consensus" } -bp-dbc = { version = "0.11.0-beta.8", path = "./dbc" } -bp-seals = { version = "0.11.0-beta.8", path = "./seals" } -secp256k1 = { version = "0.29.0", features = ["global-context", "rand-std"] } +commit_verify = "0.11.0-beta.9" +single_use_seals = "0.11.0-beta.9" +bp-consensus = { version = "0.11.0-beta.9", path = "./consensus" } +bp-dbc = { version = "0.11.0-beta.9", path = "./dbc" } +bp-seals = { version = "0.11.0-beta.9", path = "./seals" } +secp256k1 = { version = "0.30.0", features = ["global-context", "rand"] } serde_crate = { package = "serde", version = "1", features = ["derive"] } [package] @@ -89,3 +89,7 @@ wasm-bindgen-test = "0.3" [package.metadata.docs.rs] features = ["all"] + +[patch.crates-io] +commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } +single_use_seals = { git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } diff --git a/dbc/Cargo.toml b/dbc/Cargo.toml index 92efccf9..dde423ae 100644 --- a/dbc/Cargo.toml +++ b/dbc/Cargo.toml @@ -22,7 +22,7 @@ base85 = "=2.0.0" strict_encoding = { workspace = true } commit_verify = { workspace = true, features = ["rand"] } bp-consensus = { workspace = true } -secp256k1 = { workspace = true, features = ["global-context", "rand-std"] } +secp256k1 = { workspace = true } serde_crate = { workspace = true, optional = true } [features] @@ -36,4 +36,4 @@ serde = [ ] [package.metadata.docs.rs] -features = [ "all" ] +features = ["all"] From bc1b9eb4494d0e2e83e10017c7569d73fd47fc13 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 13 Oct 2024 11:36:01 +0200 Subject: [PATCH 6/8] chore: bump MSRV due to rustfix dependency --- .github/workflows/build.yml | 2 +- Cargo.toml | 2 +- MANIFEST.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff373f9d..65947ef1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: strategy: fail-fast: false matrix: - toolchain: [ nightly, beta, stable, 1.76.0 ] + toolchain: [ nightly, beta, stable, 1.77.0 ] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master diff --git a/Cargo.toml b/Cargo.toml index a46300ad..1eaff28d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ version = "0.11.0-beta.9" authors = ["Dr Maxim Orlovsky "] homepage = "https://github.com/BP-WG" repository = "https://github.com/BP-WG/bp-core" -rust-version = "1.76.0" # Due to ascii-armor +rust-version = "1.77.0" # Due to `rustfix` edition = "2021" license = "Apache-2.0" diff --git a/MANIFEST.yml b/MANIFEST.yml index 927451f8..18c70674 100644 --- a/MANIFEST.yml +++ b/MANIFEST.yml @@ -3,7 +3,7 @@ Type: Library Kind: Free software License: Apache-2.0 Language: Rust -Compiler: 1.76 +Compiler: 1.77 Author: Maxim Orlovsky Maintained: LNP/BP Standards Association, Switzerland Maintainers: From 0f591b4bcbd16d4bab3c9fe7134b9eaf8d397023 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 13 Oct 2024 18:10:49 +0200 Subject: [PATCH 7/8] ci: add typo lint job Closes #67 --- .github/workflows/lint.yml | 5 +++++ _typos.toml | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 _typos.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fb630fb0..ab5249d1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -38,3 +38,8 @@ jobs: components: rust-docs - name: Formatting run: cargo +nightly doc --workspace --all-features + typos: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@master diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..0c6e78b7 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,13 @@ +[files] +# exclude the directory "stl/" +extend-exclude = ["stl/"] + +[default.extend-words] +# Don't correct the name "Jon Atack". +Atack = "Atack" + +[default] +extend-ignore-re = [ + # Don't correct URIs + "([a-z]+:)*[$!0-9A-Za-z-]+", +] From 9bdb1505340b3c724d18a83ab1d95d847052f68b Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Thu, 31 Oct 2024 13:39:18 +0100 Subject: [PATCH 8/8] chore: update dependencies --- Cargo.lock | 63 ++++++++++++++++++++++++++++-------------------------- Cargo.toml | 6 +----- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e1e7df1..55f8a999 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -243,9 +243,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] @@ -272,8 +272,9 @@ dependencies = [ [[package]] name = "commit_encoding_derive" -version = "0.11.0-beta.9" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" +version = "0.11.0-beta.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea07c5ad73a637276dc4f8a957f8285764018d45bdefef35eb9137f32d0e3c81" dependencies = [ "amplify", "amplify_syn", @@ -285,7 +286,8 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.9" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf08c4941e147937551f6a3d370552d67f98cf72c9eb18948142596beadd31e" dependencies = [ "amplify", "commit_encoding_derive", @@ -453,9 +455,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "log" @@ -465,9 +467,9 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "minicov" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169" +checksum = "def6d99771d7c499c26ad4d40eb6645eafd3a1553b35fc26ea5a489a45e82d9a" dependencies = [ "cc", "walkdir", @@ -511,9 +513,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -604,22 +606,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -652,7 +654,8 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "single_use_seals" version = "0.11.0-beta.9" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#4015f1fb9e99fdc536c69b957fa5727da9cfa6a9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec071f3b3153217f1cb2bca5ba7ac87eeafc446cb35a5c0643dec33495a37244" dependencies = [ "amplify_derive", ] @@ -684,9 +687,9 @@ dependencies = [ [[package]] name = "strict_types" -version = "2.7.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f16e8855a575633815f01482ac927ebaca3d2485aec8e17226c6826de29154e" +checksum = "8bae7475fc901144d8a35d25e36d76aa020b840f233d60532d6d52318718781b" dependencies = [ "amplify", "ascii-armor", @@ -722,9 +725,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -733,22 +736,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -817,7 +820,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -851,7 +854,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -885,7 +888,7 @@ checksum = "c97b2ef2c8d627381e51c071c2ab328eac606d3f69dd82bcbca20a9e389d95f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1007,5 +1010,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] diff --git a/Cargo.toml b/Cargo.toml index 1eaff28d..9644590d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ license = "Apache-2.0" [workspace.dependencies] amplify = "4.7.0" strict_encoding = "2.7.0" -strict_types = "2.7.0" +strict_types = "2.7.2" commit_verify = "0.11.0-beta.9" single_use_seals = "0.11.0-beta.9" bp-consensus = { version = "0.11.0-beta.9", path = "./consensus" } @@ -89,7 +89,3 @@ wasm-bindgen-test = "0.3" [package.metadata.docs.rs] features = ["all"] - -[patch.crates-io] -commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } -single_use_seals = { git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" }