Skip to content

Commit a349ae1

Browse files
committed
correct conflict resolution errors
1 parent 97029ec commit a349ae1

File tree

2 files changed

+37
-47
lines changed

2 files changed

+37
-47
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol-units/execution/maptos/opt-executor/src/executor/initialization.rs

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ use crate::executor::EXECUTOR_CHANNEL_SIZE;
55
use crate::{bootstrap, Context};
66
use anyhow::Context as _;
77
use aptos_config::config::NodeConfig;
8+
#[cfg(test)]
89
use aptos_crypto::ed25519::Ed25519PrivateKey;
910
use aptos_crypto::ed25519::Ed25519PublicKey;
11+
#[cfg(test)]
1012
use aptos_crypto::ValidCryptoMaterialStringExt;
1113
use aptos_executor::block_executor::BlockExecutor;
1214
use aptos_mempool::MempoolClientRequest;
@@ -19,21 +21,6 @@ use movement_signer::Signing;
1921
#[cfg(test)]
2022
use movement_signer_loader::identifiers::{local::Local, SignerIdentifier};
2123
use movement_signer_loader::{Load, LoadedSigner};
22-
//=======
23-
//use aptos_types::transaction::SignedTransaction;
24-
//use maptos_execution_util::config::Config;
25-
26-
//use movement_signer_loader::identifiers::{local::Local, SignerIdentifier};
27-
28-
//use anyhow::Context as _;
29-
//use aptos_crypto::Uniform;
30-
//use futures::channel::mpsc as futures_mpsc;
31-
//use movement_collections::garbage::{counted::GcCounter, Duration};
32-
//use tokio::sync::mpsc;
33-
34-
//use tempfile::TempDir;
35-
36-
//>>>>>>> main
3724
use std::net::ToSocketAddrs;
3825
use std::sync::{Arc, RwLock};
3926
use tempfile::TempDir;
@@ -45,6 +32,10 @@ impl Executor {
4532
public_key: Ed25519PublicKey,
4633
mempool_tx_exec_result_sender: UnboundedSender<Vec<TxExecutionResult>>,
4734
) -> Result<Self, anyhow::Error> {
35+
// get dot movement
36+
// todo: this is a slight anti-pattern, but it's fine for now
37+
let dot_movement = DotMovement::try_from_env()?;
38+
4839
// set up the node config
4940
let mut node_config = NodeConfig::default();
5041

@@ -109,8 +100,7 @@ impl Executor {
109100

110101
// indexer table info config
111102
node_config.indexer_table_info.enabled = true;
112-
let db_dir = maptos_config.chain.maptos_db_path.as_ref().context("No db path provided.")?;
113-
node_config.storage.dir = db_dir.join("maptos-storage");
103+
node_config.storage.dir = dot_movement.get_path().join("maptos-storage");
114104
node_config.storage.set_data_dir(node_config.storage.dir.clone());
115105

116106
let known_release = aptos_framework_known_release::KnownRelease::try_new(
@@ -203,35 +193,35 @@ impl Executor {
203193
Ok((executor, tempdir))
204194
}
205195

206-
pub async fn try_generated() -> Result<
207-
(
208-
Self,
209-
TempDir,
210-
Ed25519PrivateKey,
211-
futures::channel::mpsc::Receiver<Vec<TxExecutionResult>>,
212-
),
213-
anyhow::Error,
214-
> {
215-
// generate a random private key
216-
let private_key = Ed25519PrivateKey::generate_for_testing();
217-
218-
// generate a sender
219-
let (mempool_tx_exec_result_sender, receiver) =
220-
futures_mpsc::channel::<Vec<TxExecutionResult>>(EXECUTOR_CHANNEL_SIZE);
221-
let tempdir = tempfile::tempdir()?;
222-
223-
let mut maptos_config = Config::default();
224-
let raw_private_key_hex = private_key.to_encoded_string()?.to_string();
225-
let prefix_stripped =
226-
raw_private_key_hex.strip_prefix("0x").unwrap_or(&raw_private_key_hex);
227-
maptos_config.chain.maptos_private_key_signer_identifier =
228-
SignerIdentifier::Local(Local { private_key_hex_bytes: prefix_stripped.to_string() });
229-
230-
// replace the db path with the temporary directory
231-
maptos_config.chain.maptos_db_path.replace(tempdir.path().to_path_buf());
232-
let executor = Self::try_from_config(maptos_config, mempool_tx_exec_result_sender).await?;
233-
Ok((executor, tempdir, private_key, receiver))
234-
}
196+
// pub async fn try_generated() -> Result<
197+
// (
198+
// Self,
199+
// TempDir,
200+
// Ed25519PrivateKey,
201+
// futures::channel::mpsc::Receiver<Vec<TxExecutionResult>>,
202+
// ),
203+
// anyhow::Error,
204+
// > {
205+
// // generate a random private key
206+
// let private_key = Ed25519PrivateKey::generate_for_testing();
207+
208+
// // generate a sender
209+
// let (mempool_tx_exec_result_sender, receiver) =
210+
// futures_mpsc::channel::<Vec<TxExecutionResult>>(EXECUTOR_CHANNEL_SIZE);
211+
// let tempdir = tempfile::tempdir()?;
212+
213+
// let mut maptos_config = Config::default();
214+
// let raw_private_key_hex = private_key.to_encoded_string()?.to_string();
215+
// let prefix_stripped =
216+
// raw_private_key_hex.strip_prefix("0x").unwrap_or(&raw_private_key_hex);
217+
// maptos_config.chain.maptos_private_key_signer_identifier =
218+
// SignerIdentifier::Local(Local { private_key_hex_bytes: prefix_stripped.to_string() });
219+
220+
// // replace the db path with the temporary directory
221+
// maptos_config.chain.maptos_db_path.replace(tempdir.path().to_path_buf());
222+
// let executor = Self::try_from_config(maptos_config, mempool_tx_exec_result_sender).await?;
223+
// Ok((executor, tempdir, private_key, receiver))
224+
// }
235225

236226
/// Creates an instance of [`Context`] and the background [`TransactionPipe`]
237227
/// task to process transactions. If the configuration is for a read-only node,

0 commit comments

Comments
 (0)