Make digest compilation work.

This commit is contained in:
Gav
2018-02-04 22:29:58 +01:00
parent b125f72774
commit ba0746fd3c
9 changed files with 33 additions and 33 deletions
+5 -5
View File
@@ -38,7 +38,7 @@ pub mod runtime;
use runtime_std::prelude::*;
use codec::{Slicable, Joiner};
use runtime_std::print;
use primitives::{Block, Header, BlockNumber, UncheckedTransaction};
use primitives::{Block, Header, UncheckedTransaction};
/// Execute a block, with `input` being the canonical serialisation of the block. Returns the
/// empty vector.
@@ -49,10 +49,10 @@ pub fn execute_block(input: &[u8]) -> Vec<u8> {
/// Execute a given, serialised, transaction. Returns the empty vector.
pub fn execute_transaction(input: &[u8]) -> Vec<u8> {
let number = BlockNumber::from_slice(&input[0..8]).unwrap();
let utx = UncheckedTransaction::from_slice(&input[8..]).unwrap();
runtime::system::internal::execute_transaction(&utx, Header::from_block_number(number));
Vec::new()
let header = Header::from_slice(input).unwrap();
let utx = UncheckedTransaction::from_slice(&input[Header::size_of(input).unwrap()..]).unwrap();
let header = runtime::system::internal::execute_transaction(&utx, header);
Vec::new().join(&header)
}
/// Execute a given, serialised, transaction. Returns the empty vector.