diff --git a/Cargo.lock b/Cargo.lock index 3478d32ce..54097bb09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2174,6 +2174,7 @@ dependencies = [ name = "node-executor" version = "2.0.0" dependencies = [ + "evo-staking 0.1.0", "node-primitives 2.0.0", "node-runtime 0.1.0", "parity-codec 3.5.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2184,7 +2185,6 @@ dependencies = [ "srml-grandpa 2.0.0 (git+https://github.com/paritytech/substrate.git)", "srml-indices 2.0.0 (git+https://github.com/paritytech/substrate.git)", "srml-session 2.0.0 (git+https://github.com/paritytech/substrate.git)", - "srml-staking 2.0.0 (git+https://github.com/paritytech/substrate.git)", "srml-support 2.0.0 (git+https://github.com/paritytech/substrate.git)", "srml-system 2.0.0 (git+https://github.com/paritytech/substrate.git)", "srml-timestamp 2.0.0 (git+https://github.com/paritytech/substrate.git)", diff --git a/node/executor/Cargo.toml b/node/executor/Cargo.toml index 94b4b1b78..d730b585d 100644 --- a/node/executor/Cargo.toml +++ b/node/executor/Cargo.toml @@ -23,7 +23,7 @@ runtime_primitives = { package = "sr-primitives", git = 'https://github.com/pari runtime_support = { package = "srml-support", git = 'https://github.com/paritytech/substrate.git' } balances = { package = "srml-balances",git = 'https://github.com/paritytech/substrate.git' } session = { package = "srml-session", git = 'https://github.com/paritytech/substrate.git' } -staking = { package = "srml-staking", git = 'https://github.com/paritytech/substrate.git' } +staking = { package = "evo-staking", path = '../../srml/staking' } system = { package = "srml-system", git = 'https://github.com/paritytech/substrate.git' } timestamp = { package = "srml-timestamp", git = 'https://github.com/paritytech/substrate.git' } treasury = { package = "srml-treasury", git = 'https://github.com/paritytech/substrate.git' } diff --git a/node/executor/src/lib.rs b/node/executor/src/lib.rs index 5f8408574..238e19d58 100644 --- a/node/executor/src/lib.rs +++ b/node/executor/src/lib.rs @@ -23,6 +23,7 @@ pub use substrate_executor::NativeExecutor; use substrate_executor::native_executor_instance; +pub use node_runtime::{SessionsPerEra, BondingDuration, ErasPerEpoch, CAP}; // Declare an instance of the native executor named `Executor`. Include the wasm binary as the // equivalent wasm code. @@ -54,7 +55,7 @@ mod tests { use system::{EventRecord, Phase}; use node_runtime::{Header, Block, UncheckedExtrinsic, CheckedExtrinsic, Call, Runtime, Balances, BuildStorage, GenesisConfig, BalancesConfig, SessionConfig, StakingConfig, System, - SystemConfig, GrandpaConfig, IndicesConfig, Event, SessionKeys}; + SystemConfig, GrandpaConfig, IndicesConfig, KtonConfig, Event, SessionKeys}; use wabt; use primitives::map; @@ -361,6 +362,18 @@ mod tests { creation_fee: 0, vesting: vec![], }), + kton: Some(KtonConfig { + balances: vec![ + (alice(), 111), + (bob(), 100), + (charlie(), 100_000_000), + (dave(), 111), + (eve(), 101), + (ferdie(), 100), + ], + vesting: vec![], + sys_acc: ferdie(), + }), session: Some(SessionConfig { validators: vec![AccountKeyring::One.into(), AccountKeyring::Two.into(), three], keys: vec![ @@ -371,6 +384,8 @@ mod tests { }), staking: Some(StakingConfig { current_era: 0, + current_era_total_reward: 1, + epoch_index: 0, stakers: vec![ (dave(), alice(), 111, staking::StakerStatus::Validator), (eve(), bob(), 100, staking::StakerStatus::Validator), @@ -384,10 +399,7 @@ mod tests { offline_slash_grace: 0, invulnerables: vec![alice(), bob(), charlie()], }), - democracy: Some(Default::default()), - council_seats: Some(Default::default()), timestamp: Some(Default::default()), - treasury: Some(Default::default()), contracts: Some(Default::default()), sudo: Some(Default::default()), grandpa: Some(GrandpaConfig { @@ -582,21 +594,6 @@ mod tests { event: Event::system(system::Event::ExtrinsicSuccess), topics: vec![], }, - EventRecord { - phase: Phase::Finalization, - event: Event::treasury(treasury::RawEvent::Spending(0)), - topics: vec![], - }, - EventRecord { - phase: Phase::Finalization, - event: Event::treasury(treasury::RawEvent::Burnt(0)), - topics: vec![], - }, - EventRecord { - phase: Phase::Finalization, - event: Event::treasury(treasury::RawEvent::Rollover(0)), - topics: vec![], - }, ]); }); @@ -654,21 +651,6 @@ mod tests { event: Event::system(system::Event::ExtrinsicSuccess), topics: vec![], }, - EventRecord { - phase: Phase::Finalization, - event: Event::treasury(treasury::RawEvent::Spending(0)), - topics: vec![], - }, - EventRecord { - phase: Phase::Finalization, - event: Event::treasury(treasury::RawEvent::Burnt(0)), - topics: vec![], - }, - EventRecord { - phase: Phase::Finalization, - event: Event::treasury(treasury::RawEvent::Rollover(0)), - topics: vec![], - }, ]); }); } diff --git a/srml/token/kton/src/lib.rs b/srml/token/kton/src/lib.rs index b1d1a7571..d7010e00d 100644 --- a/srml/token/kton/src/lib.rs +++ b/srml/token/kton/src/lib.rs @@ -115,7 +115,7 @@ decl_event!( decl_storage! { - trait Store for Module as KtonBalances { + trait Store for Module as Kton { pub DepositLedger get(deposit_ledger): map T::AccountId => Option, T::Moment>>; diff --git a/srml/token/ring/src/mock.rs b/srml/token/ring/src/mock.rs index ac5208ab9..50271a6b3 100644 --- a/srml/token/ring/src/mock.rs +++ b/srml/token/ring/src/mock.rs @@ -43,6 +43,12 @@ impl system::Trait for Runtime { type Header = Header; type Event = (); } + +impl timestamp::Trait for Runtime { + type Moment = u64; + type OnTimestampSet = (); +} + impl Trait for Runtime { type Balance = u64; type OnFreeBalanceZero = (); @@ -129,4 +135,5 @@ impl ExtBuilder { } pub type System = system::Module; +pub type Timestamp = timestamp::Module; pub type Balances = Module; diff --git a/srml/try/src/lib.rs b/srml/try/src/lib.rs index c24a8aec8..c271c1563 100644 --- a/srml/try/src/lib.rs +++ b/srml/try/src/lib.rs @@ -70,7 +70,7 @@ decl_module! { list.push(value); >::insert(1, list); } else { - list.remove(value); + list.remove(value as usize); } } diff --git a/srml/try/src/tests.rs b/srml/try/src/tests.rs index d6ea01a72..b4bb311de 100644 --- a/srml/try/src/tests.rs +++ b/srml/try/src/tests.rs @@ -96,9 +96,9 @@ fn check_default_value() { #[test] fn check_delete() { with_externalities(&mut new_test_ext(), || { - Try::update_list(1); + Try::update_list(1, true); assert_eq!(Try::list(1), vec![1]); - Try::update_list(2); + Try::update_list(2, true); assert_eq!(Try::list(1), vec![1, 2]); }); } \ No newline at end of file