-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathlib.rs
43 lines (33 loc) · 1.12 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
pub mod v1;
pub use aptos_types::{
transaction::signature_verified_transaction::SignatureVerifiedTransaction,
block_executor::partitioner::ExecutableBlock,
block_executor::partitioner::ExecutableTransactions,
transaction::{SignedTransaction, Transaction}
};
pub use aptos_crypto::hash::HashValue;
use async_channel::Sender;
use aptos_api::runtime::Apis;
pub use maptos_execution_util::FinalityMode;
#[tonic::async_trait]
pub trait SuzukaExecutor {
/// Runs the service
async fn run_service(&self) -> Result<(), anyhow::Error>;
/// Runs the necessary background tasks.
async fn run_background_tasks(&self) -> Result<(), anyhow::Error>;
/// Executes a block dynamically
async fn execute_block(
&self,
mode: FinalityMode,
block: ExecutableBlock,
) -> Result<(), anyhow::Error>;
/// Sets the transaction channel.
fn set_tx_channel(
&mut self,
tx_channel: Sender<SignedTransaction>,
);
/// Gets the dyn API.
fn get_api(&self, mode: FinalityMode) -> Apis;
/// Get block head height.
async fn get_block_head_height(&self) -> Result<u64, anyhow::Error>;
}