Skip to content

Commit 1701784

Browse files
committed
Use wait_for helper functions throughout
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 9c130c7 commit 1701784

File tree

2 files changed

+162
-498
lines changed

2 files changed

+162
-498
lines changed

testnet/stacks-node/src/tests/signer/mod.rs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::time::{Duration, Instant};
2323
use clarity::boot_util::boot_code_id;
2424
use clarity::vm::types::PrincipalData;
2525
use libsigner::v0::messages::{
26-
BlockAccepted, BlockRejection, BlockResponse, MessageSlotID, PeerInfo, SignerMessage,
26+
BlockAccepted, BlockResponse, MessageSlotID, PeerInfo, SignerMessage,
2727
};
2828
use libsigner::{BlockProposal, SignerEntries, SignerEventTrait};
2929
use stacks::chainstate::coordinator::comm::CoordinatorChannels;
@@ -676,33 +676,6 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
676676
})
677677
}
678678

679-
/// Get all block rejections for a given block
680-
pub fn get_block_rejections(
681-
&self,
682-
signer_signature_hash: &Sha512Trunc256Sum,
683-
) -> Vec<BlockRejection> {
684-
let stackerdb_events = test_observer::get_stackerdb_chunks();
685-
let block_rejections = stackerdb_events
686-
.into_iter()
687-
.flat_map(|chunk| chunk.modified_slots)
688-
.filter_map(|chunk| {
689-
let message = SignerMessage::consensus_deserialize(&mut chunk.data.as_slice())
690-
.expect("Failed to deserialize SignerMessage");
691-
match message {
692-
SignerMessage::BlockResponse(BlockResponse::Rejected(rejection)) => {
693-
if rejection.signer_signature_hash == *signer_signature_hash {
694-
Some(rejection)
695-
} else {
696-
None
697-
}
698-
}
699-
_ => None,
700-
}
701-
})
702-
.collect::<Vec<_>>();
703-
block_rejections
704-
}
705-
706679
/// Get the latest block response from the given slot
707680
pub fn get_latest_block_response(&self, slot_id: u32) -> BlockResponse {
708681
let mut stackerdb = StackerDB::new_normal(

0 commit comments

Comments
 (0)