1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 14:13:27 +03:00
juvix/tests/Anoma/Compilation/positive
Paul Cadman 8d03ac2b6c
Add anoma-bytearray-{to, from}-anoma-contents builtins (#2960)
The `anoma-bytearray-{to, from}-anoma-contents` are intended to be used
to convert to/from atoms representing `ByteArrays`. These builtins are
required temporarily until Anoma Node makes ByteArray representation
uniform across all of its APIs.

We represent ByteArrays in nock as a cell:

```
[size contents]
```

Where `size` is the size of the ByteArray and `contents` is an Atom
representing the bytes in LSB ordering.

The `size` is required in general because the encoding of ByteArrays to
Atoms is ambiguous. For example the ByteArrays [0x01; 0x00] and [0x01]
are represented by `1`.

Some Anoma ByteArrays like keys and signatures are represented using on
the `contents` atom because the size is constant.

Users of Anoma APIs have to strip / add size information from ByteArrays
depending on where the data is used. The new builtins provide this
facility.

These builtins are temporary because it's been agreed with Anoma
engineering team to change the Anoma APIs to make the ByteArray
representation uniform, i.e always represent ByteArrays using `[size
content]`. When this is implemented in Anoma Node we can remove these
builtins.

```
builtin anoma-bytearray-to-anoma-contents
axiom toAnomaContents : ByteArray -> Nat;

builtin anoma-bytearray-from-anoma-contents
axiom fromAnomaContents :
  -- | The size of the ByteArray
  Nat
  -- | The contents of the ByteArray
  -> Nat
  -- | The resulting ByteArray
  -> ByteArray;
```
2024-08-19 11:19:26 +02:00
..
test066 Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test072 Migrate old named application syntax (#2876) 2024-07-12 18:31:09 +02:00
test073 Migrate old named application syntax (#2876) 2024-07-12 18:31:09 +02:00
Package.juvix Migrate old named application syntax (#2876) 2024-07-12 18:31:09 +02:00
test001.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test002.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test003.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test005.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test006.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test007.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test008.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test009.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test010.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test011.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test012.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test013.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test014.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test015.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test016.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test017.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test018.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test019.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test020.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test021.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test022.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test023.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test024.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test025.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test026.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test028.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test029.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test030.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test031.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test032.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test033.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test034.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test035.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test036.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test037.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test038.juvix Optional braces in case syntax (#2778) 2024-05-22 18:14:03 +01:00
test039.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test040.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test041.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test043.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test045.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test046.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test047.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test049.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test050.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test052.juvix Optional braces in case syntax (#2778) 2024-05-22 18:14:03 +01:00
test053.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test054.juvix Update juvix-stdlib to include Foldable and Functor traits (#2932) 2024-07-31 15:13:27 +02:00
test055.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test056.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test057.juvix Optional braces in case syntax (#2778) 2024-05-22 18:14:03 +01:00
test058.juvix Improve specialization optimization (#2944) 2024-08-14 10:04:30 +02:00
test059.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test060.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test061.juvix Update juvix-stdlib to include Foldable and Functor traits (#2932) 2024-07-31 15:13:27 +02:00
test062.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test063.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test064.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test065.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test067.juvix Migrate old named application syntax (#2876) 2024-07-12 18:31:09 +02:00
test068.juvix Support compilation to Anoma compatible functions (#2652) 2024-02-23 12:54:22 +00:00
test069.juvix Migrate old named application syntax (#2876) 2024-07-12 18:31:09 +02:00
test070.juvix Migrate old named application syntax (#2876) 2024-07-12 18:31:09 +02:00
test071.juvix Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
test074.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test075.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test076.juvix Update juvix-stdlib to remove non-ASCII indentifiers (#2857) 2024-06-26 10:23:35 +02:00
test077.juvix Use ByteArray for Anoma cryptographic builtins (#2947) 2024-08-13 13:17:57 +01:00
test078.juvix Use ByteArray for Anoma cryptographic builtins (#2947) 2024-08-13 13:17:57 +01:00
test079.juvix Add support for Strings in the Anoma backend (#2789) 2024-05-28 17:20:19 +01:00
test080.juvix Support Anoma representation of Maybe (#2856) 2024-06-26 12:39:36 +01:00
test081.juvix Add support for unsigned 8-bit integer type Byte (#2918) 2024-08-02 07:43:24 +01:00
test082.juvix Add builtin ByteArray type (#2933) 2024-08-13 11:13:27 +01:00
test083.juvix Add anoma-bytearray-{to, from}-anoma-contents builtins (#2960) 2024-08-19 11:19:26 +02:00