Skip to content

Commit 050efa7

Browse files
refactor: remove redundant CLSig and ISLock structs
1 parent 2051bda commit 050efa7

File tree

3 files changed

+9
-26
lines changed

3 files changed

+9
-26
lines changed

dash-spv/src/client/message_handler.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ impl<'a> MessageHandler<'a> {
148148
// This would need access to transaction processing logic
149149
tracing::debug!("Transaction processing not yet implemented in message handler");
150150
}
151-
NetworkMessage::CLSig(clsig) => {
152-
tracing::info!("Received ChainLock for block {}", clsig.chain_lock.block_hash);
151+
NetworkMessage::CLSig(chain_lock) => {
152+
tracing::info!("Received ChainLock for block {}", chain_lock.block_hash);
153153
// ChainLock processing would need access to state and validation
154154
// This might need to be handled at the client level
155155
tracing::debug!("ChainLock processing not yet implemented in message handler");
156156
}
157-
NetworkMessage::ISLock(islock_msg) => {
158-
tracing::info!("Received InstantSendLock for tx {}", islock_msg.instant_lock.txid);
157+
NetworkMessage::ISLock(instant_lock) => {
158+
tracing::info!("Received InstantSendLock for tx {}", instant_lock.txid);
159159
// InstantLock processing would need access to validation
160160
// This might need to be handled at the client level
161161
tracing::debug!("InstantLock processing not yet implemented in message handler");

dash/src/network/message.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use crate::network::{
3232
message_blockdata, message_bloom, message_compact_blocks, message_filter, message_network,
3333
message_qrinfo, message_sml,
3434
};
35+
use crate::{ChainLock, InstantLock};
3536
use crate::prelude::*;
3637

3738
/// The maximum number of [super::message_blockdata::Inventory] items in an `inv` message.
@@ -260,8 +261,9 @@ pub enum NetworkMessage {
260261
/// `qrinfo`
261262
QRInfo(message_qrinfo::QRInfo),
262263
/// `clsig`
263-
CLSig(message_sml::CLSig),
264-
ISLock(message_sml::ISLock),
264+
CLSig(ChainLock),
265+
/// `isdlock`
266+
ISLock(InstantLock),
265267
/// Any other message.
266268
Unknown {
267269
/// The command of this message.

dash/src/network/message_sml.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::internal_macros::impl_consensus_encoding;
77
use crate::sml::llmq_type::LLMQType;
88
use crate::sml::masternode_list_entry::MasternodeListEntry;
99
use crate::transaction::special_transaction::quorum_commitment::QuorumEntry;
10-
use crate::{BlockHash, ChainLock, InstantLock, ProTxHash, QuorumHash, Transaction};
10+
use crate::{BlockHash, ProTxHash, QuorumHash, Transaction};
1111

1212
/// The `getmnlistd` message requests a `mnlistdiff` message that provides either:
1313
/// - A full masternode list (if `base_block_hash` is all-zero)
@@ -99,25 +99,6 @@ pub struct DeletedQuorum {
9999

100100
impl_consensus_encoding!(DeletedQuorum, llmq_type, quorum_hash);
101101

102-
#[derive(PartialEq, Eq, Clone, Debug)]
103-
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
104-
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
105-
#[cfg_attr(feature = "serde", serde(crate = "actual_serde"))]
106-
pub struct CLSig {
107-
pub chain_lock: ChainLock,
108-
}
109-
110-
impl_consensus_encoding!(CLSig, chain_lock);
111-
112-
#[derive(PartialEq, Eq, Clone, Debug)]
113-
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
114-
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
115-
#[cfg_attr(feature = "serde", serde(crate = "actual_serde"))]
116-
pub struct ISLock {
117-
pub instant_lock: InstantLock,
118-
}
119-
120-
impl_consensus_encoding!(ISLock, instant_lock);
121102

122103
#[cfg(test)]
123104
mod tests {

0 commit comments

Comments
 (0)