Add value and gas to remote calls #555

Merged
gorillainduction merged 2 commits from PT-165857097-add-gas-and-value-to-calls into master 2019-05-10 16:00:37 +09:00
Showing only changes of commit be37606064 - Show all commits

View File

@ -235,7 +235,7 @@ to_scode(Env, {funcall, Fun, Args}) ->
to_scode(Env, {builtin, B, Args}) -> to_scode(Env, {builtin, B, Args}) ->
builtin_to_scode(Env, B, Args); builtin_to_scode(Env, B, Args);
to_scode(Env, {remote, Ct, Fun, [{builtin, call_gas_left, _}, Value |Args]}) -> to_scode(Env, {remote, Ct, Fun, [{builtin, call_gas_left, _}, Value | Args]}) ->
%% Gas is not limited. %% Gas is not limited.
Lbl = make_function_name(Fun), Lbl = make_function_name(Fun),
Call = if Env#env.tailpos -> aeb_fate_code:call_tr(?a, Lbl, ?a); Call = if Env#env.tailpos -> aeb_fate_code:call_tr(?a, Lbl, ?a);
@ -243,7 +243,7 @@ to_scode(Env, {remote, Ct, Fun, [{builtin, call_gas_left, _}, Value |Args]}) ->
end, end,
call_to_scode(Env, [to_scode(Env, Value), to_scode(Env, Ct), Call], Args); call_to_scode(Env, [to_scode(Env, Value), to_scode(Env, Ct), Call], Args);
to_scode(Env, {remote, Ct, Fun, [Gas, Value |Args]}) -> to_scode(Env, {remote, Ct, Fun, [Gas, Value | Args]}) ->
%% Gas is limited. %% Gas is limited.
Lbl = make_function_name(Fun), Lbl = make_function_name(Fun),
Call = if Env#env.tailpos -> aeb_fate_code:call_gtr(?a, Lbl, ?a, ?a); Call = if Env#env.tailpos -> aeb_fate_code:call_gtr(?a, Lbl, ?a, ?a);