Skip to content

Commit 6cac3d0

Browse files
committed
Pass current receiver when invoking apply function
1 parent 1cd5cf8 commit 6cac3d0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

libraries/chain/webassembly/binaryen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class binaryen_instantiated_module : public wasm_instantiated_module_interface {
2222
}
2323

2424
void apply(apply_context& context) override {
25-
LiteralList args = {Literal(uint64_t(context.act.account)),
25+
LiteralList args = {Literal(uint64_t(context.receiver)),
26+
Literal(uint64_t(context.act.account)),
2627
Literal(uint64_t(context.act.name))};
2728
call("apply", args, context);
2829
}

libraries/chain/webassembly/wavm.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class wavm_instantiated_module : public wasm_instantiated_module_interface {
3030
{}
3131

3232
void apply(apply_context& context) override {
33-
vector<Value> args = {Value(uint64_t(context.act.account)),
33+
vector<Value> args = {Value(uint64_t(context.receiver)),
34+
Value(uint64_t(context.act.account)),
3435
Value(uint64_t(context.act.name))};
3536

3637
call("apply", args, context);
@@ -77,12 +78,14 @@ class wavm_instantiated_module : public wasm_instantiated_module_interface {
7778
} FC_CAPTURE_AND_RETHROW()
7879
}
7980

81+
8082
std::vector<uint8_t> _initial_memory;
8183
//naked pointers because ModuleInstance is opaque
8284
ModuleInstance* _instance;
8385
Module* _module;
8486
};
8587

88+
8689
wavm_runtime::runtime_guard::runtime_guard() {
8790
// TODO clean this up
8891
//check_wasm_opcode_dispositions();

0 commit comments

Comments
 (0)