-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implemented audit; working on a bad-data test * Appease cargo fmt * Add a test to ensure that audit catches corrupt data * Add a proper return type for feed.audit
- Loading branch information
1 parent
5840a3a
commit 86e241f
Showing
6 changed files
with
122 additions
and
5 deletions.
There are no files selected for viewing
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,20 @@ | ||
/// The audit report for a feed, created by the `.audit()` method. | ||
#[derive(Debug, PartialEq, Clone)] | ||
pub struct Audit { | ||
/// The number of valid blocks identified | ||
pub valid_blocks: usize, | ||
/// The number of invalid blocks identified | ||
pub invalid_blocks: usize, | ||
} | ||
|
||
impl Audit { | ||
/// Access the `valid_blocks` field from the proof. | ||
pub fn valid_blocks(&self) -> usize { | ||
self.valid_blocks | ||
} | ||
|
||
/// Access the `invalid_blocks` field from the proof. | ||
pub fn invalid_blocks(&self) -> usize { | ||
self.invalid_blocks | ||
} | ||
} |
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