Skip to content

Commit 0fbe07f

Browse files
committed
Fix signer_chainstate test and add it to CI
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 67e254e commit 0fbe07f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/bitcoin-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ jobs:
134134
- tests::nakamoto_integrations::utxo_check_on_startup_panic
135135
- tests::nakamoto_integrations::utxo_check_on_startup_recover
136136
- tests::nakamoto_integrations::v3_signer_api_endpoint
137+
- tests::nakamoto_integrations::signer_chainstate
137138
# TODO: enable these once v1 signer is supported by a new nakamoto epoch
138139
# - tests::signer::v1::dkg
139140
# - tests::signer::v1::sign_request_rejected

stacks-signer/src/chainstate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,12 @@ impl SortitionsView {
482482
if signed_over_time + tenure_last_block_proposal_timeout.as_secs()
483483
> get_epoch_time_secs()
484484
{
485+
// The last locally accepted block is not timed out, return it
485486
return Ok(Some(local_info));
486487
}
487488
}
488489
}
489-
490+
// The last locally accepted block is timed out, get the last globally accepted block
490491
signer_db
491492
.get_last_globally_accepted_block(consensus_hash)
492493
.map_err(|e| ClientError::InvalidResponse(e.to_string()))

testnet/stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6543,10 +6543,10 @@ fn signer_chainstate() {
65436543
valid: Some(true),
65446544
signed_over: true,
65456545
proposed_time: get_epoch_time_secs(),
6546-
signed_self: None,
6547-
signed_group: None,
6546+
signed_self: Some(get_epoch_time_secs()),
6547+
signed_group: Some(get_epoch_time_secs()),
65486548
ext: ExtraBlockInfo::None,
6549-
state: BlockState::Unprocessed,
6549+
state: BlockState::GloballyAccepted,
65506550
})
65516551
.unwrap();
65526552

0 commit comments

Comments
 (0)