Skip to content

Commit

Permalink
Correct test
Browse files Browse the repository at this point in the history
  • Loading branch information
musitdev committed Aug 21, 2024
1 parent d760e9d commit 08deab5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion protocol-units/execution/fin-view/src/fin_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ mod tests {
let config = Config::default();
let (tx_sender, _tx_receiver) = mpsc::channel(16);
let executor = Executor::try_from_config(&config)?;
let (context, _transaction_pipe) = executor.background(tx_sender, &config)?;
let (context, _transaction_pipe, _indexer_runtime) =
executor.background(tx_sender, &config)?;
let finality_view = FinalityView::new(context.db_reader());
let service = finality_view.service(
context.mempool_client_sender(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ mod tests {
let private_key = Ed25519PrivateKey::generate_for_testing();
let (tx_sender, _tx_receiver) = mpsc::channel(1);
let (executor, config, _tempdir) = Executor::try_test_default(private_key)?;
let (context, _transaction_pipe) = executor.background(tx_sender, &config)?;
let (context, _transaction_pipe, _indexer_runtime) =
executor.background(tx_sender, &config)?;
let block_id = HashValue::random();
let block_metadata = Transaction::BlockMetadata(BlockMetadata::new(
block_id,
Expand Down Expand Up @@ -299,7 +300,8 @@ mod tests {
let private_key = Ed25519PrivateKey::generate_for_testing();
let (tx_sender, _tx_receiver) = mpsc::channel(1);
let (executor, config, _tempdir) = Executor::try_test_default(private_key)?;
let (context, _transaction_pipe) = executor.background(tx_sender, &config)?;
let (context, _transaction_pipe, _indexer_runtime) =
executor.background(tx_sender, &config)?;
executor.rollover_genesis_now().await?;

// Initialize a root account using a predefined keypair and the test root address.
Expand Down Expand Up @@ -401,7 +403,8 @@ mod tests {
let private_key = Ed25519PrivateKey::generate_for_testing();
let (tx_sender, _tx_receiver) = mpsc::channel(16);
let (executor, config, _tempdir) = Executor::try_test_default(private_key)?;
let (context, _transaction_pipe) = executor.background(tx_sender, &config)?;
let (context, _transaction_pipe, _indexer_runtime) =
executor.background(tx_sender, &config)?;
let service = Service::new(&context);
executor.rollover_genesis_now().await?;

Expand Down
3 changes: 2 additions & 1 deletion protocol-units/execution/opt-executor/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ mod tests {
async fn test_pipe_mempool_while_server_running() -> Result<(), anyhow::Error> {
let (tx_sender, mut tx_receiver) = mpsc::channel(16);
let (executor, config, _tempdir) = Executor::try_test_default(GENESIS_KEYPAIR.0.clone())?;
let (context, mut transaction_pipe) = executor.background(tx_sender, &config)?;
let (context, mut transaction_pipe, _indexer_runtime) =
executor.background(tx_sender, &config)?;
let service = Service::new(&context);
let handle = tokio::spawn(async move { service.run().await });

Expand Down
9 changes: 6 additions & 3 deletions protocol-units/execution/opt-executor/src/transaction_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ mod tests {
let (tx_sender, tx_receiver) = mpsc::channel(16);
let (executor, config, _tempdir) =
Executor::try_test_default(GENESIS_KEYPAIR.0.clone()).unwrap();
let (context, transaction_pipe) = executor.background(tx_sender, &config).unwrap();
let (context, transaction_pipe, _indexer_runtime) =
executor.background(tx_sender, &config).unwrap();
(transaction_pipe, context.mempool_client_sender(), tx_receiver)
}

Expand Down Expand Up @@ -309,7 +310,8 @@ mod tests {
async fn test_pipe_mempool_from_api() -> Result<(), anyhow::Error> {
let (tx_sender, mut tx_receiver) = mpsc::channel(16);
let (executor, config, _tempdir) = Executor::try_test_default(GENESIS_KEYPAIR.0.clone())?;
let (context, mut transaction_pipe) = executor.background(tx_sender, &config)?;
let (context, mut transaction_pipe, _indexer_runtime) =
executor.background(tx_sender, &config)?;
let service = Service::new(&context);

#[allow(unreachable_code)]
Expand Down Expand Up @@ -338,7 +340,8 @@ mod tests {
async fn test_repeated_pipe_mempool_from_api() -> Result<(), anyhow::Error> {
let (tx_sender, mut tx_receiver) = mpsc::channel(16);
let (executor, config, _tempdir) = Executor::try_test_default(GENESIS_KEYPAIR.0.clone())?;
let (context, mut transaction_pipe) = executor.background(tx_sender, &config)?;
let (context, mut transaction_pipe, _indexer_runtime) =
executor.background(tx_sender, &config)?;
let service = Service::new(&context);

#[allow(unreachable_code)]
Expand Down

0 comments on commit 08deab5

Please sign in to comment.