Skip to content

Commit

Permalink
feat(eth): Move EVM common impl to tw_evm crate
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshiotomakan committed Jul 21, 2023
1 parent 406c220 commit 9384825
Show file tree
Hide file tree
Showing 36 changed files with 638 additions and 600 deletions.
12 changes: 12 additions & 0 deletions rust/Cargo.lock

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

1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"tw_coin_registry",
"tw_encoding",
"tw_ethereum",
"tw_evm",
"tw_hash",
"tw_keypair",
"tw_memory",
Expand Down
11 changes: 3 additions & 8 deletions rust/tw_ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@ version = "0.1.0"
edition = "2021"

[dependencies]
ethabi = "18.0.0"
lazy_static = "1.4.0"
rlp = "0.5.2"
serde = { version = "1.0.159", features = ["derive"] }
serde_json = "1.0.95"
tw_coin_entry = { path = "../tw_coin_entry" }
tw_encoding = { path = "../tw_encoding" }
tw_hash = { path = "../tw_hash" }
tw_evm = { path = "../tw_evm" }
tw_keypair = { path = "../tw_keypair" }
tw_proto = { path = "../tw_proto" }
tw_number = { path = "../tw_number" }

[dev-dependencies]
tw_coin_entry = { path = "../tw_coin_entry", features = ["test-utils"] }
tw_encoding = { path = "../tw_encoding" }
tw_number = { path = "../tw_number", features = ["helpers"] }
10 changes: 5 additions & 5 deletions rust/tw_ethereum/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

use crate::address::Address;
use crate::modules::compiler::Compiler;
use crate::modules::input_builder::EthInputBuilder;
use crate::modules::json_signer::EthJsonSigner;
use crate::modules::signer::Signer;
use std::str::FromStr;
use tw_coin_entry::coin_context::CoinContext;
use tw_coin_entry::coin_entry::{CoinEntry, PublicKeyBytes, SignatureBytes};
use tw_coin_entry::derivation::Derivation;
use tw_coin_entry::error::{AddressError, AddressResult};
use tw_coin_entry::modules::plan_builder::NoPlanBuilder;
use tw_coin_entry::prefix::NoPrefix;
use tw_evm::address::Address;
use tw_evm::modules::compiler::Compiler;
use tw_evm::modules::input_builder::EthInputBuilder;
use tw_evm::modules::json_signer::EthJsonSigner;
use tw_evm::modules::signer::Signer;
use tw_keypair::tw::PublicKey;
use tw_proto::Ethereum::Proto;
use tw_proto::TxCompiler::Proto as CompilerProto;
Expand Down
5 changes: 0 additions & 5 deletions rust/tw_ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

pub mod abi;
pub mod address;
pub mod entry;
pub mod modules;
pub mod rlp;
pub mod transaction;
580 changes: 1 addition & 579 deletions rust/tw_ethereum/tests/signer.rs

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions rust/tw_evm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "tw_evm"
version = "0.1.0"
edition = "2021"

[dependencies]
ethabi = "18.0.0"
lazy_static = "1.4.0"
rlp = "0.5.2"
serde = { version = "1.0.159", features = ["derive"] }
serde_json = "1.0.95"
tw_coin_entry = { path = "../tw_coin_entry" }
tw_encoding = { path = "../tw_encoding" }
tw_hash = { path = "../tw_hash" }
tw_keypair = { path = "../tw_keypair" }
tw_proto = { path = "../tw_proto" }
tw_number = { path = "../tw_number" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions rust/tw_evm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright © 2017-2023 Trust Wallet.
//
// This file is part of Trust. The full Trust copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

pub mod abi;
pub mod address;
pub mod modules;
pub mod rlp;
pub mod transaction;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions rust/tw_ethereum/tests/barz.rs → rust/tw_evm/tests/barz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use std::borrow::Cow;
use tw_coin_entry::error::SigningErrorType;
use tw_encoding::hex;
use tw_ethereum::abi::prebuild::erc20::Erc20;
use tw_ethereum::address::Address;
use tw_ethereum::modules::signer::Signer;
use tw_evm::abi::prebuild::erc20::Erc20;
use tw_evm::address::Address;
use tw_evm::modules::signer::Signer;
use tw_number::U256;
use tw_proto::Ethereum::Proto;

Expand Down
585 changes: 585 additions & 0 deletions rust/tw_evm/tests/signer.rs

Large diffs are not rendered by default.

0 comments on commit 9384825

Please sign in to comment.