mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 12:51:05 +00:00
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:
committed by
Sergei Pepyakin
parent
eb6dc0394e
commit
fb0f4dfb03
@@ -482,6 +482,19 @@ define_env!(Env, <E: Ext>,
|
||||
Ok(())
|
||||
},
|
||||
|
||||
// Load the latest block RNG seed into the scratch buffer
|
||||
ext_random_seed(ctx) => {
|
||||
ctx.scratch_buf = ctx.ext.random_seed().encode();
|
||||
Ok(())
|
||||
},
|
||||
|
||||
// Load the latest block timestamp into the scratch buffer
|
||||
ext_now(ctx) => {
|
||||
let now: u64 = As::as_(ctx.ext.now().clone());
|
||||
ctx.scratch_buf = now.encode();
|
||||
Ok(())
|
||||
},
|
||||
|
||||
// Decodes the given buffer as a `T::Call` and adds it to the list
|
||||
// of to-be-dispatched calls.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user