Address review comment

This commit is contained in:
Hans Svensson 2019-04-23 10:47:59 +02:00
parent 4324bfd49e
commit 5e6af18c7b
2 changed files with 2 additions and 3 deletions

View File

@ -135,7 +135,7 @@ encode_type(#tuple_t{args=As}) ->
Eas = encode_types(As), Eas = encode_types(As),
[{<<"tuple">>,Eas}]; [{<<"tuple">>,Eas}];
encode_type(#bytes_t{len=Len}) -> encode_type(#bytes_t{len=Len}) ->
list_to_binary(lists:concat(["bytes(", Len, ")"])); {<<"bytes">>, Len};
encode_type(#record_t{fields=Fs}) -> encode_type(#record_t{fields=Fs}) ->
Efs = encode_fields(Fs), Efs = encode_fields(Fs),
[{<<"record">>,Efs}]; [{<<"record">>,Efs}];

View File

@ -726,8 +726,7 @@ ttl_t(Icode) ->
ast_typerep({qid, [], ["Chain", "ttl"]}, Icode). ast_typerep({qid, [], ["Chain", "ttl"]}, Icode).
sign_t() -> bytes_t(64). sign_t() -> bytes_t(64).
bytes_t(Len) when Len =< 32 -> word; bytes_t(Len) -> {bytes, Len}.
bytes_t(Len) -> {tuple, lists:duplicate((31 + Len) div 32, word)}.
get_signature_arg(Args0) -> get_signature_arg(Args0) ->
NamedArgs = [Arg || Arg = {named_arg, _, _, _} <- Args0], NamedArgs = [Arg || Arg = {named_arg, _, _, _} <- Args0],