Skip to content

Commit

Permalink
some trivials
Browse files Browse the repository at this point in the history
  • Loading branch information
koushiro committed Jun 27, 2023
1 parent b51ca39 commit 049b56e
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 41 deletions.
10 changes: 2 additions & 8 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ethereum = { workspace = true, features = ["with-codec"] }
ethereum-types = { workspace = true }
evm = { workspace = true }
futures = { workspace = true }
hex = "0.4.3"
hex = { workspace = true }
jsonrpsee = { workspace = true, features = ["server", "macros"] }
libsecp256k1 = { workspace = true }
log = "0.4.17"
Expand Down
3 changes: 2 additions & 1 deletion client/rpc/src/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ use sp_blockchain::HeaderBackend;
use sp_core::hashing::keccak_256;
use sp_runtime::traits::Block as BlockT;
// Frontier
use crate::{internal_err, public_key};
use fc_rpc_core::{
types::{Get, Summary, TransactionMap, TxPoolResult, TxPoolTransaction},
TxPoolApiServer,
};
use fp_rpc::{EthereumRuntimeRPCApi, TxPoolResponse};

use crate::{internal_err, public_key};

pub struct TxPool<A: ChainApi, B, C> {
client: Arc<C>,
graph: Arc<Pool<A>>,
Expand Down
2 changes: 1 addition & 1 deletion frame/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fp-storage = { workspace = true }
pallet-evm = { workspace = true }

[dev-dependencies]
hex = "0.4.3"
hex = { workspace = true }
libsecp256k1 = { workspace = true, features = ["static-context", "hmac"] }
rlp = { workspace = true }
# Substrate
Expand Down
4 changes: 2 additions & 2 deletions frame/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
environmental = { workspace = true, optional = true }
evm = { workspace = true, features = ["with-codec"] }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
hex-literal = { version = "0.3.4" }
hex = { workspace = true }
hex-literal = { workspace = true }
impl-trait-for-tuples = "0.2.2"
log = { workspace = true }
rlp = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/precompile/modexp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ num = { version = "0.4", default-features = false, features = ["alloc"] }
fp-evm = { workspace = true }

[dev-dependencies]
hex = "0.4.3"
hex = { workspace = true }
# Frontier
pallet-evm-test-vector-support = { workspace = true }

Expand Down
13 changes: 7 additions & 6 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ pub mod runner;
mod tests;
pub mod weights;

pub use evm::{
Config as EvmConfig, Context, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed,
};
use impl_trait_for_tuples::impl_for_tuples;
use scale_info::TypeInfo;
// Substrate
use frame_support::{
dispatch::{DispatchResultWithPostInfo, MaxEncodedLen, Pays, PostDispatchInfo},
traits::{
Expand All @@ -79,18 +85,13 @@ use frame_support::{
weights::Weight,
};
use frame_system::RawOrigin;
use impl_trait_for_tuples::impl_for_tuples;
use scale_info::TypeInfo;
use sp_core::{Decode, Encode, Hasher, H160, H256, U256};
use sp_runtime::{
traits::{BadOrigin, Saturating, UniqueSaturatedInto, Zero},
AccountId32, DispatchErrorWithPostInfo,
};
use sp_std::{cmp::min, vec::Vec};

pub use evm::{
Config as EvmConfig, Context, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed,
};
// Frontier
use fp_account::AccountId20;
#[cfg(feature = "std")]
use fp_evm::GenesisAccount;
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/test-vector-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = { workspace = true }

[dependencies]
evm = { workspace = true, features = ["with-codec"] }
hex = "0.4.3"
hex = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
# Substrate
Expand Down
2 changes: 1 addition & 1 deletion primitives/account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = { workspace = true }
repository = { workspace = true }

[dependencies]
hex = { version = "0.4.3", default-features = false }
hex = { workspace = true }
impl-serde = { workspace = true, optional = true }
libsecp256k1 = { workspace = true }
log = { workspace = true }
Expand Down
16 changes: 2 additions & 14 deletions primitives/account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,8 @@ impl EthereumSignature {
}
}

#[derive(
PartialEq,
Eq,
PartialOrd,
Ord,
Clone,
Copy,
Encode,
Decode,
PassByInner,
MaxEncodedLen,
RuntimeDebug,
TypeInfo
)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
#[derive(RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo, PassByInner)]
pub struct EthereumSigner([u8; 20]);

impl From<[u8; 20]> for EthereumSigner {
Expand Down
2 changes: 1 addition & 1 deletion primitives/dynamic-fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = { workspace = true }
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
async-trait = { version = "0.1", optional = true }
async-trait = { workspace = true, optional = true }
# Substrate
sp-core = { workspace = true }
sp-inherents = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion primitives/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub const BASE_FEE_PER_GAS: &[u8] = b"BaseFeePerGas";
pub const BASE_FEE_ELASTICITY: &[u8] = b"Elasticity";

/// The schema version for Pallet Ethereum's storage
#[derive(Clone, Copy, Debug, Encode, Decode, PartialEq, Eq, PartialOrd, Ord)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Encode, Decode)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
pub enum EthereumStorageSchema {
Undefined,
Expand Down
8 changes: 5 additions & 3 deletions template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
use sp_state_machine::BasicExternalities;
// Frontier
use frontier_template_runtime::{
AccountId, EnableManualSeal, GenesisConfig, SS58Prefix, Signature, WASM_BINARY,
AccountId, Balance, EnableManualSeal, GenesisConfig, SS58Prefix, Signature, WASM_BINARY,
};

// The URL for the telemetry server.
Expand Down Expand Up @@ -77,6 +77,8 @@ fn properties() -> Properties {
properties
}

const UNITS: Balance = 1_000_000_000_000_000_000;

pub fn development_config(enable_manual_seal: Option<bool>) -> DevChainSpec {
let wasm_binary = WASM_BINARY.expect("WASM not available");

Expand Down Expand Up @@ -161,6 +163,7 @@ pub fn local_testnet_config() -> ChainSpec {
None,
// Protocol ID
None,
// Fork ID
None,
// Properties
None,
Expand Down Expand Up @@ -195,11 +198,10 @@ fn testnet_genesis(

// Monetary
balances: BalancesConfig {
// Configure endowed accounts with initial balance of 1 << 60.
balances: endowed_accounts
.iter()
.cloned()
.map(|k| (k, 1 << 60))
.map(|k| (k, 1_000_000 * UNITS))
.collect(),
},
transaction_payment: Default::default(),
Expand Down

0 comments on commit 049b56e

Please sign in to comment.