Adding individual epoch auditing in kt auditor example#460
Merged
kevinlewi merged 1 commit intofacebook:mainfrom Aug 4, 2025
Merged
Adding individual epoch auditing in kt auditor example#460kevinlewi merged 1 commit intofacebook:mainfrom
kevinlewi merged 1 commit intofacebook:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #460 +/- ##
==========================================
+ Coverage 88.61% 89.03% +0.42%
==========================================
Files 39 38 -1
Lines 9109 7600 -1509
==========================================
- Hits 8072 6767 -1305
+ Misses 1037 833 -204 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9fdd42c to
6a2c0f7
Compare
Merged
dillongeorge
approved these changes
Jul 30, 2025
| } | ||
|
|
||
| pub(crate) async fn get_proof_from_epoch(url: &str, epoch: u64) -> Result<EpochSummary> { | ||
| let params: Vec<(String, String)> = vec![ |
Contributor
There was a problem hiding this comment.
I don't think that we need to explicitly denote the type here.
| ("prefix".to_string(), format!("{}/", epoch)), | ||
| ]; | ||
|
|
||
| let (keys, truncated_result) = get_xml(url, ¶ms).await.unwrap(); |
Contributor
There was a problem hiding this comment.
We may want to propagate the error instead of unwrapping here, otherwise we can lose useful context.
| if keys.is_empty() { | ||
| bail!("Could not find epoch {}", epoch); | ||
| } | ||
| Ok(keys[0].clone()) |
Comment on lines
137
to
140
| if let Some(epoch_summary) = maybe_proof { | ||
| do_epoch_audit(epoch_summary).await?; | ||
| } else { | ||
| Err("Epoch is out of available range") | ||
| bail!("Could not find epoch {}", epoch); |
Contributor
There was a problem hiding this comment.
We can use let-else here to clean this up a bit:
let Some(epoch_summary) = maybe_proof else {
bail!("Could not find epoch {epoch}");
};
do_epoch_audit(epoch_summary).await?6a2c0f7 to
43bf51e
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the ability for the whatsapp-kt-auditor example to audit a specific epoch, rather than loading all proofs first and then picking the epoch (which can be much slower)