Skip to content

Commit

Permalink
Merge pull request #2687 from aeternity/enable_FATE
Browse files Browse the repository at this point in the history
Enable FATE
  • Loading branch information
hanssv committed Aug 22, 2019
2 parents 221371d + 51f7e4c commit 40f495a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
6 changes: 0 additions & 6 deletions apps/aecontract/include/aecontract.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,3 @@
-define(VM_AEVM_SOLIDITY_1_enabled, false).
-endif.

-ifdef(TEST).
-define(VM_FATE_SOPHIA_1_enabled, true).
-else.
-define(VM_FATE_SOPHIA_1_enabled, false).
-endif.

11 changes: 5 additions & 6 deletions apps/aecontract/src/aect_contracts.erl
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ is_legal_version_in_protocol(create, #{vm := ?VM_FATE_SOPHIA_1, abi := ?ABI_FATE
?ROMA_PROTOCOL_VSN -> false;
?MINERVA_PROTOCOL_VSN -> false;
?FORTUNA_PROTOCOL_VSN -> false;
?LIMA_PROTOCOL_VSN -> ?VM_FATE_SOPHIA_1_enabled; %% TODO: Revise this before release
P when P > ?LIMA_PROTOCOL_VSN -> ?VM_FATE_SOPHIA_1_enabled %% TODO: Revise this before release
?LIMA_PROTOCOL_VSN -> true;
P when P > ?LIMA_PROTOCOL_VSN -> true
end;
is_legal_version_in_protocol(call, #{vm := VMVersion}, ProtocolVersion) ->
case ProtocolVersion of
Expand All @@ -196,7 +196,7 @@ is_legal_version_in_protocol(call, #{vm := VMVersion}, ProtocolVersion) ->
(
(VMVersion =:= ?VM_FATE_SOPHIA_1)
) ->
?VM_FATE_SOPHIA_1_enabled;
true;
_ when VMVersion =:= ?VM_AEVM_SOLIDITY_1 ->
?VM_AEVM_SOLIDITY_1_enabled;
_ ->
Expand All @@ -207,8 +207,7 @@ is_legal_version_in_protocol(oracle_register, #{abi := ?ABI_NO_VM}, _ProtocolVer
is_legal_version_in_protocol(oracle_register, #{abi := ?ABI_AEVM_SOPHIA_1}, _ProtocolVersion) ->
true;
is_legal_version_in_protocol(oracle_register, #{abi := ?ABI_FATE_SOPHIA_1}, ProtocolVersion) ->
ProtocolVersion >= ?LIMA_PROTOCOL_VSN
andalso ?VM_FATE_SOPHIA_1_enabled;
ProtocolVersion >= ?LIMA_PROTOCOL_VSN;
is_legal_version_in_protocol(_, _, _) ->
false.

Expand Down Expand Up @@ -523,7 +522,7 @@ is_legal_version(#{vm := VM, abi := ABI}) ->
{?VM_AEVM_SOPHIA_2, ?ABI_AEVM_SOPHIA_1} -> true;
{?VM_AEVM_SOPHIA_3, ?ABI_AEVM_SOPHIA_1} -> true;
{?VM_AEVM_SOPHIA_4, ?ABI_AEVM_SOPHIA_1} -> true;
{?VM_FATE_SOPHIA_1, ?ABI_FATE_SOPHIA_1} -> ?VM_FATE_SOPHIA_1_enabled;
{?VM_FATE_SOPHIA_1, ?ABI_FATE_SOPHIA_1} -> true;
{?VM_AEVM_SOLIDITY_1, ?ABI_SOLIDITY_1} -> ?VM_AEVM_SOLIDITY_1_enabled;
_ -> false
end.
Expand Down

0 comments on commit 40f495a

Please sign in to comment.