Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove feature=deploy #116

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Converts **solidity file** to **binary move** code. You can convert from **abi +
> **! IMPORTANT**\
> To convert from a **sol** file, **solc** must be installed on the computer and accessible from the terminal using the
> short command **solc**.\
> To publish, you need the installed **aptos** utility and **e2m** build with the flag `--features=deploy`

## Install solc

Expand Down
52 changes: 18 additions & 34 deletions cli/e2m/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,32 @@ anyhow.workspace = true
log.workspace = true
tempfile = "3.3"
serde_yaml = "0.9.11"
serde_json.workspace = true
tokio = { version = "1.21", features = ["full"] }
reqwest = { version = "0.11" }
bcs.workspace = true
sha2 = "0.10.5"
hex.workspace = true

#
# EVM
ethabi.workspace = true

# Aptos
aptos.workspace = true
aptos-vm.workspace = true
aptos-types.workspace = true
framework.workspace = true
cached-packages.workspace = true

# Move
move-core-types.workspace = true
move-binary-format.workspace = true

# local
translator = { path = "../../translator" }
test_infra = { path = "../../translator/test_infra" }
eth = { path = "../../translator/eth" }

# FEATURE DEPLOY
# It is necessary to monitor the relevance. At the moment, this particular client is working with devnet
# You need to download a working client from https://github.com/aptos-labs/aptos-core/releases
# test it and find out the commit using "aptos info".

bcs = { workspace = true, optional = true }
sha2 = { version = "0.10.5", optional = true }
hex = { workspace = true, optional = true }
tokio = { version = "1.21", features = ["full"], optional = true }
serde_json = { workspace = true, optional = true }
ethabi = { workspace = true, optional = true }
reqwest = { version = "0.11", optional = true }

aptos = { workspace = true, optional = true }
aptos-vm = { workspace = true, optional = true }
aptos-types = { workspace = true, optional = true }
framework = { workspace = true, optional = true }
cached-packages = { workspace = true, optional = true }
move-binary-format = { workspace = true, optional = true }

[features]
deploy = [
"bcs",
"sha2",
"hex",
"ethabi",
"tokio",
"serde_json",
"reqwest",
"aptos",
"aptos-vm",
"aptos-types",
"framework",
"cached-packages",
"move-binary-format",
]
4 changes: 0 additions & 4 deletions cli/e2m/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use translator::{translate, Target};

use crate::{profile, Cmd};

#[cfg(feature = "deploy")]
mod deploy;
pub mod flags;

Expand Down Expand Up @@ -45,12 +44,10 @@ pub struct CmdConvert {
#[clap(long = "args", short = 'a', default_value = "")]
init_args: String,

#[cfg(feature = "deploy")]
#[clap(flatten)]
pub(crate) transaction_flags: crate::txflags::TransactionFlags,

/// Publishes the modules in a Move package to the Aptos blockchain
#[cfg(feature = "deploy")]
#[clap(long = "deploy", short = 'd', value_parser)]
pub deploy: bool,

Expand All @@ -62,7 +59,6 @@ impl Cmd for CmdConvert {
fn execute(&self) -> Result<String> {
let result = self.convert()?;

#[cfg(feature = "deploy")]
if self.deploy {
return self.publish(&result);
}
Expand Down
11 changes: 0 additions & 11 deletions cli/e2m/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[cfg(feature = "deploy")]
use std::future::Future;

use anyhow::Result;
Expand All @@ -12,11 +11,8 @@ use crate::convert::CmdConvert;
pub mod convert;
pub mod profile;

#[cfg(feature = "deploy")]
pub mod call;
#[cfg(feature = "deploy")]
pub mod resources;
#[cfg(feature = "deploy")]
pub mod txflags;

pub trait Cmd {
Expand All @@ -30,23 +26,17 @@ pub enum Args {
Convert(CmdConvert),

/// Run a Move function
#[cfg(feature = "deploy")]
Call(crate::call::CmdCall),

/// Command to list resources, modules, or other items owned by an address
#[cfg(feature = "deploy")]
Resources(crate::resources::CmdResources),
}

impl Cmd for Args {
fn execute(&self) -> Result<String> {
match self {
Args::Convert(data) => data.execute(),

#[cfg(feature = "deploy")]
Args::Call(data) => data.execute(),

#[cfg(feature = "deploy")]
Args::Resources(data) => data.execute(),
}
}
Expand All @@ -65,7 +55,6 @@ fn main() {
}
}

#[cfg(feature = "deploy")]
pub fn wait<F: Future>(future: F) -> F::Output {
tokio::runtime::Builder::new_current_thread()
.enable_all()
Expand Down
1 change: 0 additions & 1 deletion cli/e2m/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ impl ProfileValue {
Ok(address)
}

#[cfg(feature = "deploy")]
pub fn name_profile(&self) -> Result<&String> {
match self {
ProfileValue::Address(..) => {
Expand Down