66 Commits

Author SHA1 Message Date
zxq9 2a7de4fee1 verup 2026-05-10 17:56:34 +09:00
zxq9 82d08da8ca Allow spending to contract addresses 2026-05-10 16:14:00 +09:00
zxq9 85d0c6fd04 Doc fix 2026-05-10 15:52:39 +09:00
zxq9 d8221e0b25 Doc fix
#20
2026-05-10 15:49:11 +09:00
zxq9 c9ead44aa2 Let non-zx projects call contract_create* 2026-05-10 15:01:50 +09:00
zxq9 c54c0db17a Fix list -> binary arg 2026-05-10 13:16:13 +09:00
zxq9 cd4f6a56a5 Differentiate between source return types 2026-05-09 20:07:52 +09:00
zxq9 fd2158a465 base64 -> bytearray encoding 2026-05-09 15:19:51 +09:00
zxq9 7fc3cd00da WIP 2026-05-08 23:04:56 +09:00
zxq9 02945dd10d derp 2026-05-08 19:47:25 +09:00
zxq9 695e7e4828 WIP 2026-05-08 15:48:05 +09:00
zxq9 9f02f73dbd verup 2026-05-08 08:43:07 +09:00
zxq9 fd8766a249 Unify call arg order between call and create 2026-05-07 19:53:36 +09:00
zxq9 bda4e89e58 Merge branch 'parser' of ssh://git.qpq.swiss:21203/QPQ-AG/hakuzaru into parser 2026-02-25 16:21:23 +09:00
zxq9 f277e79096 Minor doc and style edits 2026-02-25 16:20:52 +09:00
Jarvis Carroll ddec3bfa74 add more format options to decode_bytearray
I reversed the argument order here, since the Format option is sort of kind of almost optional, but I am not sure if that was a good idea.
2026-02-24 06:12:00 +00:00
zxq9 efe0a64056 Update comments, add fate and sophia tagged args 2026-02-13 13:50:29 +09:00
zxq9 6c172c4783 Adjusting a few calls. 2026-02-12 17:44:56 +09:00
Jarvis Carroll 6f5525afcf Rename get_function_signature
hz_aaci:aaci_get_function_signature is a bit redundant.
2026-01-15 01:50:50 +00:00
Jarvis Carroll 3da9bd570b split coerce/3 into two functions
Also renamed coerce_bindings to erlang_args_to_fate, to match.
2026-01-09 04:39:58 +00:00
Jarvis Carroll d2163c1ff8 split AACI out of hz.erl
So far the interface to hz.erl is mostly unchanged, apart from prepare_aaci/1

Maybe prepare_aaci should be re-exported, but using it is exactly in line with the
'inconvenient but more flexible primitives' that hz_aaci.erl is meant to represent,
so, maybe that is a fine place to have to go for it, dunno.
2026-01-07 09:40:55 +00:00
zxq9 af1639d47b Fix missed version doodoo and patch 2025-12-23 13:55:11 +09:00
zxq9 cb36bad74b Verup patch 2025-12-23 13:50:50 +09:00
zxq9 8b6085dee8 Make edoc happy 2025-12-22 11:52:29 +09:00
zxq9 ebb84b39a1 Verup 2025-12-22 11:17:01 +09:00
zxq9 1978ca59b3 Update specs 2025-12-18 10:37:06 +09:00
zxq9 4ee6609111 Add lookup interface in hz 2025-12-18 09:06:53 +09:00
zxq9 aeb78eab38 Add AACI caching 2025-12-18 09:03:21 +09:00
zxq9 751c099a44 Merge branch 'master' into bin_sig 2025-10-29 15:53:03 +09:00
zxq9 c5349f5736 Fix silly nodes report bug 2025-10-29 15:35:05 +09:00
zxq9 e8febcf8d5 Finally implement the "sticky" chain node 2025-10-25 13:45:40 +09:00
zxq9 8a42f4a7a3 verup 2025-10-25 12:49:29 +09:00
zxq9 a305bf3511 Merge branch 'master' into bin_sig 2025-10-25 12:42:03 +09:00
zxq9 f2fa83c215 Add binary signatures 2025-10-25 12:29:49 +09:00
zxq9 4c09490f8a Remove zx lib calls 2025-10-14 16:40:42 +09:00
zxq9 39b92996aa verup 2025-10-14 10:48:20 +09:00
zxq9 7c2db6eab7 Patch verup and fix TTL typespec 2025-10-11 10:10:39 +09:00
Jarvis Carroll f770bc299e add {raw, binary()} case for all chain objects 2025-10-09 09:46:45 +11:00
Jarvis Carroll c934510859 Complete AACI definition
This commit combines 13 separate commits:

