lib.rs 952 B
Newer Older
#![cfg_attr(feature = "without-std", no_std)]
#![cfg_attr(feature = "strict", deny(warnings))]

#[macro_use]
extern crate runtime_support;

mod codec;
Gav's avatar
Gav committed
mod support;
mod runtime;
pub use codec::{endiansensitive, streamreader, joiner, slicable, keyedvec};
pub use support::{primitives, function, environment, storage};
Gav's avatar
Gav committed
#[cfg(test)]
pub use support::testing;
#[allow(unused_imports)]		// TODO: remove in due course
Gav's avatar
Gav committed

use runtime_support::Vec;
use slicable::Slicable;
Gav's avatar
Gav committed
use primitives::{Block, Transaction};
Gav's avatar
Gav committed
// TODO: add externals for:
// - keccak256 (or some better hashing scheme)
// - trie rooting
// - ECDSA-recover (or some better sig scheme)
pub fn execute_block(input: Vec<u8>) -> Vec<u8> {
	runtime::system::execute_block(Block::from_slice(&input).unwrap())
pub fn execute_transaction(input: Vec<u8>) -> Vec<u8> {
	runtime::system::execute_transaction(&Transaction::from_slice(&input).unwrap())
impl_stubs!(execute_block, execute_transaction);