Skip to content

Commit 5a25e3e

Browse files
committed
use RejectReason instead of RejectCode
1 parent 53fb16b commit 5a25e3e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

libsigner/src/v0/messages.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ impl From<&RejectReason> for RejectCode {
615615
RejectReason::RejectedInPriorRound => RejectCode::RejectedInPriorRound,
616616
RejectReason::SortitionViewMismatch => RejectCode::SortitionViewMismatch,
617617
RejectReason::TestingDirective => RejectCode::TestingDirective,
618-
RejectReason::ReorgNotAllowed => RejectCode::SortitionViewMismatch,
619618
// Newer reject reasons were expanded from SortitionViewMismatch
620619
_ => RejectCode::SortitionViewMismatch,
621620
}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,12 +1064,12 @@ fn wait_for_block_global_rejection(
10641064
}
10651065

10661066
/// Waits for >30% of num_signers block rejection to be observed in the test_observer stackerdb chunks for a block
1067-
/// with the provided signer signature hash and the specified reject_code
1068-
fn wait_for_block_global_rejection_with_reject_code(
1067+
/// with the provided signer signature hash and the specified reject_reason
1068+
fn wait_for_block_global_rejection_with_reject_reason(
10691069
timeout_secs: u64,
10701070
block_signer_signature_hash: Sha512Trunc256Sum,
10711071
num_signers: usize,
1072-
reject_code: RejectCode,
1072+
reject_reason: RejectReason,
10731073
) -> Result<(), String> {
10741074
let mut found_rejections = HashSet::new();
10751075
wait_for(timeout_secs, || {
@@ -1082,12 +1082,12 @@ fn wait_for_block_global_rejection_with_reject_code(
10821082
if let SignerMessage::BlockResponse(BlockResponse::Rejected(BlockRejection {
10831083
signer_signature_hash,
10841084
signature,
1085-
reason_code,
1085+
response_data,
10861086
..
10871087
})) = message
10881088
{
10891089
if signer_signature_hash == block_signer_signature_hash
1090-
&& reason_code == reject_code
1090+
&& response_data.reject_reason == reject_reason
10911091
{
10921092
found_rejections.insert(signature);
10931093
}
@@ -10316,11 +10316,11 @@ fn disallow_reorg_within_first_proposal_burn_block_timing_secs_but_more_than_one
1031610316
let proposed_block = wait_for_block_proposal(30, block_n_height + 1, &miner_pk_1)
1031710317
.expect("Timed out waiting for block proposal");
1031810318
// check it has been rejected
10319-
wait_for_block_global_rejection_with_reject_code(
10319+
wait_for_block_global_rejection_with_reject_reason(
1032010320
30,
1032110321
proposed_block.header.signer_signature_hash(),
1032210322
num_signers,
10323-
RejectCode::SortitionViewMismatch,
10323+
RejectReason::ReorgNotAllowed,
1032410324
)
1032510325
.expect("Timed out waiting for a block proposal to be rejected due to invalid reorg");
1032610326

0 commit comments

Comments
 (0)