Skip to content

Commit

Permalink
Replace vendor ethereum with published ethereum crate and fix warnings (
Browse files Browse the repository at this point in the history
#138)

* Remove ethereum vendor

* Update ethereum dependency and fix most warnings
  • Loading branch information
sorpaas authored Sep 20, 2020
1 parent 9a73627 commit 0cbe438
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 28 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "vendor/ethereum"]
path = vendor/ethereum
url = https://github.com/rust-blockchain/ethereum
6 changes: 4 additions & 2 deletions Cargo.lock

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

5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@ members = [
"template/runtime",
"template/test-utils/client",
]
exclude = ["vendor"]

[patch.crates-io]
ethereum = { path = "vendor/ethereum" }
exclude = ["vendor"]
2 changes: 1 addition & 1 deletion consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ futures = { version = "0.3.1", features = ["compat"] }
sp-timestamp = { version = "2.0.0-rc6", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
derive_more = "0.99.2"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate.git", branch = "frontier"}
ethereum = { version = "0.2", features = ["codec"], path = "../vendor/ethereum/" }
ethereum = { version = "0.3", features = ["codec"] }
2 changes: 1 addition & 1 deletion frame/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sp-runtime = { version = "2.0.0-dev", default-features = false, git = "https://g
sp-std = { version = "2.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-io = { version = "2.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
evm = { version = "0.17.0", default-features = false }
ethereum = { version = "0.2", default-features = false, features = ["codec"], path = "../../vendor/ethereum/" }
ethereum = { version = "0.3", default-features = false, features = ["codec"] }
ethereum-types = { version = "0.9", default-features = false }
rlp = { version = "0.4", default-features = false }
sha3 = { version = "0.8", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", bra
sp-storage = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
ethereum = { version = "0.2", features = ["codec"], path = "../vendor/ethereum/" }
ethereum = { version = "0.3", features = ["codec"] }
codec = { package = "parity-scale-codec", version = "1.0.0" }
rlp = "0.4"
pallet-ethereum = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion rpc/core/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use jsonrpc_core::{BoxFuture, Result};
use jsonrpc_derive::rpc;

use crate::types::{
BlockNumber, Bytes, CallRequest, EthAccount, Filter, FilterChanges, Index, Log, Receipt,
BlockNumber, Bytes, CallRequest, Filter, FilterChanges, Index, Log, Receipt,
RichBlock, SyncStatus, Transaction, Work,
};
pub use rpc_impl_EthApi::gen_server::EthApi as EthApiServer;
Expand Down
2 changes: 1 addition & 1 deletion rpc/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "GPL-3.0"
sp-core = { version = "2.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-api = { version = "2.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
pallet-evm = { version = "2.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
ethereum = { version = "0.2", default-features = false, features = ["codec"], path = "../../vendor/ethereum/" }
ethereum = { version = "0.3", default-features = false, features = ["codec"] }
ethereum-types = { version = "0.9", default-features = false }
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false }
sp-runtime = { version = "2.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
Expand Down
3 changes: 1 addition & 2 deletions rpc/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@

use sp_core::{H160, H256, U256};
use ethereum::{
Log, Block as EthereumBlock, Transaction as EthereumTransaction,
Receipt as EthereumReceipt, TransactionAction
Log, Block as EthereumBlock, TransactionAction
};
use ethereum_types::Bloom;
use codec::{Encode, Decode};
Expand Down
9 changes: 1 addition & 8 deletions rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use sha3::{Keccak256, Digest};
use sp_runtime::traits::BlakeTwo256;
use frontier_rpc_core::{EthApi as EthApiT, NetApi as NetApiT};
use frontier_rpc_core::types::{
BlockNumber, Bytes, CallRequest, EthAccount, Filter, Index, Log, Receipt, RichBlock,
BlockNumber, Bytes, CallRequest, Filter, Index, Log, Receipt, RichBlock,
SyncStatus, SyncInfo, Transaction, Work, Rich, Block, BlockTransactions, VariadicValue
};
use frontier_rpc_primitives::{EthereumRuntimeRPCApi, ConvertTransaction, TransactionStatus};
Expand All @@ -44,13 +44,6 @@ fn internal_err<T: ToString>(message: T) -> Error {
data: None
}
}
fn not_supported_err(message: &str) -> Error {
Error {
code: ErrorCode::InvalidRequest,
message: message.to_string(),
data: None
}
}

pub struct EthApi<B: BlockT, C, SC, P, CT, BE> {
pool: Arc<P>,
Expand Down
2 changes: 1 addition & 1 deletion template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sp-consensus = { version = "0.8.0-dev", git = "https://github.com/paritytech/sub
sc-consensus = { version = "0.8.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-timestamp = { version = "2.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
evm = { version = "2.0.0-dev", package = "pallet-evm", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
ethereum = { version = "0.1.0", package = "pallet-ethereum", path = "../../frame/ethereum" }
ethereum = { version = "0.1.0", package = "pallet-ethereum" }
sc-finality-grandpa = { version = "0.8.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sp-finality-grandpa = { version = "2.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
sc-client-api = { version = "2.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
Expand Down
2 changes: 1 addition & 1 deletion template/node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::{sync::Arc, fmt};

use sc_consensus_manual_seal::rpc::{ManualSeal, ManualSealApi};
use frontier_template_runtime::{Hash, AccountId, Index, opaque::Block, Balance};
use sp_api::{ProvideRuntimeApi, Core};
use sp_api::ProvideRuntimeApi;
use sp_transaction_pool::TransactionPool;
use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend};
use sp_consensus::SelectChain;
Expand Down
1 change: 0 additions & 1 deletion template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ pub use frame_support::{
},
ConsensusEngineId,
};
use frame_ethereum::{Block as EthereumBlock, Transaction as EthereumTransaction, Receipt as EthereumReceipt};
use frame_evm::{Account as EVMAccount, FeeCalculator, HashedAddressMapping, EnsureAddressTruncated};
use frontier_rpc_primitives::{TransactionStatus};
pub type BlockNumber = u32;
Expand Down
1 change: 0 additions & 1 deletion vendor/ethereum
Submodule ethereum deleted from 4fdd3c

0 comments on commit 0cbe438

Please sign in to comment.