srml-contract: introduce ext_caller external function (#1255)

* Implement ext_caller.

* Rebuild wasm.

* Update COMPLEIXTY.md
This commit is contained in:
Sergei Pepyakin
2018-12-12 14:00:21 +01:00
committed by Gav Wood
parent c1b0fba486
commit ce91da6b89
7 changed files with 176 additions and 3 deletions
+7 -3
View File
@@ -90,7 +90,7 @@ impl<'a, T: Trait> ExecutionContext<'a, T> {
output_data,
&mut CallContext {
ctx: &mut nested,
_caller: caller,
caller: caller,
},
&self.config.schedule,
gas_meter,
@@ -158,7 +158,7 @@ impl<'a, T: Trait> ExecutionContext<'a, T> {
&mut contract_code,
&mut CallContext {
ctx: &mut nested,
_caller: caller,
caller: caller,
},
&self.config.schedule,
gas_meter,
@@ -255,7 +255,7 @@ fn transfer<'a, T: Trait>(
struct CallContext<'a, 'b: 'a, T: Trait + 'b> {
ctx: &'a mut ExecutionContext<'b, T>,
_caller: T::AccountId,
caller: T::AccountId,
}
impl<'a, 'b: 'a, T: Trait + 'b> vm::Ext for CallContext<'a, 'b, T> {
@@ -298,4 +298,8 @@ impl<'a, 'b: 'a, T: Trait + 'b> vm::Ext for CallContext<'a, 'b, T> {
.map_err(|_| ())
.map(|_| ())
}
fn caller(&self) -> &T::AccountId {
&self.caller
}
}