Fix singleton record calldata decode + test
This commit is contained in:
parent
6b60fde2df
commit
db4de5d926
@ -95,6 +95,8 @@ from_fate({tuple_t, _, Types}, ?FATE_TUPLE(Val))
|
||||
when length(Types) == tuple_size(Val) ->
|
||||
{tuple, [], [from_fate(Type, X)
|
||||
|| {Type, X} <- lists:zip(Types, tuple_to_list(Val))]};
|
||||
from_fate({record_t, [{field_t, _, FName, FType}]}, Val) ->
|
||||
{record, [], [{field, [], [{proj, [], FName}], from_fate(FType, Val)}]};
|
||||
from_fate({record_t, Fields}, ?FATE_TUPLE(Val))
|
||||
when length(Fields) == tuple_size(Val) ->
|
||||
{record, [], [ {field, [], [{proj, [], FName}], from_fate(FType, X)}
|
||||
|
@ -113,6 +113,7 @@ compilable_contracts() ->
|
||||
{"funargs", "traffic_light", ["Pantone(12)"]},
|
||||
{"funargs", "tuples", ["()"]},
|
||||
%% TODO {"funargs", "due", ["FixedTTL(1020)"]},
|
||||
{"funargs", "singleton_rec", ["{x = 1000}"]},
|
||||
{"variant_types", "init", []},
|
||||
{"basic_auth", "init", []},
|
||||
{"address_literals", "init", []},
|
||||
|
@ -45,3 +45,8 @@ contract FunctionArguments =
|
||||
|
||||
entrypoint due(t : Chain.ttl) =
|
||||
true
|
||||
|
||||
record singleton_r = { x : int }
|
||||
|
||||
entrypoint singleton_rec(r : singleton_r) =
|
||||
r.x
|
||||
|
Loading…
x
Reference in New Issue
Block a user