[big refactor] Remove crate aliasing. (#4395)

* Rename: Phase 1.

* Unify codec.

* Fixing: Phase 2

* Fixing: Phase 3.

* Fixing: Phase 4.

* Fixing: Phase 5.

* Fixing: Phase 6.

* Fixing: Phase 7.

* Fixing: Phase 8. Tests

* Fixing: Phase 9. Tests!!!

* Fixing: Phase 10. Moar tests!

* Finally done!

* More fixes.

* Rename primitives:: to sp_core::

* Apply renames in finality-grandpa.

* Fix benches.

* Fix benches 2.

* Revert node-template.

* Fix frame-system in our modules.
This commit is contained in:
Tomasz Drwięga
2019-12-16 13:36:49 +01:00
committed by Gavin Wood
parent f14d98a439
commit 8778ca7dc8
485 changed files with 4023 additions and 4005 deletions
+5 -5
View File
@@ -3,9 +3,9 @@ use sp_std::vec::Vec;
#[cfg(feature = "std")]
use serde::{Serialize, Deserialize};
use codec::{Encode, Decode};
use primitives::{U256, H256, H160};
use sp_core::{U256, H256, H160};
use sp_runtime::traits::UniqueSaturatedInto;
use support::storage::{StorageMap, StorageDoubleMap};
use frame_support::storage::{StorageMap, StorageDoubleMap};
use sha3::{Keccak256, Digest};
use evm::Config;
use evm::backend::{Backend as BackendT, ApplyBackend, Apply};
@@ -69,12 +69,12 @@ impl<'vicinity, T: Trait> BackendT for Backend<'vicinity, T> {
H256::default()
} else {
let number = T::BlockNumber::from(number.as_u32());
H256::from_slice(system::Module::<T>::block_hash(number).as_ref())
H256::from_slice(frame_system::Module::<T>::block_hash(number).as_ref())
}
}
fn block_number(&self) -> U256 {
let number: u128 = system::Module::<T>::block_number().unique_saturated_into();
let number: u128 = frame_system::Module::<T>::block_number().unique_saturated_into();
U256::from(number)
}
@@ -83,7 +83,7 @@ impl<'vicinity, T: Trait> BackendT for Backend<'vicinity, T> {
}
fn block_timestamp(&self) -> U256 {
let now: u128 = timestamp::Module::<T>::get().unique_saturated_into();
let now: u128 = pallet_timestamp::Module::<T>::get().unique_saturated_into();
U256::from(now)
}
+9 -9
View File
@@ -24,14 +24,14 @@ mod backend;
pub use crate::backend::{Account, Log, Vicinity, Backend};
use sp_std::{vec::Vec, marker::PhantomData};
use support::{dispatch, decl_module, decl_storage, decl_event};
use support::weights::{Weight, WeighData, ClassifyDispatch, DispatchClass, PaysFee};
use support::traits::{Currency, WithdrawReason, ExistenceRequirement};
use system::ensure_signed;
use frame_support::{dispatch, decl_module, decl_storage, decl_event};
use frame_support::weights::{Weight, WeighData, ClassifyDispatch, DispatchClass, PaysFee};
use frame_support::traits::{Currency, WithdrawReason, ExistenceRequirement};
use frame_system::{self as system, ensure_signed};
use sp_runtime::ModuleId;
use support::weights::SimpleDispatchInfo;
use frame_support::weights::SimpleDispatchInfo;
use sp_runtime::traits::{UniqueSaturatedInto, AccountIdConversion, SaturatedConversion};
use primitives::{U256, H256, H160};
use sp_core::{U256, H256, H160};
use evm::{ExitReason, ExitSucceed, ExitError};
use evm::executor::StackExecutor;
use evm::backend::ApplyBackend;
@@ -39,7 +39,7 @@ use evm::backend::ApplyBackend;
const MODULE_ID: ModuleId = ModuleId(*b"py/ethvm");
/// Type alias for currency balance.
pub type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
pub type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
/// Trait that outputs the current transaction gas price.
pub trait FeeCalculator {
@@ -116,7 +116,7 @@ impl<F: FeeCalculator> PaysFee for WeightForCallCreate<F> {
}
/// EVM module trait
pub trait Trait: system::Trait + timestamp::Trait {
pub trait Trait: frame_system::Trait + pallet_timestamp::Trait {
/// Calculator for current gas price.
type FeeCalculator: FeeCalculator;
/// Convert account ID to H160;
@@ -124,7 +124,7 @@ pub trait Trait: system::Trait + timestamp::Trait {
/// Currency type for deposit and withdraw.
type Currency: Currency<Self::AccountId>;
/// The overarching event type.
type Event: From<Event> + Into<<Self as system::Trait>::Event>;
type Event: From<Event> + Into<<Self as frame_system::Trait>::Event>;
/// Precompiles associated with this EVM engine.
type Precompiles: Precompiles;
}