-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1348 from Oscar-Pepper/zingo_sync_reorg_logic
Zingo sync reorg logic
- Loading branch information
Showing
13 changed files
with
716 additions
and
204 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//! Top level error module for the crate | ||
use crate::scan::error::ScanError; | ||
|
||
/// Top level error enum encapsulating any error that may occur during sync | ||
#[derive(Debug, thiserror::Error)] | ||
pub enum SyncError { | ||
/// Errors associated with scanning | ||
#[error("Scan error. {0}")] | ||
ScanError(#[from] ScanError), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use zcash_primitives::{block::BlockHash, consensus::BlockHeight}; | ||
|
||
#[derive(Debug, thiserror::Error)] | ||
pub enum ScanError { | ||
#[error("Continuity error. {0}")] | ||
ContinuityError(#[from] ContinuityError), | ||
} | ||
|
||
#[derive(Debug, thiserror::Error)] | ||
pub enum ContinuityError { | ||
#[error("Height discontinuity. Block with height {height} is not continuous with previous block height {previous_block_height}")] | ||
HeightDiscontinuity { | ||
height: BlockHeight, | ||
previous_block_height: BlockHeight, | ||
}, | ||
#[error("Hash discontinuity. Block prev_hash {prev_hash} with height {height} does not match previous block hash {previous_block_hash}")] | ||
HashDiscontinuity { | ||
height: BlockHeight, | ||
prev_hash: BlockHash, | ||
previous_block_hash: BlockHash, | ||
}, | ||
} |
Oops, something went wrong.