Skip to content

Commit

Permalink
[executor] trivial: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
msmouse authored and bors-libra committed Dec 10, 2021
1 parent 8ae96d0 commit c4549f1
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 23 deletions.
6 changes: 3 additions & 3 deletions api/src/tests/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use diem_types::{
use diem_vm::DiemVM;
use diemdb::DiemDB;
use executor::{db_bootstrapper, Executor};
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use hyper::Response;
use mempool_notifications::MempoolNotificationSender;
use storage_interface::DbReaderWriter;
Expand Down Expand Up @@ -94,7 +94,7 @@ pub struct TestContext {
pub db: Arc<DiemDB>,
rng: rand::rngs::StdRng,
root_keys: Arc<RootKeys>,
executor: Arc<dyn BlockExecutor>,
executor: Arc<dyn BlockExecutorTrait>,
expect_status_code: u16,
}

Expand All @@ -104,7 +104,7 @@ impl TestContext {
rng: rand::rngs::StdRng,
root_keys: RootKeys,
validator_owner: AccountAddress,
executor: Box<dyn BlockExecutor>,
executor: Box<dyn BlockExecutorTrait>,
mempool: MockSharedMempool,
db: Arc<DiemDB>,
) -> Self {
Expand Down
9 changes: 6 additions & 3 deletions execution/execution-correctness/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ use crate::execution_correctness::ExecutionCorrectness;
use consensus_types::{block::Block, vote_proposal::VoteProposal};
use diem_crypto::{ed25519::Ed25519PrivateKey, traits::SigningKey, HashValue};
use diem_types::ledger_info::LedgerInfoWithSignatures;
use executor_types::{BlockExecutor, Error, StateComputeResult};
use executor_types::{BlockExecutorTrait, Error, StateComputeResult};
use std::{boxed::Box, sync::Arc};

pub struct LocalService {
block_executor: Box<dyn BlockExecutor>,
block_executor: Box<dyn BlockExecutorTrait>,
prikey: Option<Ed25519PrivateKey>,
}

impl LocalService {
pub fn new(block_executor: Box<dyn BlockExecutor>, prikey: Option<Ed25519PrivateKey>) -> Self {
pub fn new(
block_executor: Box<dyn BlockExecutorTrait>,
prikey: Option<Ed25519PrivateKey>,
) -> Self {
Self {
block_executor,
prikey,
Expand Down
6 changes: 3 additions & 3 deletions execution/execution-correctness/src/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::execution_correctness::ExecutionCorrectness;
use consensus_types::{block::Block, vote_proposal::VoteProposal};
use diem_crypto::{ed25519::Ed25519PrivateKey, traits::SigningKey, HashValue};
use diem_types::ledger_info::LedgerInfoWithSignatures;
use executor_types::{BlockExecutor, Error, StateComputeResult};
use executor_types::{BlockExecutorTrait, Error, StateComputeResult};
use serde::{Deserialize, Serialize};
use std::sync::Arc;

Expand All @@ -18,12 +18,12 @@ pub enum ExecutionCorrectnessInput {
}

pub struct SerializerService {
internal: Box<dyn BlockExecutor>,
internal: Box<dyn BlockExecutorTrait>,
prikey: Option<Ed25519PrivateKey>,
}

impl SerializerService {
pub fn new(internal: Box<dyn BlockExecutor>, prikey: Option<Ed25519PrivateKey>) -> Self {
pub fn new(internal: Box<dyn BlockExecutorTrait>, prikey: Option<Ed25519PrivateKey>) -> Self {
Self { internal, prikey }
}

Expand Down
2 changes: 1 addition & 1 deletion execution/executor-benchmark/src/transaction_committer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use executor::{
},
Executor,
};
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use std::{
collections::BTreeMap,
sync::{mpsc, Arc},
Expand Down
2 changes: 1 addition & 1 deletion execution/executor-benchmark/src/transaction_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use diem_types::{
};
use diem_vm::DiemVM;
use executor::Executor;
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use std::{
sync::{mpsc, Arc},
time::{Duration, Instant},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use diem_types::{
use diem_vm::DiemVM;
use diemdb::DiemDB;
use executor::Executor;
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use rand::SeedableRng;
use std::{convert::TryFrom, sync::Arc};
use storage_interface::{default_protocol::DbReaderWriter, Order};
Expand Down
2 changes: 1 addition & 1 deletion execution/executor-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub trait ChunkExecutorTrait: Send + Sync {
) -> Result<Vec<ContractEvent>>;
}

pub trait BlockExecutor: Send + Sync {
pub trait BlockExecutorTrait: Send + Sync {
/// Get the latest committed block id
fn committed_block_id(&self) -> Result<HashValue, Error>;

Expand Down
4 changes: 2 additions & 2 deletions execution/executor/src/block_executor_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use diem_types::{
},
};
use diem_vm::VMExecutor;
use executor_types::{BlockExecutor, Error, ProcessedVMOutput, StateComputeResult};
use executor_types::{BlockExecutorTrait, Error, ProcessedVMOutput, StateComputeResult};
use fail::fail_point;

use crate::{
Expand All @@ -28,7 +28,7 @@ use crate::{
};
use diem_types::{proof::definition::LeafCount, protocol_spec::ProtocolSpec};

impl<PS, V> BlockExecutor for Executor<PS, V>
impl<PS, V> BlockExecutorTrait for Executor<PS, V>
where
PS: ProtocolSpec,
V: VMExecutor,
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/db_bootstrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use diem_types::{
waypoint::Waypoint,
};
use diem_vm::VMExecutor;
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use move_core_types::move_resource::MoveResource;
use std::collections::btree_map::BTreeMap;
use storage_interface::{
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/fuzzing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use diem_types::{
vm_status::VMStatus,
};
use diem_vm::VMExecutor;
use executor_types::{BlockExecutor, ChunkExecutorTrait};
use executor_types::{BlockExecutorTrait, ChunkExecutorTrait};
use storage_interface::{default_protocol::DbReaderWriter, DbReader, DbWriter, StartupInfo};

fn create_test_executor() -> Executor<DpnProto, FakeVM> {
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/tests/chunk_executor_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use diem_types::{
transaction::default_protocol::{TransactionListWithProof, TransactionOutputListWithProof},
};
use diemdb::DiemDB;
use executor_types::{BlockExecutor, ChunkExecutorTrait};
use executor_types::{BlockExecutorTrait, ChunkExecutorTrait};
use proptest::prelude::Rng;
use storage_interface::default_protocol::DbReaderWriter;

Expand Down
2 changes: 1 addition & 1 deletion execution/executor/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use diem_types::{
},
};
use diemdb::DiemDB;
use executor_types::{BlockExecutor, ChunkExecutorTrait, TransactionReplayer};
use executor_types::{BlockExecutorTrait, ChunkExecutorTrait, TransactionReplayer};
use proptest::prelude::*;
use std::collections::BTreeMap;

Expand Down
2 changes: 1 addition & 1 deletion execution/executor/tests/db_bootstrapper_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use executor::{
use executor_test_helpers::{
bootstrap_genesis, gen_ledger_info_with_sigs, get_test_signed_transaction,
};
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use move_core_types::move_resource::MoveResource;
use rand::SeedableRng;
use std::{convert::TryFrom, sync::Arc};
Expand Down
2 changes: 1 addition & 1 deletion execution/executor/tests/storage_integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use executor_test_helpers::{
create_db_and_executor, test_execution_with_storage_impl, verify_committed_txn_status,
},
};
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use move_ir_compiler::Compiler;
use std::convert::TryFrom;

Expand Down
2 changes: 1 addition & 1 deletion secure/key-manager/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use diem_types::{
use diem_vm::DiemVM;
use diemdb::DiemDB;
use executor::Executor;
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use futures::{channel::mpsc::channel, StreamExt};
use rand::{rngs::StdRng, SeedableRng};
use std::{cell::RefCell, collections::BTreeMap, convert::TryFrom, sync::Arc};
Expand Down
2 changes: 1 addition & 1 deletion state-sync/state-sync-v1/src/executor_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ mod tests {
use executor_test_helpers::{
bootstrap_genesis, gen_block_id, gen_ledger_info_with_sigs, get_test_signed_transaction,
};
use executor_types::BlockExecutor;
use executor_types::BlockExecutorTrait;
use futures::{future::FutureExt, stream::StreamExt};
use move_core_types::language_storage::TypeTag;
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit c4549f1

Please sign in to comment.