Commit Graph

476 Commits

Author SHA1 Message Date
rvcas be7c0c8012
fix: withdraw kinda 2024-08-25 16:20:06 +02:00
rvcas 3aa9e0c4b7
chore: run fmt on mint 2024-08-25 16:20:05 +02:00
rvcas 3fac7002d4
feat: switch mint to new def 2024-08-25 16:20:05 +02:00
microproofs 953ee6b5d1
Fix ordering for ScriptInfo type 2024-08-25 16:20:05 +02:00
KtorZ 823492c27b
Adjust v3 script context end-to-end tests to work with new syntax. 2024-08-25 16:20:04 +02:00
rvcas 03a348040b
chore: convert hello_world to v3 2024-08-25 16:20:04 +02:00
KtorZ 35b7066163
Introduce acceptance test 107 illustrating compiler crash
```
  crates/aiken-lang/src/gen_uplc.rs:4515:30

      internal error: entered unreachable code: Shouldn't call anything other than var or apply

      Lambda {
          parameter_name: Name {
              text: "__no_inline__",
              unique: Unique(
                  0,
              ),
          },
          body: Var(
              Name {
                  text: "tests_new_list_unbound",
                  unique: Unique(
                      0,
                  ),
              },
          ),
      }
  ```
2024-08-21 14:43:08 +02:00
KtorZ 520ceff83d
Do not ignore ctx/inputs.cbor; it is used/needed by the test runner. 2024-08-14 03:09:45 +02:00
KtorZ b104356fb9
(temporarily) make script context tests more verbose. 2024-08-14 03:02:40 +02:00
KtorZ f879f6d183
Fix script context translations for withdrawals and validity intervals. 2024-08-13 23:43:47 +02:00
KtorZ 5067aad0d8
Fix 'Pair' formatter inside forced unbroken components. 2024-08-13 17:05:41 +02:00
KtorZ 7501538053
Add script context translations for voting purpose. 2024-08-13 16:24:01 +02:00
KtorZ bfc93bf076
Add script context translation for new Conway certificates 2024-08-13 10:56:29 +02:00
KtorZ f244b9c496
Add support for protocol parameters (except cost models)
We can now simulate transactions with protocol parameters voting
  procedures. Cost models remain to be done, though.
2024-08-13 10:56:29 +02:00
KtorZ 50dad1fdfe
Test proposal procedures through Aiken. 2024-08-13 10:56:29 +02:00
KtorZ 6b6bace8a5
test 'mint' purpose and script context creation.
Alongside a bunch of other stuff from the coverage list. In
  particular, the mint transaction contains:

  - reference inputs
  - multiple outputs, with assets, and type-0, type-1 and type-6
    addresses.
  - an output with a datum hash
  - an output with an inline script
  - carries an extra datum witness, preimage of the embedded hash
  - mint, with 2 policies purposely ordered wrongly, with 1 and 2
    assets purposely ordered wrong. One of the mint is actually a
    burn (i.e. negative quantity)
2024-08-13 10:56:29 +02:00
KtorZ eea8dc7d0a
Support multi-validator in script context accept test. 2024-08-13 10:56:28 +02:00
KtorZ 62b1b932f9
Write down first e2e script context test for v3. 2024-08-13 10:56:28 +02:00
KtorZ 821f7bd8c7
Fix ToPlutusData serializer for V3
This is intense, as we still want to preserve the serializer for V1 &
  V2, and I've tried as much as possible to avoid polluting the
  application layer with many enum types such as:

  ```
  pub enum TxOut {
    V1(TransactionOutput),
    V2(TransactionOutput),
    V3(TransactionOutput),
  }
  ```

  Those types make working with the script context cumbersome, and are
  only truly required to provide different serialisation strategies. So
  instead, we keep one top-level `TxInfo V1/V2/V3` type, and we ensure
  to pass serialization strategies as type wrappers.

  This way, the strategy propagates through the structure up until it's
  eliminated when it reaches the relevant types.

  All-in-all, this strikes a correct balance between maintainability and
  repetition; and it makes it possible to define _different but mostly
  identical_ encoders for the various versions.

  With it, I've been able to successfully encode a V3 script context and
  match it against one produced using the Haskell libraries. More to
  come.
2024-08-13 10:55:23 +02:00
KtorZ 0dec4dc533
Move script context e2e tests under a nested 'v2' directory.
And rework scripts to run them in anticipation of new v3 contexts.
2024-08-13 10:55:21 +02:00
microproofs 72059eacee
Fix: Recursion issue where the static param optimization on recursive functions that were passed as arguments to other functions 2024-08-08 19:36:16 -04:00
KtorZ 6e4a16d8e0
Illustrate new failing scenario with multi-arg function identifiers
As far as I could tell, this behavior is only observed when the arity
  of the function is higher than 1. It's fine for single-arg functions
  somehow.
