Expose block random seed and timestamp to contract ABI (#1630)

* Expose block random seed and timestamp to contract ABI

* Add tests

* Bump spec version
This commit is contained in:
Jordan Beauchamp
2019-02-07 22:58:02 +13:00
committed by Sergei Pepyakin
parent eb6dc0394e
commit fb0f4dfb03
12 changed files with 208 additions and 6 deletions
+2 -1
View File
@@ -81,6 +81,7 @@ use runtime_support::dispatch::{Result, Dispatchable};
use runtime_support::{Parameter, StorageMap, StorageValue, StorageDoubleMap};
use system::{ensure_signed, RawOrigin};
use runtime_io::{blake2_256, twox_128};
use timestamp;
pub type CodeHash<T> = <T as system::Trait>::Hash;
@@ -94,7 +95,7 @@ pub trait ComputeDispatchFee<Call, Balance> {
fn compute_dispatch_fee(call: &Call) -> Balance;
}
pub trait Trait: balances::Trait {
pub trait Trait: balances::Trait + timestamp::Trait {
/// The outer call dispatch type.
type Call: Parameter + Dispatchable<Origin=<Self as system::Trait>::Origin>;