mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 13:21: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,36 +2,34 @@
|
||||
name = "srml-timestamp"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
hex-literal = "0.1.0"
|
||||
serde = { version = "1.0", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
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 }
|
||||
substrate-inherents = { path = "../../core/inherents", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../core/sr-std", default-features = false }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives", default-features = false }
|
||||
inherents = { package = "substrate-inherents", path = "../../core/inherents", default-features = false }
|
||||
srml-support = { path = "../support", default-features = false }
|
||||
srml-system = { path = "../system", default-features = false }
|
||||
srml-consensus = { path = "../consensus", default-features = false }
|
||||
system = { package = "srml-system", path = "../system", default-features = false }
|
||||
consensus = { package = "srml-consensus", path = "../consensus", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
sr-io = { path = "../../core/sr-io", default-features = true }
|
||||
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = true }
|
||||
substrate-primitives = { path = "../../core/primitives", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"sr-std/std",
|
||||
"sr-io/std",
|
||||
"rstd/std",
|
||||
"srml-support/std",
|
||||
"sr-primitives/std",
|
||||
"srml-consensus/std",
|
||||
"runtime_primitives/std",
|
||||
"consensus/std",
|
||||
"serde/std",
|
||||
"parity-codec/std",
|
||||
"parity-codec-derive/std",
|
||||
"substrate-primitives/std",
|
||||
"srml-system/std",
|
||||
"substrate-inherents/std",
|
||||
"system/std",
|
||||
"inherents/std",
|
||||
]
|
||||
|
||||
@@ -32,28 +32,14 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
extern crate sr_std as rstd;
|
||||
|
||||
#[macro_use]
|
||||
extern crate srml_support as runtime_support;
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate substrate_primitives;
|
||||
#[cfg(test)]
|
||||
extern crate sr_io as runtime_io;
|
||||
extern crate sr_primitives as runtime_primitives;
|
||||
extern crate srml_system as system;
|
||||
extern crate srml_consensus as consensus;
|
||||
extern crate parity_codec as codec;
|
||||
#[macro_use]
|
||||
extern crate parity_codec_derive;
|
||||
extern crate substrate_inherents as inherents;
|
||||
|
||||
use runtime_support::{StorageValue, Parameter};
|
||||
#[cfg(feature = "std")]
|
||||
use parity_codec_derive::Decode;
|
||||
use parity_codec_derive::Encode;
|
||||
use srml_support::{StorageValue, Parameter, decl_storage, decl_module};
|
||||
use srml_support::for_each_tuple;
|
||||
use runtime_primitives::traits::{As, SimpleArithmetic, Zero};
|
||||
use system::ensure_inherent;
|
||||
use rstd::{result, ops::{Mul, Div}, cmp};
|
||||
use runtime_support::for_each_tuple;
|
||||
use inherents::{RuntimeString, InherentIdentifier, ProvideInherent, IsFatalError, InherentData};
|
||||
#[cfg(feature = "std")]
|
||||
use inherents::ProvideInherentData;
|
||||
@@ -88,7 +74,7 @@ impl InherentError {
|
||||
#[cfg(feature = "std")]
|
||||
pub fn try_from(id: &InherentIdentifier, data: &[u8]) -> Option<Self> {
|
||||
if id == &INHERENT_IDENTIFIER {
|
||||
<InherentError as codec::Decode>::decode(&mut &data[..])
|
||||
<InherentError as parity_codec::Decode>::decode(&mut &data[..])
|
||||
} else {
|
||||
None
|
||||
}
|
||||
@@ -268,6 +254,7 @@ impl<T: Trait> ProvideInherent for Module<T> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
use srml_support::{impl_outer_origin, assert_ok};
|
||||
use runtime_io::{with_externalities, TestExternalities};
|
||||
use substrate_primitives::H256;
|
||||
use runtime_primitives::BuildStorage;
|
||||
|
||||
Reference in New Issue
Block a user