mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-05 03:57:24 +00:00
srml-contract: introduce ext_caller external function (#1255)
* Implement ext_caller. * Rebuild wasm. * Update COMPLEIXTY.md
This commit is contained in:
committed by
Gav Wood
parent
c1b0fba486
commit
ce91da6b89
@@ -360,6 +360,16 @@ define_env!(init_env, <E: Ext>,
|
||||
Err(sandbox::HostError)
|
||||
},
|
||||
|
||||
// Stores the address of the caller into the scratch buffer.
|
||||
//
|
||||
// If this is a top-level call (i.e. initiated by an extrinsic) the origin address of the extrinsic
|
||||
// will be returned. Otherwise, if this call is initiated by another contract then the address
|
||||
// of the contract will be returned.
|
||||
ext_caller(ctx) => {
|
||||
ctx.scratch_buf = ctx.ext.caller().encode();
|
||||
Ok(())
|
||||
},
|
||||
|
||||
// Returns the size of the input buffer.
|
||||
ext_input_size(ctx) -> u32 => {
|
||||
Ok(ctx.input_data.len() as u32)
|
||||
|
||||
Reference in New Issue
Block a user