Skip to content

Commit 45ddb42

Browse files
refactor: simplify ValidationMode enum by implementing Default trait
Updated the ValidationMode enum to include the Default trait, setting the default value to Full. This change streamlines the code and enhances usability by providing a clear default validation mode.
1 parent 0571d49 commit 45ddb42

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

dash-spv/src/types.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -510,24 +510,19 @@ impl std::fmt::Debug for ChainState {
510510
}
511511

512512
/// Validation mode for the SPV client.
513-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
513+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
514514
pub enum ValidationMode {
515515
/// Validate only basic structure and signatures.
516516
Basic,
517517

518518
/// Validate proof of work and chain rules.
519+
#[default]
519520
Full,
520521

521522
/// Skip most validation (useful for testing).
522523
None,
523524
}
524525

525-
impl Default for ValidationMode {
526-
fn default() -> Self {
527-
Self::Full
528-
}
529-
}
530-
531526
/// Peer information.
532527
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
533528
pub struct PeerInfo {

0 commit comments

Comments
 (0)