All checks were successful
Gajumaru Serialization Tests / tests (push) Successful in -4m21s
Removed the oracle type references and updated the dependency list to point to git.qpq.swiss. Reviewed-on: #43 Co-authored-by: Craig Everett <zxq9@zxq9.com> Co-committed-by: Craig Everett <zxq9@zxq9.com>
40 lines
1.3 KiB
Erlang
40 lines
1.3 KiB
Erlang
%%%-------------------------------------------------------------------
|
|
%%% @copyright (C) 2025, QPQ AG
|
|
%%%-------------------------------------------------------------------
|
|
|
|
-module(gmser_contract_code_tests).
|
|
|
|
-include_lib("eunit/include/eunit.hrl").
|
|
-include("gmser_contract_code.hrl").
|
|
|
|
-define(DUMMY_CODE_MAP_1,
|
|
#{ byte_code => <<"DUMMY CODE">>
|
|
, type_info => [{<<>>, <<>>, <<>>, <<>>}]
|
|
, contract_source => "contract Foo = ..." }).
|
|
|
|
-define(DUMMY_CODE_MAP_2,
|
|
#{ byte_code => <<"DUMMY CODE">>
|
|
, type_info => [{<<>>, <<>>, <<>>, <<>>}]
|
|
, compiler_version => <<"3.1.4">>
|
|
, source_hash => <<1, 2, 3, 4>> }).
|
|
|
|
-define(DUMMY_CODE_MAP_3,
|
|
#{ byte_code => <<"DUMMY CODE">>
|
|
, type_info => [{<<>>, <<>>, false, <<>>, <<>>}]
|
|
, compiler_version => <<"3.1.4">>
|
|
, contract_source => "contract Foo = ..."
|
|
, payable => true} ).
|
|
|
|
vsn_1_test() ->
|
|
gmser_contract_code:deserialize(
|
|
gmser_contract_code:serialize(?DUMMY_CODE_MAP_1, ?SOPHIA_CONTRACT_VSN_1)).
|
|
|
|
vsn_2_test() ->
|
|
gmser_contract_code:deserialize(
|
|
gmser_contract_code:serialize(?DUMMY_CODE_MAP_2, ?SOPHIA_CONTRACT_VSN_2)).
|
|
|
|
vsn_3_test() ->
|
|
gmser_contract_code:deserialize(
|
|
gmser_contract_code:serialize(?DUMMY_CODE_MAP_3, ?SOPHIA_CONTRACT_VSN_3)).
|
|
|