diff --git a/src/serde_utils.rs b/src/serde_utils.rs index 8b74807e..30d4d32f 100644 --- a/src/serde_utils.rs +++ b/src/serde_utils.rs @@ -1,7 +1,7 @@ //! Module for special serde serializations. -pub mod btreemap { +pub mod btreemap_as_seq { //! Module for serialization of BTreeMaps because serde_json will //! not serialize hashmaps with non-string keys be default. #![allow(missing_docs)] @@ -60,7 +60,7 @@ pub mod btreemap { } } -pub mod btreemap_byte_values { +pub mod btreemap_as_seq_byte_values { //! Module for serialization of BTreeMaps with Vec values because //! serde_json will not serialize hashmaps with non-string keys be default. #![allow(missing_docs)] diff --git a/src/util/psbt/map/global.rs b/src/util/psbt/map/global.rs index d3b9c5b4..44a7fc3a 100644 --- a/src/util/psbt/map/global.rs +++ b/src/util/psbt/map/global.rs @@ -46,13 +46,12 @@ pub struct Global { pub version: u32, /// A global map from extended public keys to the used key fingerprint and /// derivation path as defined by BIP 32 - #[cfg_attr(feature = "serde", serde(with = "::serde_utils::btreemap"))] pub xpub: BTreeMap, /// Global proprietary key-value pairs. - #[cfg_attr(feature = "serde", serde(with = "::serde_utils::btreemap_byte_values"))] + #[cfg_attr(feature = "serde", serde(with = "::serde_utils::btreemap_as_seq_byte_values"))] pub proprietary: BTreeMap>, /// Unknown global key-value pairs. - #[cfg_attr(feature = "serde", serde(with = "::serde_utils::btreemap_byte_values"))] + #[cfg_attr(feature = "serde", serde(with = "::serde_utils::btreemap_as_seq_byte_values"))] pub unknown: BTreeMap>, } diff --git a/src/util/psbt/map/input.rs b/src/util/psbt/map/input.rs index 4f42a9ac..a8cb0161 100644 --- a/src/util/psbt/map/input.rs +++ b/src/util/psbt/map/input.rs @@ -70,7 +70,6 @@ pub struct Input { pub witness_utxo: Option, /// A map from public keys to their corresponding signature as would be /// pushed to the stack from a scriptSig or witness. - #[cfg_attr(feature = "serde", serde(with = "::serde_utils::btreemap_byte_values"))] pub partial_sigs: BTreeMap>, /// The sighash type to be used for this input. Signatures for this input /// must use the sighash type. @@ -81,7 +80,7 @@ pub struct Input { pub witness_script: Option