Fix everything.

This commit is contained in:
Gav
2018-01-27 13:32:30 +01:00
parent a9c864e098
commit ace1387076
10 changed files with 154 additions and 55 deletions
+1 -4
View File
@@ -47,12 +47,9 @@ 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> {
if input.len() == 0 {
panic!("no transaction data given!");
}
let utx = UncheckedTransaction::from_slice(input).unwrap();
runtime::system::execute_transaction(&utx);
input.to_vec()//Vec::new()
Vec::new()
}
impl_stubs!(execute_block, execute_transaction);
@@ -20,6 +20,7 @@
use primitives::{Block, BlockNumber, Hash, UncheckedTransaction, TxOrder, Hashable};
use runtime_support::mem;
use runtime_support::prelude::*;
use runtime_support::print;
use storable::Storable;
use keyedvec::KeyedVec;
use environment::with_env;
@@ -84,6 +85,7 @@ pub fn execute_block(mut block: Block) {
/// Execute a given transaction.
pub fn execute_transaction(utx: &UncheckedTransaction) {
print(&b"HERE"[..]);
// Verify the signature is good.
assert!(utx.ed25519_verify(), "All transactions should be properly signed");