mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 02:51:08 +00:00
Add ExtCurrentBlockNumber in SRML::Contract (#3047)
* add block number * add ext_current_block * add ext_current_block test * Update srml/contracts/src/wasm/mod.rs Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com> * Update srml/contracts/src/wasm/mod.rs Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com> * change valid comment * use BlockNumberOf<T> * Update srml/contracts/src/exec.rs Co-Authored-By: André Silva <andre.beat@gmail.com> * return types copy, not reference * version up spec_version and impl_version * change method name current_block -> block_number * Update srml/contracts/src/exec.rs Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>
This commit is contained in:
committed by
Sergei Pepyakin
parent
0366f7b35c
commit
e9d41feb1c
@@ -701,6 +701,13 @@ define_env!(Env, <E: Ext>,
|
||||
}
|
||||
Ok(())
|
||||
},
|
||||
|
||||
// Stores the current block number of the current contract into the scratch buffer.
|
||||
ext_block_number(ctx) => {
|
||||
ctx.scratch_buf.clear();
|
||||
ctx.ext.block_number().encode_to(&mut ctx.scratch_buf);
|
||||
Ok(())
|
||||
},
|
||||
);
|
||||
|
||||
/// Finds duplicates in a given vector.
|
||||
|
||||
Reference in New Issue
Block a user