Compare commits

..

5 Commits

Author SHA1 Message Date
SpiveeWorks
f54a33a293 Fix type substitution into variants and records
Variants were working by accident, since
{variant, [{"VariantName", [Element]}]} had a similar enough form to
the opaque types that would come from something like
`type1(type2(int))`, but records were not working, since they have a
different form. Now both are handled explicitly so that only the
intended forms of each are handled.
2025-01-24 19:14:16 +11:00
SpiveeWorks
1d71c16d6a Also prepare AACI for namespace types 2025-01-24 19:14:16 +11:00
SpiveeWorks
28dba962af Even more unit tests
Trying to test all the basic types that coerce covers, and a couple more
type parameter and nested cases.
2025-01-24 19:14:16 +11:00
SpiveeWorks
6e335067f9 Add unit tests for some simple coercions 2025-01-24 19:14:15 +11:00
b69ababf0f Remove oracles, update deps (except sophia) 2025-01-23 23:51:18 +09:00
2 changed files with 26 additions and 21 deletions

View File

@ -45,7 +45,7 @@
acc/1, acc_at_height/2, acc_at_block_id/2,
acc_pending_txs/1,
next_nonce/1,
dry_run/1, dry_run/2, dry_run/3,
dry_run/1, dry_run/2, dry_run/3, dry_run_map/1,
tx/1, tx_info/1,
post_tx/1,
contract/1, contract_code/1,
@ -644,6 +644,12 @@ dry_run(TX, Accounts, KBHash) ->
JSON = zj:binary_encode(DryData),
request("/v3/dry_run", JSON).
dry_run_map(Map) ->
JSON = zj:binary_encode(Map),
request("/v3/dry_run", JSON).
-spec decode_bytearray_fate(EncodedStr) -> {ok, Result} | {error, Reason}
when EncodedStr :: binary() | string(),
Result :: none | term(),
@ -763,18 +769,6 @@ contract_code(ID) ->
contract_poi(ID) ->
request(["/v3/contracts/", ID, "/poi"]).
% TODO
%oracle(ID) ->
% request(["/v3/oracles/", ID]).
% TODO
%oracle_queries(ID) ->
% request(["/v3/oracles/", ID, "/queries"]).
% TODO
%oracle_queries_by_id(OracleID, QueryID) ->
% request(["/v3/oracles/", OracleID, "/queries/", QueryID]).
-spec name(Name) -> {ok, Info} | {error, Reason}
when Name :: string(), % _ ++ ".chain"
@ -798,7 +792,7 @@ name(Name) ->
when Pubkey :: peer_pubkey(),
Reason :: term(). % FIXME
%% @doc
%% Returns the given node's public key, assuming there an AE node is reachable at
%% Returns the given node's public key, assuming a node is reachable at
%% the given address.
peer_pubkey() ->
@ -1015,6 +1009,18 @@ contract_create(CreatorID, Nonce, Amount, TTL, Gas, GasPrice, Path, InitArgs) ->
end.
-spec contract_create_built(CreatorID, Compiled, InitArgs) -> Result
when CreatorID :: unicode:chardata(),
Compiled :: map(),
InitArgs :: [string()],
Result :: {ok, CreateTX} | {error, Reason},
CreateTX :: binary(),
Reason :: file:posix() | term().
%% @doc
%% This function takes the compiler output (instead of starting from source),
%% and returns the unsigned create contract call data with default values.
%% For more control over exactly what those values are, use create_contract/8.
contract_create_built(CreatorID, Compiled, InitArgs) ->
case next_nonce(CreatorID) of
{ok, Nonce} ->

View File

@ -2,16 +2,16 @@
{type,app}.
{modules,[]}.
{prefix,"hz"}.
{desc,"Gajumaru interoperation library"}.
{author,"Craig Everett"}.
{desc,"Gajumaru interoperation library"}.
{package_id,{"otpr","hakuzaru",{0,2,0}}}.
{deps,[{"otpr","erl_base58",{0,1,0}},
{deps,[{"otpr","gmbytecode",{3,4,1}},
{"otpr","gmserialization",{0,1,2}},
{"otpr","base58",{0,1,1}},
{"otpr","eblake2",{1,0,1}},
{"otpr","ec_utils",{1,0,0}},
{"otpr","aebytecode",{3,2,1}},
{"otpr","aesophia",{7,1,2}},
{"otpr","aeserialization",{0,1,0}},
{"otpr","zj",{1,1,0}},
{"otpr","eblake2",{1,0,0}},
{"otpr","getopt",{1,0,2}}]}.
{key_name,none}.
{a_email,"ceverett@tsuriai.jp"}.
@ -20,6 +20,5 @@
{file_exts,[]}.
{license,"MIT"}.
{repo_url,"https://gitlab.com/ioecs/hakuzaru"}.
{tags,["aeternity","qpq","gajumaru","blockchain","hakuzaru","crypto","ae",
"defi"]}.
{tags,["qpq","gajumaru","blockchain","hakuzaru","crypto","defi"]}.
{ws_url,"https://gitlab.com/ioecs/hakuzaru"}.