From b59221a695ea9aefd9c3ca28680e84f5c26f1256 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 22 Dec 2024 18:26:20 +0100 Subject: [PATCH] chore: update from serde_crate to dep:serde --- Cargo.toml | 6 +-- consensus/Cargo.toml | 4 +- consensus/src/block.rs | 18 ++------ consensus/src/coding.rs | 4 +- consensus/src/hashtypes.rs | 24 ++--------- consensus/src/lib.rs | 2 +- consensus/src/pubkeys.rs | 14 ++---- consensus/src/script.rs | 23 +++------- consensus/src/segwit.rs | 17 ++------ consensus/src/sigtypes.rs | 30 +++---------- consensus/src/taproot.rs | 85 +++++++------------------------------ consensus/src/timelocks.rs | 30 +++---------- consensus/src/tx.rs | 38 +++-------------- dbc/Cargo.toml | 4 +- dbc/src/lib.rs | 2 +- dbc/src/opret/mod.rs | 12 +----- dbc/src/proof.rs | 6 +-- dbc/src/tapret/mod.rs | 24 ++--------- dbc/src/tapret/tapscript.rs | 4 +- dbc/src/tapret/tx.rs | 6 +-- dbc/src/tapret/xonlypk.rs | 6 +-- seals/Cargo.toml | 4 +- seals/src/lib.rs | 2 +- seals/src/txout.rs | 52 +++++------------------ src/bp.rs | 6 +-- src/lib.rs | 2 +- 26 files changed, 89 insertions(+), 336 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c5f52969..45c7d467 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ bp-consensus = { version = "0.12.0-beta.2", path = "./consensus" } bp-dbc = { version = "0.12.0-beta.2", path = "./dbc" } bp-seals = { version = "0.12.0-beta.2", path = "./seals" } secp256k1 = { version = "0.30.0", features = ["global-context", "rand"] } -serde_crate = { package = "serde", version = "1", features = ["derive"] } +serde = { version = "1", features = ["derive"] } [package] name = "bp-core" @@ -65,14 +65,14 @@ single_use_seals = { workspace = true } bp-consensus = { workspace = true } bp-dbc = { workspace = true } bp-seals = { workspace = true } -serde_crate = { workspace = true, optional = true } +serde = { workspace = true, optional = true } [features] default = [] all = ["chrono", "serde", "stl"] chrono = ["bp-consensus/chrono"] serde = [ - "serde_crate", + "dep:serde", "bp-consensus/serde", "bp-dbc/serde", "bp-seals/serde", diff --git a/consensus/Cargo.toml b/consensus/Cargo.toml index b566c44c..d4597cad 100644 --- a/consensus/Cargo.toml +++ b/consensus/Cargo.toml @@ -21,7 +21,7 @@ strict_encoding = { workspace = true } strict_types = { workspace = true, optional = true } commit_verify = { workspace = true } secp256k1 = { workspace = true } -serde_crate = { workspace = true, optional = true } +serde = { workspace = true, optional = true } chrono = { version = "0.4.38", optional = true } [features] @@ -29,7 +29,7 @@ default = ["chrono"] all = ["chrono", "stl", "serde"] stl = ["strict_types"] serde = [ - "serde_crate", + "dep:serde", "amplify/serde", "secp256k1/serde" ] diff --git a/consensus/src/block.rs b/consensus/src/block.rs index 3057e565..c919f649 100644 --- a/consensus/src/block.rs +++ b/consensus/src/block.rs @@ -32,11 +32,7 @@ use crate::{BlockDataParseError, ConsensusDecode, ConsensusEncode, LIB_NAME_BITC #[derive(Wrapper, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, From)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] #[wrapper(BorrowSlice, Index, RangeOps, Debug, Hex, Display, FromStr)] pub struct BlockHash( #[from] @@ -47,11 +43,7 @@ pub struct BlockHash( #[derive(Wrapper, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, From)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] #[wrapper(BorrowSlice, Index, RangeOps, Debug, Hex, Display, FromStr)] pub struct BlockMerkleRoot( #[from] @@ -63,11 +55,7 @@ pub struct BlockMerkleRoot( #[display(LowerHex)] #[derive(StrictType, StrictEncode, StrictDecode, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct BlockHeader { /// Block version, now repurposed for soft fork signalling. pub version: i32, diff --git a/consensus/src/coding.rs b/consensus/src/coding.rs index 9fc87e41..67b69ec3 100644 --- a/consensus/src/coding.rs +++ b/consensus/src/coding.rs @@ -124,8 +124,8 @@ impl ByteStr { #[cfg(feature = "serde")] mod _serde { use amplify::hex::{FromHex, ToHex}; - use serde_crate::de::Error; - use serde_crate::{Deserialize, Deserializer, Serialize, Serializer}; + use serde::de::Error; + use serde::{Deserialize, Deserializer, Serialize, Serializer}; use super::*; diff --git a/consensus/src/hashtypes.rs b/consensus/src/hashtypes.rs index bc95d1c6..1b268523 100644 --- a/consensus/src/hashtypes.rs +++ b/consensus/src/hashtypes.rs @@ -30,11 +30,7 @@ use crate::{ #[wrapper(Index, RangeOps, AsSlice, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct PubkeyHash( #[from] #[from([u8; 20])] @@ -79,11 +75,7 @@ impl From for PubkeyHash { #[wrapper(Index, RangeOps, AsSlice, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct ScriptHash( #[from] #[from([u8; 20])] @@ -108,11 +100,7 @@ impl From<&RedeemScript> for ScriptHash { #[wrapper(Index, RangeOps, AsSlice, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct WPubkeyHash( #[from] #[from([u8; 20])] @@ -137,11 +125,7 @@ impl From for WPubkeyHash { #[wrapper(Index, RangeOps, AsSlice, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct WScriptHash( #[from] #[from([u8; 32])] diff --git a/consensus/src/lib.rs b/consensus/src/lib.rs index e48ab53e..9041395d 100644 --- a/consensus/src/lib.rs +++ b/consensus/src/lib.rs @@ -44,7 +44,7 @@ extern crate strict_encoding; extern crate commit_verify; #[cfg(feature = "serde")] #[macro_use] -extern crate serde_crate as serde; +extern crate serde; extern crate core; /// Re-export of `secp256k1` crate. diff --git a/consensus/src/pubkeys.rs b/consensus/src/pubkeys.rs index fd979b8d..30b48617 100644 --- a/consensus/src/pubkeys.rs +++ b/consensus/src/pubkeys.rs @@ -57,11 +57,7 @@ pub enum InvalidPubkey { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN, dumb = Self::dumb())] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct CompressedPk(PublicKey); impl CompressedPk { @@ -110,11 +106,7 @@ impl FromStr for CompressedPk { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN, dumb = Self::dumb())] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct UncompressedPk(PublicKey); impl UncompressedPk { @@ -159,7 +151,7 @@ impl FromStr for UncompressedPk { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN, dumb = Self::dumb())] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct LegacyPk { pub compressed: bool, #[wrap] diff --git a/consensus/src/script.rs b/consensus/src/script.rs index 3c4709cc..eb99fe0f 100644 --- a/consensus/src/script.rs +++ b/consensus/src/script.rs @@ -30,11 +30,7 @@ use crate::{ScriptHash, VarInt, VarIntBytes, WitnessVer, LIB_NAME_BITCOIN}; #[wrapper_mut(DerefMut, AsSliceMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct SigScript(ScriptBytes); impl TryFrom> for SigScript { @@ -72,11 +68,7 @@ impl SigScript { #[wrapper_mut(DerefMut, AsSliceMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct ScriptPubkey(ScriptBytes); impl TryFrom> for ScriptPubkey { @@ -163,11 +155,7 @@ impl ScriptPubkey { #[wrapper_mut(DerefMut, AsSliceMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct RedeemScript(ScriptBytes); impl TryFrom> for RedeemScript { @@ -312,9 +300,8 @@ impl ScriptBytes { #[cfg(feature = "serde")] mod _serde { use amplify::hex::{FromHex, ToHex}; - use serde::{Deserialize, Serialize}; - use serde_crate::de::Error; - use serde_crate::{Deserializer, Serializer}; + use serde::de::Error; + use serde::{Deserialize, Deserializer, Serialize, Serializer}; use super::*; diff --git a/consensus/src/segwit.rs b/consensus/src/segwit.rs index 695bcdb3..681d339c 100644 --- a/consensus/src/segwit.rs +++ b/consensus/src/segwit.rs @@ -308,11 +308,7 @@ impl ScriptPubkey { #[wrapper_mut(DerefMut, AsSliceMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct WitnessScript(ScriptBytes); impl TryFrom> for WitnessScript { @@ -357,11 +353,7 @@ impl WitnessScript { #[wrapper(BorrowSlice, Index, RangeOps, Debug, Hex, Display, FromStr)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct Wtxid( #[from] #[from([u8; 32])] @@ -403,9 +395,8 @@ impl Witness { #[cfg(feature = "serde")] mod _serde { - use serde::{Deserialize, Serialize}; - use serde_crate::ser::SerializeSeq; - use serde_crate::{Deserializer, Serializer}; + use serde::ser::SerializeSeq; + use serde::{Deserialize, Deserializer, Serialize, Serializer}; use super::*; diff --git a/consensus/src/sigtypes.rs b/consensus/src/sigtypes.rs index b40f8d58..d1ce4b5e 100644 --- a/consensus/src/sigtypes.rs +++ b/consensus/src/sigtypes.rs @@ -31,11 +31,7 @@ use crate::{NonStandardValue, ScriptBytes, ScriptPubkey, WitnessScript, LIB_NAME #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, Display, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN, tags = repr, into_u8, try_from_u8)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] #[display(uppercase)] #[repr(u8)] pub enum SighashFlag { @@ -55,11 +51,7 @@ pub enum SighashFlag { #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct SighashType { pub flag: SighashFlag, pub anyone_can_pay: bool, @@ -200,11 +192,7 @@ impl Display for SighashType { #[wrapper(Index, RangeOps, AsSlice, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct Sighash( #[from] #[from([u8; 32])] @@ -283,11 +271,7 @@ pub enum SigError { #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] #[derive(StrictType)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct LegacySig { /// The underlying ECDSA Signature pub sig: ecdsa::Signature, @@ -329,11 +313,7 @@ impl LegacySig { #[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] #[derive(StrictType)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct Bip340Sig { /// The underlying ECDSA Signature pub sig: schnorr::Signature, diff --git a/consensus/src/taproot.rs b/consensus/src/taproot.rs index c9267e19..61fd9314 100644 --- a/consensus/src/taproot.rs +++ b/consensus/src/taproot.rs @@ -75,11 +75,7 @@ impl From> for DecodeError { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN, dumb = Self::dumb())] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct XOnlyPk(XOnlyPublicKey); impl XOnlyPk { @@ -173,11 +169,7 @@ impl InternalKeypair { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct InternalPk( #[from] #[from(XOnlyPublicKey)] @@ -237,11 +229,7 @@ impl From for [u8; 32] { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct OutputPk(XOnlyPk); impl OutputPk { @@ -280,11 +268,7 @@ pub trait IntoTapHash { #[wrapper(Index, RangeOps, AsSlice, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct TapSighash( #[from] #[from([u8; 32])] @@ -311,11 +295,7 @@ impl TapSighash { #[wrapper(Index, RangeOps, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictEncode, StrictDecode, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct TapLeafHash( #[from] #[from([u8; 32])] @@ -348,11 +328,7 @@ impl IntoTapHash for TapLeafHash { #[wrapper(Index, RangeOps, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictEncode, StrictDecode, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct TapBranchHash( #[from] #[from([u8; 32])] @@ -376,11 +352,7 @@ impl IntoTapHash for TapBranchHash { #[wrapper(Index, RangeOps, AsSlice, BorrowSlice, Hex, Display, FromStr)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct TapNodeHash( #[from] #[from([u8; 32])] @@ -398,11 +370,7 @@ impl IntoTapHash for TapNodeHash { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct TapMerklePath(Confined, 0, 128>); impl IntoIterator for TapMerklePath { @@ -458,11 +426,7 @@ pub struct InvalidLeafVer(u8); /// The leaf version for tapleafs. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub enum LeafVer { /// BIP-342 tapscript. #[default] @@ -546,11 +510,7 @@ impl UpperHex for LeafVer { #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN, dumb = { Self(0x51) })] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct FutureLeafVer(u8); impl FutureLeafVer { @@ -583,7 +543,7 @@ impl UpperHex for FutureLeafVer { #[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Default, Display)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[display("{version:04x} {script:x}")] pub struct LeafScript { pub version: LeafVer, @@ -658,11 +618,7 @@ pub enum TapCode { #[wrapper_mut(DerefMut, AsSliceMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct TapScript(ScriptBytes); // TODO: impl Display/FromStr for TapScript providing correct opcodes @@ -737,11 +693,7 @@ pub struct InvalidParityValue(pub u8); #[display(lowercase)] #[derive(StrictType, StrictEncode, StrictDecode, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN, tags = repr, into_u8, try_from_u8)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] #[repr(u8)] pub enum Parity { /// Even parity. @@ -797,11 +749,7 @@ impl BitXor for Parity { #[derive(Clone, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictEncode, StrictDecode, StrictDumb)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct ControlBlock { /// The tapleaf version. pub leaf_version: LeafVer, @@ -883,9 +831,8 @@ impl Annex { #[cfg(feature = "serde")] mod _serde { use amplify::hex::{FromHex, ToHex}; - use serde::{Deserialize, Serialize}; - use serde_crate::de::Error; - use serde_crate::{Deserializer, Serializer}; + use serde::de::Error; + use serde::{Deserialize, Deserializer, Serialize, Serializer}; use super::*; diff --git a/consensus/src/timelocks.rs b/consensus/src/timelocks.rs index 946dd512..0e3a63fb 100644 --- a/consensus/src/timelocks.rs +++ b/consensus/src/timelocks.rs @@ -76,11 +76,7 @@ pub enum TimelockParseError { #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct LockTime(u32); impl PartialOrd for LockTime { @@ -156,11 +152,7 @@ impl LockTime { #[derive(Copy, Clone, PartialOrd, Ord, Eq, PartialEq, Hash, Debug, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct LockTimestamp(u32); impl From for u32 { @@ -272,11 +264,7 @@ impl FromStr for LockTimestamp { #[derive(Copy, Clone, PartialOrd, Ord, Eq, PartialEq, Hash, Debug, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct LockHeight(u32); impl From for u32 { @@ -378,11 +366,7 @@ impl FromStr for LockHeight { #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct SeqNo(u32); impl SeqNo { @@ -425,11 +409,7 @@ impl SeqNo { #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN, tags = order)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub enum TimeLockInterval { /// Describes number of blocks for the timelock #[display("height({0})")] diff --git a/consensus/src/tx.rs b/consensus/src/tx.rs index d3590734..76ae6b3a 100644 --- a/consensus/src/tx.rs +++ b/consensus/src/tx.rs @@ -39,11 +39,7 @@ use crate::{ #[wrapper(AsSlice)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] #[wrapper(BorrowSlice, Index, RangeOps, Debug, Hex, Display, FromStr)] // all-zeros used in coinbase pub struct Txid( @@ -66,11 +62,7 @@ impl Txid { #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Display, From)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] #[display(inner)] // 0xFFFFFFFF used in coinbase pub struct Vout(u32); @@ -218,11 +210,7 @@ mod _serde_outpoint { #[derive(Clone, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct TxIn { pub prev_output: Outpoint, pub sig_script: SigScript, @@ -237,11 +225,7 @@ pub struct TxIn { #[wrapper_mut(MathAssign)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct Sats( #[from] #[from(u32)] @@ -366,11 +350,7 @@ impl Display for Sats { #[derive(Clone, Eq, PartialEq, Hash, Debug, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct TxOut { pub value: Sats, pub script_pubkey: ScriptPubkey, @@ -388,7 +368,7 @@ impl TxOut { #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct TxVer(i32); impl Default for TxVer { @@ -423,11 +403,7 @@ impl TxVer { #[derive(Clone, Eq, PartialEq, Hash, Debug, Display)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] #[display(LowerHex)] pub struct Tx { pub version: TxVer, diff --git a/dbc/Cargo.toml b/dbc/Cargo.toml index dde423ae..2fb3940e 100644 --- a/dbc/Cargo.toml +++ b/dbc/Cargo.toml @@ -23,13 +23,13 @@ strict_encoding = { workspace = true } commit_verify = { workspace = true, features = ["rand"] } bp-consensus = { workspace = true } secp256k1 = { workspace = true } -serde_crate = { workspace = true, optional = true } +serde = { workspace = true, optional = true } [features] default = [] all = ["serde"] serde = [ - "serde_crate", + "dep:serde", "bp-consensus/serde", "commit_verify/serde", "secp256k1/serde" diff --git a/dbc/src/lib.rs b/dbc/src/lib.rs index e994aabf..b1bd5f6d 100644 --- a/dbc/src/lib.rs +++ b/dbc/src/lib.rs @@ -43,7 +43,7 @@ extern crate amplify; #[cfg(feature = "serde")] #[macro_use] -extern crate serde_crate as serde; +extern crate serde; #[macro_use] extern crate strict_encoding; extern crate commit_verify; diff --git a/dbc/src/opret/mod.rs b/dbc/src/opret/mod.rs index e519369f..d6f522eb 100644 --- a/dbc/src/opret/mod.rs +++ b/dbc/src/opret/mod.rs @@ -41,11 +41,7 @@ impl CommitmentProtocol for OpretFirst {} /// Errors during tapret commitment. #[derive(Clone, Eq, PartialEq, Debug, Display, Error, From)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] #[display(doc_comments)] pub enum OpretError { /// transaction doesn't contain OP_RETURN output. @@ -60,11 +56,7 @@ pub enum OpretError { #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BPCORE)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct OpretProof(()); impl StrictSerialize for OpretProof {} diff --git a/dbc/src/proof.rs b/dbc/src/proof.rs index e011861d..cee594bc 100644 --- a/dbc/src/proof.rs +++ b/dbc/src/proof.rs @@ -41,11 +41,7 @@ pub struct MethodParseError(pub String); /// - commitment algorithm; /// - used hash functions. #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BPCORE, tags = repr, into_u8, try_from_u8)] #[repr(u8)] diff --git a/dbc/src/tapret/mod.rs b/dbc/src/tapret/mod.rs index e7225f66..8cdc05f9 100644 --- a/dbc/src/tapret/mod.rs +++ b/dbc/src/tapret/mod.rs @@ -103,11 +103,7 @@ pub enum TapretPathError { #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BPCORE)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] #[display("{left_node_hash}:{right_node_hash}")] pub struct TapretRightBranch { left_node_hash: TapNodeHash, @@ -170,11 +166,7 @@ impl StrictDecode for TapretRightBranch { #[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, From)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BPCORE, tags = order, dumb = Self::RightLeaf(default!()))] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] #[display(inner)] pub enum TapretNodePartner { /// Tapret commitment is on the right side of the tree; i.e the node @@ -258,11 +250,7 @@ impl TapretNodePartner { #[derive(Getters, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BPCORE)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct TapretPathProof { /// Information about the sibling at level 1 of the tree partner_node: Option, @@ -344,11 +332,7 @@ impl<'data> IntoIterator for &'data TapretPathProof { #[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BPCORE)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct TapretProof { /// A merkle path to the commitment inside the taproot script tree. For /// each node it also must hold information about the sibling in form of diff --git a/dbc/src/tapret/tapscript.rs b/dbc/src/tapret/tapscript.rs index 1e9399fe..db159e6c 100644 --- a/dbc/src/tapret/tapscript.rs +++ b/dbc/src/tapret/tapscript.rs @@ -114,8 +114,8 @@ impl CommitVerify for TapScript { #[cfg(feature = "serde")] mod _serde { use amplify::{Bytes, Wrapper}; - use serde_crate::de::Error; - use serde_crate::{Deserialize, Deserializer, Serialize, Serializer}; + use serde::de::Error; + use serde::{Deserialize, Deserializer, Serialize, Serializer}; use super::*; diff --git a/dbc/src/tapret/tx.rs b/dbc/src/tapret/tx.rs index 635d6e53..a8c1afcb 100644 --- a/dbc/src/tapret/tx.rs +++ b/dbc/src/tapret/tx.rs @@ -26,11 +26,7 @@ use super::{TapretFirst, TapretKeyError, TapretProof}; /// Errors during tapret commitment. #[derive(Clone, Eq, PartialEq, Debug, Display, Error, From)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub enum TapretError { /// Error embedding tapret commitment into x-only key. #[from] diff --git a/dbc/src/tapret/xonlypk.rs b/dbc/src/tapret/xonlypk.rs index ab8679e2..1f9fa6a6 100644 --- a/dbc/src/tapret/xonlypk.rs +++ b/dbc/src/tapret/xonlypk.rs @@ -28,11 +28,7 @@ use crate::tapret::tapscript::TapretCommitment; /// Errors during tapret commitment embedding into x-only public key. #[derive(Clone, Eq, PartialEq, Debug, Display, Error, From)] #[display(doc_comments)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub enum TapretKeyError { /// tapret node partner {0} contains alternative commitment AlternativeCommitment(TapretNodePartner), diff --git a/seals/Cargo.toml b/seals/Cargo.toml index f9fc8a5e..483aef6b 100644 --- a/seals/Cargo.toml +++ b/seals/Cargo.toml @@ -25,7 +25,7 @@ strict_encoding = { workspace = true } bp-consensus = { workspace = true } bp-dbc = { workspace = true } rand = "0.8.5" -serde_crate = { workspace = true, optional = true } +serde = { workspace = true, optional = true } [features] default = [] @@ -35,7 +35,7 @@ serde = [ "commit_verify/serde", "bp-consensus/serde", "bp-dbc/serde", - "serde_crate" + "dep:serde" ] [package.metadata.docs.rs] diff --git a/seals/src/lib.rs b/seals/src/lib.rs index 5ddb8195..d891e3b7 100644 --- a/seals/src/lib.rs +++ b/seals/src/lib.rs @@ -41,7 +41,7 @@ extern crate strict_encoding; extern crate commit_verify; #[cfg(feature = "serde")] #[macro_use] -extern crate serde_crate as serde; +extern crate serde; mod txout; diff --git a/seals/src/txout.rs b/seals/src/txout.rs index c09d8dc2..0f2c02ab 100644 --- a/seals/src/txout.rs +++ b/seals/src/txout.rs @@ -35,11 +35,7 @@ use strict_encoding::StrictDumb; #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = dbc::LIB_NAME_BPCORE)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct Noise(Bytes<40>); pub mod mmb { @@ -52,11 +48,7 @@ pub mod mmb { #[wrapper(Deref, BorrowSlice, Display, FromStr, Hex, Index, RangeOps)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = dbc::LIB_NAME_BPCORE)] - #[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) - )] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct Message( #[from] #[from([u8; 32])] @@ -67,11 +59,7 @@ pub mod mmb { #[wrapper(Deref, BorrowSlice, Hex, Index, RangeOps)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = dbc::LIB_NAME_BPCORE)] - #[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) - )] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct Commitment( #[from] #[from([u8; 32])] @@ -89,11 +77,7 @@ pub mod mmb { #[strict_type(lib = dbc::LIB_NAME_BPCORE)] #[derive(CommitEncode)] #[commit_encode(strategy = strict, id = Commitment)] - #[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") - )] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct BundleProof { pub map: SmallOrdMap, } @@ -134,7 +118,7 @@ pub mod mpc { #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase", untagged) + serde(rename_all = "camelCase", untagged) )] pub enum MessageSource { #[from] @@ -159,21 +143,13 @@ pub mod mpc { #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = dbc::LIB_NAME_BPCORE)] - #[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) - )] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(transparent))] pub struct MessageMap(MediumOrdMap); #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = dbc::LIB_NAME_BPCORE)] - #[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") - )] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct Source { pub min_depth: u5, pub entropy: u64, @@ -204,11 +180,7 @@ pub mod mpc { #[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = dbc::LIB_NAME_BPCORE)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub struct Anchor { pub mmb_proof: mmb::BundleProof, pub mpc_protocol: mpc::ProtocolId, @@ -235,11 +207,7 @@ pub struct Proof { #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = dbc::LIB_NAME_BPCORE, tags = custom)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", untagged) -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(untagged))] pub enum TxoSealExt { #[display("~")] #[strict_type(tag = 0)] @@ -260,7 +228,7 @@ impl StrictDumb for TxoSealExt { #[strict_type(lib = dbc::LIB_NAME_BPCORE)] #[derive(CommitEncode)] #[commit_encode(strategy = strict, id = StrictHash)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct TxoSeal { pub primary: Outpoint, pub secondary: TxoSealExt, diff --git a/src/bp.rs b/src/bp.rs index 7d51fbef..bef1a450 100644 --- a/src/bp.rs +++ b/src/bp.rs @@ -25,11 +25,7 @@ use strict_encoding::{StrictDecode, StrictDumb, StrictEncode}; #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = dbc::LIB_NAME_BPCORE, tags = custom, dumb = Self::Bitcoin(strict_dumb!()))] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(rename_all = "camelCase"))] pub enum Bp where T: StrictDumb + StrictEncode + StrictDecode { diff --git a/src/lib.rs b/src/lib.rs index 7e26bcb1..e1b3f619 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,7 +54,7 @@ extern crate amplify; extern crate strict_encoding; #[cfg(feature = "serde")] #[macro_use] -extern crate serde_crate as serde; +extern crate serde; #[cfg(feature = "stl")] pub mod stl;