Vstaging statement distribution omnibus (#1436)

in-progress PR adding new tests and solving bugs

---------

Co-authored-by: Bradley Olson <34992650+BradleyOlson64@users.noreply.github.com>
Co-authored-by: eskimor <eskimor@no-such-url.com>
Co-authored-by: eskimor <eskimor@users.noreply.github.com>
Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
This commit is contained in:
asynchronous rob
2023-10-21 04:01:14 -05:00
committed by GitHub
parent 76994356fc
commit a46183c706
14 changed files with 655 additions and 128 deletions
+3 -5
View File
@@ -1574,7 +1574,7 @@ async fn post_import_statement_actions<Context>(
ctx: &mut Context,
rp_state: &mut PerRelayParentState,
summary: Option<&TableSummary>,
) -> Result<(), Error> {
) {
if let Some(attested) = summary.as_ref().and_then(|s| {
rp_state.table.attested_candidate(
&s.candidate,
@@ -1630,8 +1630,6 @@ async fn post_import_statement_actions<Context>(
}
issue_new_misbehaviors(ctx, rp_state.parent, &mut rp_state.table);
Ok(())
}
/// Check if there have happened any new misbehaviors and issue necessary messages.
@@ -1674,7 +1672,7 @@ async fn sign_import_and_distribute_statement<Context>(
let smsg = StatementDistributionMessage::Share(rp_state.parent, signed_statement.clone());
ctx.send_unbounded_message(smsg);
post_import_statement_actions(ctx, rp_state, summary.as_ref()).await?;
post_import_statement_actions(ctx, rp_state, summary.as_ref()).await;
Ok(Some(signed_statement))
} else {
@@ -1800,7 +1798,7 @@ async fn maybe_validate_and_import<Context>(
}
let summary = res?;
post_import_statement_actions(ctx, rp_state, summary.as_ref()).await?;
post_import_statement_actions(ctx, rp_state, summary.as_ref()).await;
if let Some(summary) = summary {
// import_statement already takes care of communicating with the