2024-08-08 14:52:19 -04:00
microproofs 53c461294b Fix example that was throwing an error 2024-08-08 00:39:44 -04:00
microproofs 0a1992acd2 Run acceptance tests 2024-08-08 00:39:44 -04:00
microproofs 8a461d5bd5 Few minor changes, clippy fixes, and test fixes 2024-08-08 00:39:44 -04:00
KtorZ 9ea54afd12 Add on more example illustrating if/is issue. 2024-08-08 00:39:44 -04:00
KtorZ c4abf2e8f4 Add acceptance test 106 showing issue with if/is implicit casting. 2024-08-08 00:39:44 -04:00
KtorZ bf5a406ffb Remove clause guards.
Closes #886.
2024-08-02 00:16:27 -04:00
microproofs 1001e83374
Updated acceptance test runs 2024-07-24 10:34:29 -04:00
microproofs dfce9c1d96
feat: Add multivalidator as an AIR tree opcode.
feat: Add uplc eval optimization
2024-07-24 10:00:08 -04:00
KtorZ fe7d744946
Split continuous workflow in three jobs.
Doing all steps sequentially is starting to get long. Several of those checks are unrelated and can be done in parallel.
2024-07-16 17:41:14 +02:00
microproofs f1cfc84e67 Fix tree traversal node selection for a few of the enum variants 2024-06-25 18:50:00 -04:00
rvcas 7da35d5d73 chore: add acceptance tests for if/is 2024-06-25 18:50:00 -04:00
KtorZ 858dfccc82
Authorize complete patterns as function args.
This is mainly a syntactic trick/sugar, but it's been pretty annoying
  to me for a while that we can't simply pattern-match/destructure
  single-variant constructors directly from the args list. A classic
  example is when writing property tests:

  ```ak
  test foo(params via both(bytearray(), int())) {
    let (bytes, ix) = params
    ...
  }
  ```

  Now can be replaced simply with:

  ```
  test foo((bytes, ix) via both(bytearray(), int())) {
    ...
  }
  ```

  If feels natural, especially coming from the JavaScript, Haskell or
  Rust worlds and is mostly convenient. Behind the scene, the compiler
  does nothing more than re-writing the AST as the first form, with
  pre-generated arg names. Then, we fully rely on the existing
  type-checking capabilities and thus, works in a seamless way as if we
  were just pattern matching inline.
2024-06-07 15:42:25 +02:00
KtorZ e1f39ae539
Oversight: fix missing 'AList' -> 'Pairs' conversion. 2024-05-23 17:08:33 +02:00
KtorZ 5ce30b2632
Rename AList -> Pairs due to popular demand. 2024-05-23 16:45:40 +02:00
microproofs 3d06129d9b add test for curry optimization that is a reduced case of #945 2024-05-22 15:46:32 -04:00
rvcas c1a913f420
fix(config): add default for plutus version 2024-05-22 13:59:56 -04:00
microproofs c1c2cd97b7 New test 103 and clippy fixes 2024-05-21 11:56:12 -04:00
KtorZ b546e42766
FML. 2024-05-14 15:27:08 +02:00
KtorZ 8881a88ae3
Also fix multi-validator for gift_card. 2024-05-14 13:28:24 +02:00
KtorZ ff0407a245
Fix stdlib adjustment in gift_card. 2024-05-14 10:44:48 +02:00
KtorZ 6d7b851c70
Fix 077 after yet-another-breaking-change in stdlib. 2024-05-10 19:05:00 +02:00
Dima S 8a6957dfd0 Update fresh 2024-05-10 10:37:35 -04:00
microproofs 893e9c9855 activate test 75 2024-05-06 15:17:01 -04:00
KtorZ 967f4348ed Add new acceptance test 101 capturing type mismatch at runtime. 2024-05-06 15:17:01 -04:00
KtorZ 0a660c6a21 Add new acceptance test illustrating need for fn call ordering 2024-05-06 15:17:01 -04:00
KtorZ 99c35a6459 Add now-necessary type-annotations in tests 2024-05-06 15:17:01 -04:00
microproofs 0e9baf4944 test should fail 2024-05-06 11:35:55 -04:00
microproofs 2f61f59b60 Closes #909 2024-05-06 11:35:05 -04:00