add more atoms to AACI

serialize signatures

This took a surprising number of goose chases to work out... I had to
find out
- what is the gmser prefix for a signature (sg_)
- what is the gmb wrapper for a signature (none)
- what errors gmser can report when a signature is invalid
- what an example of a valid signature is
- what that example signature serializes to

coerce stringy booleans

coerce bytes

coerce bits

The thing to remember about bits is that they are actually integers...
It is tempting to present bits as binaries, but that hides the nuance of
the infinite leading zeroes, the potential for infinite leading ones,
etc.

coerce character

It's really just an integer... Should we flatten it to an integer
instead? I don't know.

Also coerce unicode strings to FATE

This is mainly so that gajudesk can pass text box content to hz as-is,
but also allows users to pass utf8 binaries in, if they want to, for
some reason.

Coerce binaries as-is

Sophia accepts both sg_... and #... as signatures, so we should probably
accept binaries as signatures directly. People might expect to be able
to put the listy string "#..." in too, but that is more complex to do.

coerce hashes

It turns out there are a lot of types that, like option, should only be
valid as an opaque/normalized type, but should be substituted for
something different in the flat representation. If we restructure things
a little then we can implement all of these in one go.

Refactor type normalization

Some of these checks were redundant, and we probably don't actually need
substitution to wrap success/failure, since it isn't expected to fail
anyway... Now the logic is much simpler, and adding more built-in type
definitions should be easy.

Add a map for builtin types

This makes it much easier to implement all these standard library
things.

In doing so I changed the convention for option, hash, unit, to be
stringy rather than atoms.

Also I changed some error messages based on what was more helpful during
debugging of the unit tests.

Add more builtin types

We probably should extract these from the standard library instead of
cherry picking the ones that are needed by the chain? e.g. Chain.tx
still doesn't work.

remaining types

`tx` isn't defined in all the same places that pointee, name, base_tx,
fr, fp are defined, but actually it is the only one not in the list I
was looking at, so we are all good. As demonstration, there is also a
test case for Set.set, despite Set.set not being defined as a builtin
type.
2025-09-30 16:14:11 +10:00
zxq9 b13af3d082 Add dict 2025-04-16 16:07:45 +09:00
zxq9 4dea4b766c Add message signing 2025-03-31 15:44:21 +09:00
zxq9 aa2d1adefd Update gmserialization dependency 2025-03-23 17:32:32 +09:00
zxq9 3f22659948 verup 2025-03-06 16:35:58 +09:00
zxq9 ddf375f05b Dialyzer fixes (#5)
Reviewed-on: #5
Co-authored-by: Craig Everett <zxq9@zxq9.com>
Co-committed-by: Craig Everett <zxq9@zxq9.com>
2025-03-06 16:38:46 +09:00
zxq9 58bd19d2dc Verup 2025-03-05 22:37:19 +09:00
zxq9 10e3a0b1c3 Move sign, spend, account decode, etc to lib 2025-03-05 22:29:30 +09:00
zxq9 b6cb79d81e verup 2025-03-01 14:04:48 +09:00
zxq9 b37f1e1efe Expose complete deployment parameters 2025-03-01 14:00:44 +09:00
zxq9 23b6256aae verup 2025-03-01 12:47:41 +09:00
zxq9 4efc38d319 Make dryrun operate on the top block. 2025-03-01 12:42:23 +09:00