44 Commits

Author SHA1 Message Date
Jarvis Carroll
d66b8a0af9 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-26 20:46:12 +10:00
Jarvis Carroll
2abb15cceb 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.
2025-09-26 09:05:59 +10:00
Jarvis Carroll
057861e9cf 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.
2025-09-24 16:27:32 +10:00
Jarvis Carroll
7ffc96b68a 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.
2025-09-24 14:10:29 +10:00
Jarvis Carroll
a1be8cbc14 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.
2025-09-23 19:22:30 +10:00
Jarvis Carroll
3822bb69c9 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.
2025-09-23 17:34:55 +10:00
Jarvis Carroll
6506fc91bd 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.
2025-09-23 17:07:41 +10:00
Jarvis Carroll
68a0c3d623 coerce character
It's really just an integer... Should we flatten it to an integer
instead? I don't know.
2025-09-23 16:00:56 +10:00
Jarvis Carroll
d3fb598506 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.
2025-09-23 15:42:53 +10:00
Jarvis Carroll
4ed2bd0cd1 coerce bytes 2025-09-23 14:35:42 +10:00
Jarvis Carroll
0caf5a61c7 coerce stringy booleans 2025-09-23 12:44:20 +10:00
Jarvis Carroll
7704d82c6f 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
2025-09-23 12:39:07 +10:00
Jarvis Carroll
a6f58a95e2 add more atoms to AACI 2025-09-18 23:31:11 +10:00
b13af3d082 Add dict 2025-04-16 16:07:45 +09:00
50665e4c42 Update dep 2025-04-11 12:35:15 +09:00
676117760e Adjust keymaster 2025-03-31 15:56:31 +09:00
468da93eda Add keymaster 2025-03-31 15:47:09 +09:00
4dea4b766c Add message signing 2025-03-31 15:44:21 +09:00
aa2d1adefd Update gmserialization dependency 2025-03-23 17:32:32 +09:00
3f22659948 verup 2025-03-06 16:35:58 +09:00
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
58bd19d2dc Verup 2025-03-05 22:37:19 +09:00
10e3a0b1c3 Move sign, spend, account decode, etc to lib 2025-03-05 22:29:30 +09:00
b6cb79d81e verup 2025-03-01 14:04:48 +09:00
5a16ccf45a Merge pull request 'Expose complete deployment parameters' (#4) from dryrun-fix into master
Reviewed-on: #4
2025-03-01 14:06:12 +09:00
b37f1e1efe Expose complete deployment parameters 2025-03-01 14:00:44 +09:00
23b6256aae verup 2025-03-01 12:47:41 +09:00
4efc38d319 Make dryrun operate on the top block. 2025-03-01 12:42:23 +09:00
SpiveeWorks
ede98b9e96 Fix function spec AACI preparation 2025-02-28 23:59:00 +11:00
d83ac6eb59 verup 2025-02-27 22:21:34 +09:00
SpiveeWorks
36a9b17b78 Clean up try_coerce slightly 2025-02-27 23:12:33 +11:00
SpiveeWorks
4e71d3215b Factor handling of different ACI typedef cases
A lot of this complexity was a consequence of trying to avoid redundant
extraction of the namespace's/contract's name, so on the other hand
letting it be redundant made all of the complexity kind of evaporate.
Add to that that we're now building a little deep list and then
flattening it, and this logic was able to get really neat in a way that
I couldn't work out a year ago.
2025-02-26 12:00:12 +11:00
SpiveeWorks
c27005c424 Rename 'flatten' and so on to 'annotate' 2025-02-26 12:00:06 +11:00
SpiveeWorks
ad7be7c8db Break up prepare_aaci logic
Now we convert the ACI into trees of opaque types, then flatten the tree
into a map and a list of function specs, and only then dereference the
types in the function specs down to our accelerated annotated types.
2025-02-26 11:59:58 +11:00
SpiveeWorks
7eb29827a6 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-02-26 11:59:52 +11:00
SpiveeWorks
4441f6ff37 Also prepare AACI for namespace types 2025-02-26 11:59:45 +11:00
SpiveeWorks
04311f9c99 Even more unit tests
Trying to test all the basic types that coerce covers, and a couple more
type parameter and nested cases.
2025-02-26 11:59:34 +11:00
SpiveeWorks
cf8970dad2 Add unit tests for some simple coercions 2025-02-26 11:59:33 +11:00
e53da36f2e Update deps and verup 2025-02-25 10:06:12 +09:00
5fdf1de4ef Adjustments 2025-02-25 10:00:14 +09:00
b69ababf0f Remove oracles, update deps (except sophia) 2025-01-23 23:51:18 +09:00
06fc0ac403 WIP: Adding contract_create_built/3 2024-12-09 15:00:21 +09:00
dbf4f6bdb2 Updates necessary for the nwe poop 2024-11-12 18:52:08 +09:00
3f80b11d63 Initial 2024-03-27 14:45:50 +09:00