mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 09:51:10 +00:00
Migrate srml crates to the 2018 edition (#1755)
This commit is contained in:
committed by
Gav Wood
parent
b28f7328ac
commit
c860787db7
@@ -2,6 +2,7 @@
|
||||
name = "srml-staking"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
hex-literal = "0.1.0"
|
||||
@@ -10,16 +11,18 @@ safe-mix = { version = "1.0", default-features = false}
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
substrate-keyring = { path = "../../core/keyring", optional = true }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
sr-std = { path = "../../core/sr-std", default-features = false }
|
||||
sr-io = { path = "../../core/sr-io", default-features = false }
|
||||
sr-primitives = { path = "../../core/sr-primitives", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
srml-balances = { path = "../balances", default-features = false }
|
||||
srml-consensus = { path = "../consensus", default-features = false }
|
||||
srml-system = { path = "../system", default-features = false }
|
||||
srml-session = { path = "../session", default-features = false }
|
||||
srml-timestamp = { path = "../timestamp", default-features = false }
|
||||
consensus = { package = "srml-consensus", path = "../consensus", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
session = { package = "srml-session", path = "../session", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
|
||||
timestamp = { package = "srml-timestamp", path = "../timestamp", default-features = false }
|
||||
balances = { package = "srml-balances", path = "../balances", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -29,13 +32,9 @@ std = [
|
||||
"substrate-keyring",
|
||||
"parity-codec/std",
|
||||
"parity-codec-derive/std",
|
||||
"substrate-primitives/std",
|
||||
"sr-std/std",
|
||||
"sr-io/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"sr-primitives/std",
|
||||
"srml-balances/std",
|
||||
"srml-session/std",
|
||||
"srml-system/std",
|
||||
"srml-timestamp/std"
|
||||
"primitives/std",
|
||||
"session/std",
|
||||
"system/std",
|
||||
]
|
||||
|
||||
@@ -20,36 +20,12 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
extern crate serde;
|
||||
|
||||
#[macro_use]
|
||||
extern crate srml_support as runtime_support;
|
||||
|
||||
extern crate sr_std as rstd;
|
||||
|
||||
#[macro_use]
|
||||
extern crate parity_codec_derive;
|
||||
|
||||
extern crate parity_codec as codec;
|
||||
extern crate sr_primitives as primitives;
|
||||
extern crate srml_consensus as consensus;
|
||||
extern crate srml_session as session;
|
||||
extern crate srml_system as system;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate substrate_primitives;
|
||||
#[cfg(test)]
|
||||
extern crate sr_io as runtime_io;
|
||||
#[cfg(test)]
|
||||
extern crate srml_timestamp as timestamp;
|
||||
#[cfg(test)]
|
||||
extern crate srml_balances as balances;
|
||||
|
||||
use rstd::{prelude::*, cmp};
|
||||
use codec::HasCompact;
|
||||
use runtime_support::{Parameter, StorageValue, StorageMap, dispatch::Result};
|
||||
use runtime_support::traits::{Currency, OnDilution, EnsureAccountLiquid, OnFreeBalanceZero};
|
||||
use parity_codec::HasCompact;
|
||||
use parity_codec_derive::{Encode, Decode};
|
||||
use srml_support::{Parameter, StorageValue, StorageMap, dispatch::Result};
|
||||
use srml_support::{decl_module, decl_event, decl_storage, ensure};
|
||||
use srml_support::traits::{Currency, OnDilution, EnsureAccountLiquid, OnFreeBalanceZero};
|
||||
use session::OnSessionChange;
|
||||
use primitives::Perbill;
|
||||
use primitives::traits::{Zero, One, Bounded, As, StaticLookup};
|
||||
|
||||
@@ -22,7 +22,8 @@ use primitives::{traits::IdentityLookup, BuildStorage, Perbill};
|
||||
use primitives::testing::{Digest, DigestItem, Header, UintAuthorityId, ConvertUintAuthorityId};
|
||||
use substrate_primitives::{H256, Blake2Hasher};
|
||||
use runtime_io;
|
||||
use {GenesisConfig, Module, Trait, consensus, session, system, timestamp, balances};
|
||||
use srml_support::impl_outer_origin;
|
||||
use crate::{GenesisConfig, Module, Trait};
|
||||
|
||||
impl_outer_origin!{
|
||||
pub enum Origin for Test {}
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
|
||||
use super::*;
|
||||
use runtime_io::with_externalities;
|
||||
use srml_support::{assert_ok, assert_noop};
|
||||
use mock::{Balances, Session, Staking, System, Timestamp, Test, new_test_ext, Origin};
|
||||
use runtime_support::traits::Currency;
|
||||
use srml_support::traits::Currency;
|
||||
|
||||
#[test]
|
||||
fn note_null_offline_should_work() {
|
||||
|
||||
Reference in New Issue
Block a user