From 2d3a0a2981409c493067edfc94338088884b1aa7 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 29 Dec 2023 13:44:20 +0100 Subject: [PATCH 1/3] commit: support encoding for PhantomData types --- commit_verify/src/encode.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/commit_verify/src/encode.rs b/commit_verify/src/encode.rs index f55bd17f..5c592d02 100644 --- a/commit_verify/src/encode.rs +++ b/commit_verify/src/encode.rs @@ -63,6 +63,7 @@ //! [LNPBP-9]: https://github.com/LNP-BP/LNPBPs/blob/master/lnpbp-0009.md use std::io; +use std::marker::PhantomData; use crate::id::CommitmentId; use crate::Conceal; @@ -336,3 +337,8 @@ pub mod strategies { impl CommitEncode for [u8; 32] { fn commit_encode(&self, e: &mut impl io::Write) { e.write_all(self).ok(); } } + +impl CommitEncode for PhantomData { + fn commit_encode(&self, _: &mut impl io::Write) { /* nothing to do */ + } +} From 6dba80058e132ed2ac5f85af305d3bbf93fc7f24 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 30 Dec 2023 08:04:12 +0100 Subject: [PATCH 2/3] chore: fix clippy lints --- commit_verify/src/mpc/block.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit_verify/src/mpc/block.rs b/commit_verify/src/mpc/block.rs index b6ab158c..7490454c 100644 --- a/commit_verify/src/mpc/block.rs +++ b/commit_verify/src/mpc/block.rs @@ -666,7 +666,7 @@ mod test { let (pid, msg) = msgs.first_key_value().unwrap(); let leaf = Leaf::inhabited(*pid, *msg); - let cid1 = block.cross_section.get(0).unwrap().to_merkle_node(); + let cid1 = block.cross_section.first().unwrap().to_merkle_node(); let cid2 = leaf.commitment_id(); assert_eq!(cid1, cid2); From c049cbc225dde810ba719c8d76dc7da48bc89758 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 30 Dec 2023 08:06:01 +0100 Subject: [PATCH 3/3] chore: release v0.11.0-beta.3 --- Cargo.lock | 6 +++--- Cargo.toml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7279f1e4..a4f09637 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -198,7 +198,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "client_side_validation" -version = "0.11.0-beta.2" +version = "0.11.0-beta.3" dependencies = [ "commit_verify", "serde", @@ -221,7 +221,7 @@ dependencies = [ [[package]] name = "commit_verify" -version = "0.11.0-beta.2" +version = "0.11.0-beta.3" dependencies = [ "amplify", "commit_encoding_derive", @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "single_use_seals" -version = "0.11.0-beta.2" +version = "0.11.0-beta.3" dependencies = [ "amplify_derive", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 09191f7a..10aa8a93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ default-members = [ ] [workspace.package] -version = "0.11.0-beta.2" +version = "0.11.0-beta.3" authors = ["Dr Maxim Orlovsky "] homepage = "https://github.com/LNP-BP" repository = "https://github.com/LNP-BP/client_side_validation" @@ -41,8 +41,8 @@ name = "client_side_validation" path = "src/lib.rs" [dependencies] -commit_verify = { version = "0.11.0-beta.2", path = "./commit_verify", default-features = false } -single_use_seals = { version = "0.11.0-beta.2", path = "./single_use_seals" } +commit_verify = { version = "0.11.0-beta.3", path = "./commit_verify", default-features = false } +single_use_seals = { version = "0.11.0-beta.3", path = "./single_use_seals" } serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } [features]