Skip to content

Commit 6651e04

Browse files
committed
implement Strict(Serialize|Deserialize) for CompressedPk
1 parent a439ba5 commit 6651e04

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

consensus/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ name = "bc"
1818
[dependencies]
1919
amplify = { workspace = true }
2020
strict_encoding = { workspace = true }
21-
strict_types = { workspace = true, optional = true }
21+
strict_types = { workspace = true }
2222
commit_verify = { workspace = true }
2323
secp256k1 = { workspace = true }
2424
serde_crate = { workspace = true, optional = true }
@@ -27,7 +27,7 @@ chrono = { version = "0.4.38", optional = true }
2727
[features]
2828
default = ["chrono"]
2929
all = ["chrono", "stl", "serde"]
30-
stl = ["strict_types"]
30+
stl = []
3131
serde = [
3232
"serde_crate",
3333
"amplify/serde",

consensus/src/pubkeys.rs

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use strict_encoding::{
2929
DecodeError, ReadStruct, ReadTuple, StrictDecode, StrictEncode, TypedRead, TypedWrite,
3030
WriteStruct,
3131
};
32+
use strict_types::{StrictDeserialize, StrictSerialize};
3233

3334
use crate::LIB_NAME_BITCOIN;
3435

@@ -64,6 +65,9 @@ pub enum InvalidPubkey<const LEN: usize> {
6465
)]
6566
pub struct CompressedPk(PublicKey);
6667

68+
impl StrictSerialize for CompressedPk {}
69+
impl StrictDeserialize for CompressedPk {}
70+
6771
impl CompressedPk {
6872
fn dumb() -> Self { Self(PublicKey::from_slice(&[2u8; 33]).unwrap()) }
6973

0 commit comments

Comments
 (0)