Skip to content

Commit

Permalink
code quality- Fixing serde clippy warning (#367)
Browse files Browse the repository at this point in the history
Signed-off-by: Siddhesh Z <[email protected]>
  • Loading branch information
siddheshzz authored Feb 5, 2025
1 parent 6a073bc commit 879e263
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion crates/floresta-wire/src/p2p_wire/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const PING_TIMEOUT: u64 = 30;
/// If the last message we've got was more than XX, send out a ping
const SEND_PING_TIMEOUT: u64 = 60;
/// The inv element type for a utreexo block with witness data
const INV_UTREEXO_BLOCK: u32 = 0x40000002 | 1 << 24;
const INV_UTREEXO_BLOCK: u32 = 0x40000002 | (1 << 24);

#[derive(Debug, PartialEq)]
enum State {
Expand Down
1 change: 0 additions & 1 deletion crates/floresta-wire/src/p2p_wire/sync_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ impl NodeContext for SyncNode {

/// Node methods for a [`UtreexoNode`] where its Context is a [`SyncNode`].
/// See [node](crates/floresta-wire/src/p2p_wire/node.rs) for more information.
impl<Chain> UtreexoNode<Chain, SyncNode>
where
WireError: From<<Chain as BlockchainInterface>::Error>,
Expand Down
19 changes: 8 additions & 11 deletions florestad/src/slip132.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use bitcoin::base58;
use bitcoin::bip32;
use bitcoin::bip32::Xpriv;
use bitcoin::bip32::Xpub;
use serde::Deserialize;
use serde::Serialize;

/// Magical version bytes for xpub: bitcoin mainnet public key for P2PKH or P2SH
pub const VERSION_MAGIC_XPUB: [u8; 4] = [0x04, 0x88, 0xB2, 0x1E];
Expand Down Expand Up @@ -147,36 +149,31 @@ pub struct DefaultResolver;

/// SLIP 132-defined key applications defining types of scriptPubkey descriptors
/// in which they can be used
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate")
)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Serialize, Deserialize)]
#[non_exhaustive]
pub enum KeyApplication {
/// xprv/xpub: keys that can be used for P2PKH and multisig P2SH
/// scriptPubkey descriptors.
#[cfg_attr(feature = "serde", serde(rename = "bip44"))]
#[serde(rename = "bip44")]
Hashed,

/// zprv/zpub: keys that can be used for P2WPKH scriptPubkey descriptors
#[cfg_attr(feature = "serde", serde(rename = "bip84"))]
#[serde(rename = "bip84")]
SegWit,

/// Zprv/Zpub: keys that can be used for multisig P2WSH scriptPubkey
/// descriptors
#[cfg_attr(feature = "serde", serde(rename = "bip48-native"))]
#[serde(rename = "bip48-native")]
SegWitMultisig,

/// yprv/ypub: keys that can be used for P2WPKH-in-P2SH scriptPubkey
/// descriptors
#[cfg_attr(feature = "serde", serde(rename = "bip49"))]
#[serde(rename = "bip49")]
Nested,

/// Yprv/Ypub: keys that can be used for multisig P2WSH-in-P2SH
/// scriptPubkey descriptors
#[cfg_attr(feature = "serde", serde(rename = "bip48-nested"))]
#[serde(rename = "bip48-nested")]
NestedMultisig,
}

Expand Down

0 comments on commit 879e263

Please sign in to comment.