mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 21:41:02 +00:00
Test multiple blocks/txs per block.
Better debug tracing.
This commit is contained in:
@@ -37,6 +37,7 @@ pub mod runtime;
|
||||
|
||||
use runtime_std::prelude::*;
|
||||
use codec::Slicable;
|
||||
use runtime_std::print;
|
||||
use primitives::{Block, UncheckedTransaction};
|
||||
|
||||
/// Execute a block, with `input` being the canonical serialisation of the block. Returns the
|
||||
@@ -53,4 +54,14 @@ pub fn execute_transaction(input: &[u8]) -> Vec<u8> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
impl_stubs!(execute_block, execute_transaction);
|
||||
/// Run whatever tests we have.
|
||||
pub fn run_tests(input: &[u8]) -> Vec<u8> {
|
||||
print("run_tests...");
|
||||
let block = Block::from_slice(input).unwrap();
|
||||
print("deserialised block.");
|
||||
let stxs = block.transactions.iter().map(Slicable::to_vec).collect::<Vec<_>>();
|
||||
print("reserialised transactions.");
|
||||
[stxs.len() as u8].to_vec()
|
||||
}
|
||||
|
||||
impl_stubs!(execute_block, execute_transaction, run_tests);
|
||||
|
||||
Reference in New Issue
Block a user