|
2 | 2 | // Modifications Copyright (c) 2024 IOTA Stiftung
|
3 | 3 | // SPDX-License-Identifier: Apache-2.0
|
4 | 4 |
|
5 |
| -use consensus_core::{BlockRef, BlockStatus}; |
6 | 5 | use std::collections::HashSet;
|
7 | 6 |
|
| 7 | +use consensus_core::{BlockRef, BlockStatus}; |
8 | 8 | use fastcrypto::traits::KeyPair;
|
9 | 9 | use iota_protocol_config::ProtocolConfig;
|
10 | 10 | use iota_types::{
|
@@ -138,7 +138,7 @@ pub fn make_consensus_adapter_for_test(
|
138 | 138 | transactions: &[ConsensusTransaction],
|
139 | 139 | epoch_store: &Arc<AuthorityPerEpochStore>,
|
140 | 140 | ) -> IotaResult<BlockStatusReceiver> {
|
141 |
| - let sequenced_transactions = transactions |
| 141 | + let sequenced_transactions: Vec<SequencedConsensusTransaction> = transactions |
142 | 142 | .iter()
|
143 | 143 | .map(|txn| SequencedConsensusTransaction::new_test(txn.clone()))
|
144 | 144 | .collect();
|
@@ -247,7 +247,12 @@ async fn submit_transaction_to_consensus_adapter() {
|
247 | 247 | with_block_status(BlockStatus::GarbageCollected(BlockRef::MIN)),
|
248 | 248 | with_block_status(BlockStatus::Sequenced(BlockRef::MIN)),
|
249 | 249 | ];
|
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 | + ); |
251 | 256 |
|
252 | 257 | // Submit the transaction and ensure the adapter reports success to the caller.
|
253 | 258 | // Note that consensus may drop some transactions (so we may need to
|
@@ -285,7 +290,12 @@ async fn submit_multiple_transactions_to_consensus_adapter() {
|
285 | 290 | process_via_checkpoint.insert(*certificates[1].digest());
|
286 | 291 |
|
287 | 292 | // 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 | + ); |
289 | 299 |
|
290 | 300 | // Submit the transaction and ensure the adapter reports success to the caller.
|
291 | 301 | // Note that consensus may drop some transactions (so we may need to
|
@@ -317,7 +327,12 @@ async fn submit_checkpoint_signature_to_consensus_adapter() {
|
317 | 327 | let epoch_store = state.epoch_store_for_testing();
|
318 | 328 |
|
319 | 329 | // 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 | + ); |
321 | 336 |
|
322 | 337 | let checkpoint_summary = CheckpointSummary::new(
|
323 | 338 | &ProtocolConfig::get_for_max_version_UNSAFE(),
|
|
0 commit comments