mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
Migrate smrl-treasury and srml-upgrade-key to the 2018 edition (#1725)
This commit is contained in:
committed by
Gav Wood
parent
810c391de2
commit
ca69ad4c30
@@ -21,7 +21,7 @@ use {balances, system};
|
||||
use rstd::cell::RefCell;
|
||||
use rstd::collections::btree_map::{BTreeMap, Entry};
|
||||
use rstd::prelude::*;
|
||||
use runtime_support::{StorageMap, StorageDoubleMap, traits::UpdateBalanceOutcome};
|
||||
use srml_support::{StorageMap, StorageDoubleMap, traits::UpdateBalanceOutcome};
|
||||
|
||||
pub struct ChangeEntry<T: Trait> {
|
||||
balance: Option<T::Balance>,
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::gas::{GasMeter, Token, approx_gas_for_balance};
|
||||
use rstd::prelude::*;
|
||||
use runtime_primitives::traits::{CheckedAdd, CheckedSub, Zero};
|
||||
use timestamp;
|
||||
use runtime_support::traits::EnsureAccountLiquid;
|
||||
use srml_support::traits::EnsureAccountLiquid;
|
||||
|
||||
pub type BalanceOf<T> = <T as balances::Trait>::Balance;
|
||||
pub type AccountIdOf<T> = <T as system::Trait>::AccountId;
|
||||
|
||||
@@ -18,7 +18,7 @@ use crate::{GasSpent, Module, Trait};
|
||||
use balances;
|
||||
use runtime_primitives::BLOCK_FULL;
|
||||
use runtime_primitives::traits::{As, CheckedMul, CheckedSub, Zero};
|
||||
use runtime_support::StorageValue;
|
||||
use srml_support::StorageValue;
|
||||
|
||||
#[cfg(test)]
|
||||
use std::{any::Any, fmt::Debug};
|
||||
|
||||
@@ -52,14 +52,6 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
// We need these `extern crate` to be placed here otherwise there will be errors.
|
||||
// TODO: https://github.com/paritytech/substrate/issues/1509
|
||||
#[macro_use]
|
||||
extern crate parity_codec_derive;
|
||||
extern crate parity_codec as codec;
|
||||
#[macro_use]
|
||||
extern crate srml_support as runtime_support;
|
||||
|
||||
#[macro_use]
|
||||
mod gas;
|
||||
|
||||
@@ -73,13 +65,16 @@ mod tests;
|
||||
use crate::exec::ExecutionContext;
|
||||
use crate::account_db::AccountDb;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde_derive::{Serialize, Deserialize};
|
||||
use rstd::prelude::*;
|
||||
use rstd::marker::PhantomData;
|
||||
use codec::Codec;
|
||||
use parity_codec::Codec;
|
||||
use parity_codec_derive::{Encode, Decode};
|
||||
use runtime_primitives::traits::{Hash, As, SimpleArithmetic,Bounded, StaticLookup};
|
||||
use runtime_support::dispatch::{Result, Dispatchable};
|
||||
use runtime_support::{Parameter, StorageMap, StorageValue, StorageDoubleMap};
|
||||
use runtime_support::traits::OnFreeBalanceZero;
|
||||
use srml_support::dispatch::{Result, Dispatchable};
|
||||
use srml_support::{Parameter, StorageMap, StorageValue, StorageDoubleMap, decl_module, decl_event, decl_storage};
|
||||
use srml_support::traits::OnFreeBalanceZero;
|
||||
use system::{ensure_signed, RawOrigin};
|
||||
use runtime_io::{blake2_256, twox_128};
|
||||
use timestamp;
|
||||
@@ -144,7 +139,7 @@ where
|
||||
pub struct DefaultDispatchFeeComputor<T: Trait>(PhantomData<T>);
|
||||
impl<T: Trait> ComputeDispatchFee<T::Call, T::Balance> for DefaultDispatchFeeComputor<T> {
|
||||
fn compute_dispatch_fee(call: &T::Call) -> T::Balance {
|
||||
let encoded_len = codec::Encode::encode(&call).len();
|
||||
let encoded_len = parity_codec::Encode::encode(&call).len();
|
||||
let base_fee = <balances::Module<T>>::transaction_base_fee();
|
||||
let byte_fee = <balances::Module<T>>::transaction_byte_fee();
|
||||
base_fee + byte_fee * <T::Balance as As<u64>>::sa(encoded_len as u64)
|
||||
|
||||
@@ -24,7 +24,7 @@ use runtime_primitives::testing::{Digest, DigestItem, H256, Header, UintAuthorit
|
||||
use runtime_primitives::traits::{BlakeTwo256, IdentityLookup};
|
||||
use runtime_primitives::BuildStorage;
|
||||
use runtime_io;
|
||||
use runtime_support::{StorageMap, StorageDoubleMap};
|
||||
use srml_support::{StorageMap, StorageDoubleMap, assert_ok, impl_outer_event, impl_outer_dispatch, impl_outer_origin};
|
||||
use substrate_primitives::{Blake2Hasher};
|
||||
use system::{self, Phase, EventRecord};
|
||||
use {wabt, balances, consensus};
|
||||
@@ -40,6 +40,7 @@ mod contract {
|
||||
// needs to give a name for the current crate.
|
||||
// This hack is required for `impl_outer_event!`.
|
||||
pub use super::super::*;
|
||||
use srml_support::impl_outer_event;
|
||||
}
|
||||
impl_outer_event! {
|
||||
pub enum MetaEvent for Test {
|
||||
@@ -347,7 +348,7 @@ const HASH_DISPATCH_CALL: [u8; 32] = hex!("49dfdcaf9c1553be10634467e95b8e71a3bc1
|
||||
fn dispatch_call() {
|
||||
// This test can fail due to the encoding changes. In case it becomes too annoying
|
||||
// let's rewrite so as we use this module controlled call or we serialize it in runtime.
|
||||
let encoded = codec::Encode::encode(&Call::Balances(balances::Call::transfer(CHARLIE, 50)));
|
||||
let encoded = parity_codec::Encode::encode(&Call::Balances(balances::Call::transfer(CHARLIE, 50)));
|
||||
assert_eq!(&encoded[..], &hex!("00000300000000000000C8")[..]);
|
||||
|
||||
let wasm = wabt::wat2wasm(CODE_DISPATCH_CALL).unwrap();
|
||||
|
||||
@@ -30,7 +30,7 @@ use crate::wasm::{prepare, runtime::Env, PrefabWasmModule};
|
||||
use crate::{CodeHash, CodeStorage, PristineCode, Schedule, Trait};
|
||||
use rstd::prelude::*;
|
||||
use runtime_primitives::traits::{As, CheckedMul, Hash, Bounded};
|
||||
use runtime_support::StorageMap;
|
||||
use srml_support::StorageMap;
|
||||
|
||||
/// Gas metering token that used for charging storing code into the code storage.
|
||||
///
|
||||
|
||||
@@ -23,6 +23,7 @@ use crate::exec::{Ext, EmptyOutputBuf, VmExecResult};
|
||||
use crate::gas::GasMeter;
|
||||
|
||||
use rstd::prelude::*;
|
||||
use parity_codec_derive::{Encode, Decode};
|
||||
use sandbox;
|
||||
|
||||
#[macro_use]
|
||||
|
||||
@@ -23,7 +23,7 @@ use sandbox;
|
||||
use system;
|
||||
use rstd::prelude::*;
|
||||
use rstd::mem;
|
||||
use codec::{Decode, Encode};
|
||||
use parity_codec::{Decode, Encode};
|
||||
use runtime_primitives::traits::{As, CheckedMul, Bounded};
|
||||
|
||||
/// Enumerates all possible *special* trap conditions.
|
||||
|
||||
Reference in New Issue
Block a user