This commit is contained in:
Gav
2018-01-19 10:49:23 +01:00
parent 81cd156d2a
commit 63809d9e0c
11 changed files with 87 additions and 87 deletions
@@ -1,6 +1,6 @@
use primitives::{Block, BlockNumber, Hash, UncheckedTransaction, TxOrder, Hashable};
use runtime_support::{Vec, swap};
use storage::Storage;
use storable::Storable;
use keyedvec::KeyedVec;
use environment::with_env;
use runtime::session;
@@ -12,7 +12,7 @@ pub fn block_number() -> BlockNumber {
/// Get the block hash of a given block (uses storage).
pub fn block_hash(number: BlockNumber) -> Hash {
Storage::into(&number.to_keyed_vec(b"sys\0old\0"))
Storable::lookup_default(&number.to_keyed_vec(b"sys\0old\0"))
}
/// Deposits a log and ensures it matches the blocks log data.
@@ -69,7 +69,7 @@ pub fn execute_transaction(utx: &UncheckedTransaction) {
// check nonce
let nonce_key = tx.signed.to_keyed_vec(b"sys\0non\0");
let expected_nonce: TxOrder = Storage::into(&nonce_key);
let expected_nonce: TxOrder = Storable::lookup_default(&nonce_key);
assert!(tx.nonce == expected_nonce, "All transactions should have the correct nonce");
// increment nonce in storage