Bump gmserialization to v1.2.0

This commit is contained in:
Dimitar Ivanov
2025-03-01 14:55:42 +02:00
parent 927cd42592
commit e30d99d87b
13 changed files with 271 additions and 269 deletions
+6 -6
View File
@@ -65,9 +65,9 @@ to_sophia_value_mcl_bls12_381_test() ->
Opts = [{backend, fate}],
CallValue32 = aeb_fate_encoding:serialize({bytes, <<20:256>>}),
CallValue48 = aeb_fate_encoding:serialize({bytes, <<55:384>>}),
CallValueTp = aeb_fate_encoding:serialize({tuple, {{bytes, <<15:256>>}, {bytes, <<160:256>>}, {bytes, <<1234:256>>}}}),
CallValue32 = gmb_fate_encoding:serialize({bytes, <<20:256>>}),
CallValue48 = gmb_fate_encoding:serialize({bytes, <<55:384>>}),
CallValueTp = gmb_fate_encoding:serialize({tuple, {{bytes, <<15:256>>}, {bytes, <<160:256>>}, {bytes, <<1234:256>>}}}),
{ok, _} = aeso_compiler:to_sophia_value(Code, "test_bls12_381_fp", ok, CallValue32, Opts),
{error, _} = aeso_compiler:to_sophia_value(Code, "test_bls12_381_fp", ok, CallValue48, Opts),
@@ -227,7 +227,7 @@ encode_decode_calldata_(Code, FunName, Args) ->
"init" ->
[];
_ ->
{ok, FateArgs} = aeb_fate_abi:decode_calldata(FunName, Calldata),
{ok, FateArgs} = gmb_fate_abi:decode_calldata(FunName, Calldata),
FateArgs
end.
@@ -236,7 +236,7 @@ encode_decode(D) ->
D.
encode(D) ->
aeb_fate_encoding:serialize(D).
gmb_fate_encoding:serialize(D).
decode(B) ->
aeb_fate_encoding:deserialize(B).
gmb_fate_encoding:deserialize(B).
+3 -3
View File
@@ -28,7 +28,7 @@ simple_compile_test_() ->
fun() ->
case compile(ContractName) of
#{fate_code := Code} ->
Code1 = aeb_fate_code:deserialize(aeb_fate_code:serialize(Code)),
Code1 = gmb_fate_code:deserialize(gmb_fate_code:serialize(Code)),
?assertMatch({X, X}, {Code1, Code});
Error -> io:format("\n\n~p\n\n", [Error]), print_and_throw(Error)
end
@@ -84,7 +84,7 @@ stdlib_test_() ->
Options = [{src_file, File}],
case aeso_compiler:from_string(String, Options) of
{ok, #{fate_code := Code}} ->
Code1 = aeb_fate_code:deserialize(aeb_fate_code:serialize(Code)),
Code1 = gmb_fate_code:deserialize(gmb_fate_code:serialize(Code)),
?assertMatch({X, X}, {Code1, Code});
{error, Error} -> io:format("\n\n~p\n\n", [Error]), print_and_throw(Error)
end
@@ -1345,7 +1345,7 @@ validation_fails() ->
validate(Contract1, Contract2) ->
case compile(Contract1) of
ByteCode = #{ fate_code := FCode } ->
FCode1 = aeb_fate_code:serialize(aeb_fate_code:strip_init_function(FCode)),
FCode1 = gmb_fate_code:serialize(gmb_fate_code:strip_init_function(FCode)),
Source = aeso_test_utils:read_contract(Contract2),
aeso_compiler:validate_byte_code(
ByteCode#{ byte_code := FCode1 }, Source,
+1 -1
View File
@@ -11,7 +11,7 @@
-export([read_contract/1, contract_path/0]).
contract_path() ->
filename:join(code:lib_dir(aesophia, test), "contracts").
filename:join(code:lib_dir(sophia, test), "contracts").
%% Read a contract file from the test/contracts directory.
-spec read_contract(string() | atom()) -> string().