Merge branch 'master' into governance

This commit is contained in:
Gav
2018-01-23 20:52:47 +01:00
22 changed files with 105 additions and 60 deletions
@@ -16,7 +16,7 @@
//! Conensus module for runtime; manages the authority set ready for the native code.
use runtime_support::Vec;
use runtime_support::prelude::*;
use storable::StorageVec;
use primitives::SessionKey;
@@ -25,7 +25,7 @@
//! At the end of the era, all validators approvals are tallied and if there are sufficient to pass
//! the proposal then it is enacted. All items in storage concerning the proposal are reset.
use runtime_support::Vec;
use runtime_support::prelude::*;
use keyedvec::KeyedVec;
use storable::{Storable, StorageVec, kill};
use primitives::{AccountID, Hash, BlockNumber};
@@ -17,7 +17,7 @@
//! Session manager: is told the validators and allows them to manage their session keys for the
//! consensus module.
use runtime_support::Vec;
use runtime_support::prelude::*;
use keyedvec::KeyedVec;
use storable::{kill, Storable, StorageVec};
use primitives::{AccountID, SessionKey, BlockNumber};
@@ -16,7 +16,8 @@
//! Staking manager: Handles balances and periodically determines the best set of validators.
use runtime_support::{Vec, RefCell};
use runtime_support::prelude::*;
use runtime_support::cell::RefCell;
use keyedvec::KeyedVec;
use storable::{Storable, StorageVec};
use primitives::{BlockNumber, AccountID};
@@ -18,7 +18,8 @@
//! and depositing logs.
use primitives::{Block, BlockNumber, Hash, UncheckedTransaction, TxOrder, Hashable};
use runtime_support::{Vec, swap};
use runtime_support::mem;
use runtime_support::prelude::*;
use storable::Storable;
use keyedvec::KeyedVec;
use environment::with_env;
@@ -47,7 +48,7 @@ pub fn execute_block(mut block: Block) {
// populate environment from header.
with_env(|e| {
e.block_number = block.header.number;
swap(&mut e.digest, &mut block.header.digest);
mem::swap(&mut e.digest, &mut block.header.digest);
e.next_log_index = 0;
});