Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ members = [
"migration/core/node/*",
"migration/core/migrator/*",
"migration/util/*",
# executor

# environments
"environments/core/*",
"environments/util/*",

# checks
## node
"checks/node/util/*",
"checks/node/citeria/*",
"checks/node/checks/*",
"checks/node/preludes",
# e2e
## migrator
"checks/migrator/util/*",
"checks/migrator/citeria/*",
"checks/migrator/checks/*",

# util
"util/bcs-ext",
"util/movement/*",
Expand Down Expand Up @@ -209,6 +216,14 @@ movement-aptos-core = { path = "util/movement-aptos/core" }
movement-aptos-core-util = { path = "util/movement-aptos/core-util" }
mtma-types = { path = "util/types" }

## Environments
### util
mtma-environment-types = { path = "environments/util/types" }
### core
mtma-testing-environment = { path = "environments/core/testing" }
mtma-provisioner-environment = { path = "environments/core/provisioner" }
mtma-box-environment = { path = "environments/core/box" }

[workspace.lints.clippy]
debug_assert_with_mut_call = "deny"
inefficient_to_string = "deny"
Expand Down
42 changes: 42 additions & 0 deletions environments/core/box/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[package]
name = "mtma-box-environment"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
homepage = { workspace = true }
publish = { workspace = true }
rust-version = { workspace = true }

[dependencies]
tokio = { workspace = true }
serde = { workspace = true, features = ["derive"] }
clap = { workspace = true, features = ["derive"] }
dotenv = { workspace = true }
anyhow = { workspace = true }
clap-markdown-ext = { workspace = true }
thiserror = { workspace = true }
orfile = { workspace = true }
mtma-node-types = { workspace = true }
mtma-migrator-types = { workspace = true }
mtma-node-null-core = { workspace = true }
aptos-db = { workspace = true }
aptos-storage-interface = { workspace = true }
aptos-config = { workspace = true }
aptos-executor = { workspace = true }
aptos-vm = { workspace = true }
chrono = { workspace = true }
walkdir = { workspace = true }
uuid = { workspace = true }
tracing = { workspace = true }
aptos-framework-pre-l1-merge-release = { workspace = true }
movement-signer = { workspace = true }
movement-signer-loader = { workspace = true }
hex = { workspace = true }
mtma-types = { workspace = true }
movement-core = { workspace = true }
mtma-environment-types = { workspace = true }
kestrel = { workspace = true }

[lints]
workspace = true
2 changes: 2 additions & 0 deletions environments/core/box/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# `mtma-box-environment`
The environment which provides a [Migrator](/README.md#migrator) constructed via access to state on the current node.
7 changes: 7 additions & 0 deletions environments/core/box/src/environment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// Contains the configuration structs and logic for the migration.
pub mod config;
/// Contains the logic for the migration.
pub mod environment;

pub use config::*;
pub use environment::*;
28 changes: 28 additions & 0 deletions environments/core/box/src/environment/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use crate::BoxEnvironment;
use clap::Parser;
use serde::{Deserialize, Serialize};
use std::fmt::Debug;

/// Errors thrown when working with the [Config].
#[derive(Debug, thiserror::Error)]
pub enum EnvironmentConfigError {
#[error("failed to build from config: {0}")]
Build(#[source] Box<dyn std::error::Error + Send + Sync>),
}

/// The config for the [BoxEnvironment].
///
/// All fields should be easily statically encodable to a CLI argument.
/// This is the frontend for the core API.
#[derive(Parser, Debug, Serialize, Deserialize, Clone, Default)]
#[clap(help_expected = true)]
pub struct Config {}

impl Config {
/// Builds the [BoxEnvironment] struct from the config.
///
/// Note: preserving faillibility here because we may add debug path configuration to the [BoxEnvironment] soon.
pub fn build(&self) -> Result<BoxEnvironment, EnvironmentConfigError> {
Ok(BoxEnvironment::new())
}
}
30 changes: 30 additions & 0 deletions environments/core/box/src/environment/environment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
use mtma_environment_types::{EnvironmentError, Environmentish};
use mtma_migrator_types::migrator::MovementMigrator;
use std::fmt::Debug;

/// Errors thrown when using the [BoxEnvironment].
#[derive(Debug, thiserror::Error)]
pub enum BoxEnvironmentError {
#[error("Testing Environment: failed with an internal error: {0}")]
Internal(#[source] Box<dyn std::error::Error + Send + Sync>),
}

impl From<BoxEnvironmentError> for EnvironmentError {
fn from(e: BoxEnvironmentError) -> Self {
EnvironmentError::Internal(e.into())
}
}

pub struct BoxEnvironment {}

impl BoxEnvironment {
pub fn new() -> Self {
Self {}
}
}

impl Environmentish for BoxEnvironment {
async fn build_movement_migrator(&self) -> Result<MovementMigrator, EnvironmentError> {
Err(BoxEnvironmentError::Internal(anyhow::anyhow!("not implemented").into()).into())
}
}
2 changes: 2 additions & 0 deletions environments/core/box/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod environment;
pub use environment::*;
42 changes: 42 additions & 0 deletions environments/core/provisioner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[package]
name = "mtma-provisioner-environment"
version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
homepage = { workspace = true }
publish = { workspace = true }
rust-version = { workspace = true }

[dependencies]
tokio = { workspace = true }
serde = { workspace = true, features = ["derive"] }
clap = { workspace = true, features = ["derive"] }
dotenv = { workspace = true }
anyhow = { workspace = true }
clap-markdown-ext = { workspace = true }
thiserror = { workspace = true }
orfile = { workspace = true }
mtma-node-types = { workspace = true }
mtma-migrator-types = { workspace = true }
mtma-node-null-core = { workspace = true }
aptos-db = { workspace = true }
aptos-storage-interface = { workspace = true }
aptos-config = { workspace = true }
aptos-executor = { workspace = true }
aptos-vm = { workspace = true }
chrono = { workspace = true }
walkdir = { workspace = true }
uuid = { workspace = true }
tracing = { workspace = true }
aptos-framework-pre-l1-merge-release = { workspace = true }
movement-signer = { workspace = true }
movement-signer-loader = { workspace = true }
hex = { workspace = true }
mtma-types = { workspace = true }
movement-core = { workspace = true }
mtma-environment-types = { workspace = true }
kestrel = { workspace = true }

[lints]
workspace = true
2 changes: 2 additions & 0 deletions environments/core/provisioner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# `mtma-provisioner-environment`
The environment which provides a [Migrator](/README.md#migrator) constructed via a provisioner node.
7 changes: 7 additions & 0 deletions environments/core/provisioner/src/environment.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// Contains the configuration structs and logic for the migration.
pub mod config;
/// Contains the logic for the migration.
pub mod environment;

pub use config::*;
pub use environment::*;
28 changes: 28 additions & 0 deletions environments/core/provisioner/src/environment/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use crate::ProvisionerEnvironment;
use clap::Parser;
use serde::{Deserialize, Serialize};
use std::fmt::Debug;

/// Errors thrown when working with the [Config].
#[derive(Debug, thiserror::Error)]
pub enum EnvironmentConfigError {
#[error("failed to build from config: {0}")]
Build(#[source] Box<dyn std::error::Error + Send + Sync>),
}

/// The config for the [ProvisionerEnvironment].
///
/// All fields should be easily statically encodable to a CLI argument.
/// This is the frontend for the core API.
#[derive(Parser, Debug, Serialize, Deserialize, Clone, Default)]
#[clap(help_expected = true)]
pub struct Config {}

impl Config {
/// Builds the [ProvisionerEnvironment] struct from the config.
///
/// Note: preserving faillibility here because we may add debug path configuration to the [ProvisionerEnvironment] soon.
pub fn build(&self) -> Result<ProvisionerEnvironment, EnvironmentConfigError> {
Ok(ProvisionerEnvironment::new())
}
}
Loading
Loading