iota_types/transaction_executor.rs
1// Copyright (c) Mysten Labs, Inc.
2// Modifications Copyright (c) 2024 IOTA Stiftung
3// SPDX-License-Identifier: Apache-2.0
4
5use crate::quorum_driver_types::{
6 ExecuteTransactionRequestV1, ExecuteTransactionResponseV1, QuorumDriverError,
7};
8
9/// Trait to define the interface for how the REST service interacts with a a
10/// QuorumDriver or a simulated transaction executor.
11#[async_trait::async_trait]
12pub trait TransactionExecutor: Send + Sync {
13 async fn execute_transaction(
14 &self,
15 request: ExecuteTransactionRequestV1,
16 client_addr: Option<std::net::SocketAddr>,
17 ) -> Result<ExecuteTransactionResponseV1, QuorumDriverError>;
18}