Skip to content

Commit

Permalink
test: add decision reached step to end to end test (#1408)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware authored Oct 27, 2024
1 parent 8535ee9 commit b7f8ed7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions crates/tests-integration/tests/end_to_end_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use starknet_api::block::BlockNumber;
use starknet_api::transaction::TransactionHash;
use starknet_batcher_types::batcher_types::{
BuildProposalInput,
DecisionReachedInput,
GetProposalContent,
GetProposalContentInput,
ProposalId,
Expand Down Expand Up @@ -49,21 +50,15 @@ pub async fn run_consensus_for_end_to_end_test(
batcher_client: &SharedBatcherClient,
expected_batched_tx_hashes: &[TransactionHash],
) {
// Setup. Holds the state of the consensus manager.

// Set start height.
// TODO(Arni): Get the current height and retrospective_block_hash from the rpc storage
let current_height = BlockNumber(1);

// Test.

// Start height.
// TODO(Arni): Get the current height and retrospective_block_hash from the rpc storage or use
// consensus directly.
let current_height = BlockNumber(1);
batcher_client.start_height(StartHeightInput { height: current_height }).await.unwrap();

// Build proposal.
let proposal_id = ProposalId(0);
let retrospective_block_hash = None;

let build_proposal_duaration = chrono::TimeDelta::new(1, 0).unwrap();
batcher_client
.build_proposal(BuildProposalInput {
Expand Down Expand Up @@ -91,5 +86,8 @@ pub async fn run_consensus_for_end_to_end_test(
}
};

// Decision reached.
batcher_client.decision_reached(DecisionReachedInput { proposal_id }).await.unwrap();

assert_eq!(expected_batched_tx_hashes, executed_tx_hashes);
}

0 comments on commit b7f8ed7

Please sign in to comment.