Merge pull request #93 from aeternity/GH-203-protected-calls

Add protected call FATE instruction
This commit is contained in:
Hans Svensson 2020-03-02 12:07:50 +01:00 committed by GitHub
commit 7f0d3090d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -77,7 +77,7 @@ prop_opcodes() ->
valid_opcodes() -> valid_opcodes() ->
lists:seq(0, 16#a0) ++ lists:seq(16#fa, 16#fd). [ Op || #{opcode := Op} <- aeb_fate_generate_ops:get_ops() ].
fate_code(Failure) -> fate_code(Failure) ->

View File

@ -220,6 +220,8 @@ ops_defs() ->
, { 'CHAR_TO_INT', 16#a0, false, true, true, 10, [a,a], char_to_int, {char}, int, "Arg0 := integer representation of UTF-8 character"} , { 'CHAR_TO_INT', 16#a0, false, true, true, 10, [a,a], char_to_int, {char}, int, "Arg0 := integer representation of UTF-8 character"}
, { 'CHAR_FROM_INT', 16#a1, false, true, true, 10, [a,a], char_from_int, {int}, variant, "Arg0 := Some(UTF-8 character) from integer if valid, None if not valid."} , { 'CHAR_FROM_INT', 16#a1, false, true, true, 10, [a,a], char_from_int, {int}, variant, "Arg0 := Some(UTF-8 character) from integer if valid, None if not valid."}
, { 'CALL_PGR', 16#a2, true, false, true, 100, [a,is,a,a,a,a,a], call_pgr, {contract, string, typerep, typerep, integer, integer, bool}, variant, "Potentially protected remote call. Arg5 is protected flag, otherwise as CALL_GR."}
, { 'DEACTIVATE', 16#fa, false, true, true, 10, [], deactivate, {}, none, "Mark the current contract for deactivation."} , { 'DEACTIVATE', 16#fa, false, true, true, 10, [], deactivate, {}, none, "Mark the current contract for deactivation."}
, { 'ABORT', 16#fb, true, true, true, 10, [a], abort, {string}, none, "Abort execution (dont use all gas) with error message in Arg0."} , { 'ABORT', 16#fb, true, true, true, 10, [a], abort, {string}, none, "Abort execution (dont use all gas) with error message in Arg0."}
, { 'EXIT', 16#fc, true, true, true, 10, [a], exit, {string}, none, "Abort execution (use upp all gas) with error message in Arg0."} , { 'EXIT', 16#fc, true, true, true, 10, [a], exit, {string}, none, "Abort execution (use upp all gas) with error message in Arg0."}

View File

@ -25,7 +25,11 @@
%% Size in bytes of serialization of a map for which we turn it into a store %% Size in bytes of serialization of a map for which we turn it into a store
%% map. It's not worth turning small maps into store maps. %% map. It's not worth turning small maps into store maps.
%% Under consensus! %% Under consensus!
-ifdef(TEST).
-define(STORE_MAP_THRESHOLD, 0).
-else.
-define(STORE_MAP_THRESHOLD, 100). -define(STORE_MAP_THRESHOLD, 100).
-endif.
-type fate_value() :: aeb_fate_data:fate_type(). -type fate_value() :: aeb_fate_data:fate_type().
-type fate_value_or_tombstone() :: fate_value() | ?FATE_MAP_TOMBSTONE. -type fate_value_or_tombstone() :: fate_value() | ?FATE_MAP_TOMBSTONE.