contract HashTimeLock =
datatype status = INVALID | ACTIVE | REFUNDED | WITHDRAWN | EXPIRED
record lock_contract = {input_amount : int, output_amount : int, expiration : int, hash_lock : hash, status: status, sender : address, receiver : address, output_network : string, output_address : string}
entrypoint new_contract(l : lock_contract) : lock_contract = l
./aesophia_cli /tmp/foo.aes -b fate --call_result cb_q58BgUFsUQgA37pD+/b+7SyBTPjsmp5mKp47Akx0c4yLS635b4gbwW1nTsf/wG+IG8FtZ07H/8BvhgFxEO8ARp8BgYcZ2AhdUzRj15KZWrT0vIXnJEq1gEZLA1zDge3Qam24r4UAAAAAAAE/nwCgBwwURA4zMENRZdpeBEtaqcNdLL4wyRwyFFVJN19SUmSfAKBrs4jtfFRU9fsXJtVRgxnm+6MvasbSWpfv9LbvZBN72A1BRVPRYWtfNDcxZFlVclE4RUF0bXp3dUtEdzRWQkdRZG5FY1A1WUY1NjNXRzR5UjlXdmZwNXRScCV612Q= --call_result_fun new_contract
escript: exception error: no function clause matching
aeso_pretty:type({variant_t,
[{constr_t,
[{file,no_file},{line,2},{col,21}],
{con,
[{file,no_file},{line,2},{col,21}],
"INVALID"},
[]},
{constr_t,
[{file,no_file},{line,2},{col,31}],
{con,
[{file,no_file},{line,2},{col,31}],
"ACTIVE"},
[]},
{constr_t,
[{file,no_file},{line,2},{col,40}],
{con,
[{file,no_file},{line,2},{col,40}],
"REFUNDED"},
[]},
{constr_t,
[{file,no_file},{line,2},{col,51}],
{con,
[{file,no_file},{line,2},{col,51}],
"WITHDRAWN"},
[]},
{constr_t,
[{file,no_file},{line,2},{col,63}],
{con,
[{file,no_file},{line,2},{col,63}],
"EXPIRED"},
[]}]}) (/Users/hans/Quviq/Aeternity/aesophia_cli/_checkouts/aesophia/src/aeso_pretty.erl, line 245)
in function aeso_pretty:typed/2 (/Users/hans/Quviq/Aeternity/aesophia_cli/_checkouts/aesophia/src/aeso_pretty.erl, line 131)
in call from lists:map/2 (lists.erl, line 1239)
in call from lists:map/2 (lists.erl, line 1239)
in call from aeso_pretty:typedef/1 (/Users/hans/Quviq/Aeternity/aesophia_cli/_checkouts/aesophia/src/aeso_pretty.erl, line 228)
in call from aeso_compiler:to_sophia_value/5 (/Users/hans/Quviq/Aeternity/aesophia_cli/_checkouts/aesophia/src/aeso_compiler.erl, line 339)
in call from aesophia_cli:decode_call_res/5 (/Users/hans/Quviq/Aeternity/aesophia_cli/src/aesophia_cli.erl, line 269)
in call from aesophia_cli:main/1 (/Users/hans/Quviq/Aeternity/aesophia_cli/src/aesophia_cli.erl, line 62)
The problem comes from trying to print an error message for a variant-type that case is missing since aeso_pretty:type
isn't normally called directly, but in to_sophia_value
it is.