add more atoms to AACI
This commit is contained in:
parent
b13af3d082
commit
a6f58a95e2
28
src/hz.erl
28
src/hz.erl
@ -1524,15 +1524,33 @@ opaque_type(Params, Pair) when is_map(Pair) ->
|
||||
[{Name, TypeArgs}] = maps:to_list(Pair),
|
||||
{opaque_type_name(Name), [opaque_type(Params, Arg) || Arg <- TypeArgs]}.
|
||||
|
||||
% atoms for builtins, strings (lists) for user-defined types
|
||||
% Atoms for builtins, strings (lists) for user-defined types.
|
||||
%
|
||||
% There are some magic built in types that may or may not also need atoms to
|
||||
% represent them, and may or may not need to be handled explicitly in
|
||||
% coerce/3, if we can't flatten them directly
|
||||
%
|
||||
% These types represent some FATE variant:
|
||||
% Chain.ttl, AENS.pointee, AENS.name, AENSv2.pointee, AENSv2.name,
|
||||
% Chain.ga_meta_tx, Chain.paying_for_tx, Chain.base_tx,
|
||||
%
|
||||
% And then MCL_BLS12_381.fr represent bytes(32), and MCL_BLS12_381.fp
|
||||
% represents bytes(48).
|
||||
opaque_type_name(<<"int">>) -> integer;
|
||||
opaque_type_name(<<"address">>) -> address;
|
||||
opaque_type_name(<<"contract">>) -> contract;
|
||||
opaque_type_name(<<"bool">>) -> boolean;
|
||||
opaque_type_name(<<"option">>) -> option;
|
||||
opaque_type_name(<<"bits">>) -> bits;
|
||||
opaque_type_name(<<"char">>) -> integer;
|
||||
opaque_type_name(<<"string">>) -> string;
|
||||
opaque_type_name(<<"address">>) -> address;
|
||||
opaque_type_name(<<"hash">>) -> hash;
|
||||
opaque_type_name(<<"signature">>) -> signature;
|
||||
opaque_type_name(<<"bytes">>) -> bytes;
|
||||
opaque_type_name(<<"contract">>) -> contract;
|
||||
opaque_type_name(<<"list">>) -> list;
|
||||
opaque_type_name(<<"map">>) -> map;
|
||||
opaque_type_name(<<"string">>) -> string;
|
||||
opaque_type_name(<<"option">>) -> option;
|
||||
opaque_type_name(<<"name">>) -> name;
|
||||
opaque_type_name(<<"channel">>) -> channel;
|
||||
opaque_type_name(Name) -> binary_to_list(Name).
|
||||
|
||||
% Type preparation has two goals. First, we need a data structure that can be
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user