Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5c77750

Browse files
committedMar 10, 2025··
fix consensus_tests
1 parent ff7ba86 commit 5c77750

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed
 

‎crates/iota-core/src/unit_tests/consensus_tests.rs

+20-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// Modifications Copyright (c) 2024 IOTA Stiftung
33
// SPDX-License-Identifier: Apache-2.0
44

5-
use consensus_core::{BlockRef, BlockStatus};
65
use std::collections::HashSet;
76

7+
use consensus_core::{BlockRef, BlockStatus};
88
use fastcrypto::traits::KeyPair;
99
use iota_protocol_config::ProtocolConfig;
1010
use iota_types::{
@@ -138,7 +138,7 @@ pub fn make_consensus_adapter_for_test(
138138
transactions: &[ConsensusTransaction],
139139
epoch_store: &Arc<AuthorityPerEpochStore>,
140140
) -> IotaResult<BlockStatusReceiver> {
141-
let sequenced_transactions = transactions
141+
let sequenced_transactions: Vec<SequencedConsensusTransaction> = transactions
142142
.iter()
143143
.map(|txn| SequencedConsensusTransaction::new_test(txn.clone()))
144144
.collect();
@@ -247,7 +247,12 @@ async fn submit_transaction_to_consensus_adapter() {
247247
with_block_status(BlockStatus::GarbageCollected(BlockRef::MIN)),
248248
with_block_status(BlockStatus::Sequenced(BlockRef::MIN)),
249249
];
250-
let adapter = make_consensus_adapter_for_test(state.clone(), HashSet::new(), false, block_status_receivers);
250+
let adapter = make_consensus_adapter_for_test(
251+
state.clone(),
252+
HashSet::new(),
253+
false,
254+
block_status_receivers,
255+
);
251256

252257
// Submit the transaction and ensure the adapter reports success to the caller.
253258
// Note that consensus may drop some transactions (so we may need to
@@ -285,7 +290,12 @@ async fn submit_multiple_transactions_to_consensus_adapter() {
285290
process_via_checkpoint.insert(*certificates[1].digest());
286291

287292
// Make a new consensus adapter instance.
288-
let adapter = make_consensus_adapter_for_test(state.clone(), process_via_checkpoint, false);
293+
let adapter = make_consensus_adapter_for_test(
294+
state.clone(),
295+
process_via_checkpoint,
296+
false,
297+
vec![with_block_status(BlockStatus::Sequenced(BlockRef::MIN))],
298+
);
289299

290300
// Submit the transaction and ensure the adapter reports success to the caller.
291301
// Note that consensus may drop some transactions (so we may need to
@@ -317,7 +327,12 @@ async fn submit_checkpoint_signature_to_consensus_adapter() {
317327
let epoch_store = state.epoch_store_for_testing();
318328

319329
// Make a new consensus adapter instance.
320-
let adapter = make_consensus_adapter_for_test(state, HashSet::new(), false);
330+
let adapter = make_consensus_adapter_for_test(
331+
state,
332+
HashSet::new(),
333+
false,
334+
vec![with_block_status(BlockStatus::Sequenced(BlockRef::MIN))],
335+
);
321336

322337
let checkpoint_summary = CheckpointSummary::new(
323338
&ProtocolConfig::get_for_max_version_UNSAFE(),

0 commit comments

Comments
 (0)
Please sign in to comment.