Commit Graph

71 Commits

Author SHA1 Message Date
KtorZ
eea8dc7d0a Support multi-validator in script context accept test. 2024-08-13 10:56:28 +02:00
KtorZ
b158469144 Improve / fix machine and uplc error reporting. 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
fdf7a81288 implement a strict subset of PlutusV3 transaction info
More specifically, that is simply mimicking the script context from
  v2, minus the new governance features.
2024-08-13 10:55:23 +02:00
KtorZ
c454dc72eb Actually decode Conway transaction in 'aiken tx simulate' 2024-08-13 10:55:22 +02:00
KtorZ
445ffc483d Further remove todos for v3, and reduce duplication in transaction evaluation 2024-08-13 10:55:22 +02:00
KtorZ
ff4a480242 Upgrade pallas to v0.0.29, and start support for simulating transactions carrying Plutus v3 scripts. 2024-08-13 10:55:22 +02:00
KtorZ
b28d4a6e9f Add input reference to ReferenceInputNotFound error.
Fixes #974.
2024-08-01 15:29:39 +02:00
hade
ad3c9f24b7 chore: minimal pallas dependencies 2024-05-30 15:09:05 +07:00
rvcas
3bc3792aa3 feat: add plutus version to aiken.toml
relates to #907
2024-05-21 17:02:20 -04:00
rvcas
589bb9a4b3 chore: change how we depend on pallas 2024-01-24 21:26:48 -05:00
KtorZ
0e2b8ae251 Bump pallas dependencies to include flat bigint patch
Fixes #796.
2024-01-18 18:26:21 +01:00
rvcas
0a1e0d7bee feat: remove flat-rs crate and use it through pallas_codec 2023-12-04 22:01:51 -05:00
rvcas
b17b7f287c chore: update to pallas v0.20.0 2023-12-04 21:44:19 -05:00
rvcas
90aea6476a feat: uplc g1 and g2 literal parsing 2023-11-15 15:55:56 -05:00
rvcas
2600937447 chore: cargo fmt 2023-08-16 22:56:22 -04:00
logicalmechanism
649039c993 tx simulate still need fee work 2023-08-16 22:37:00 -04:00
logicalmechanism
050c41c8dc tx simulate returns a vector of exbudgets now 2023-08-16 22:37:00 -04:00
microproofs
8af253e1df chore: make slot_to_begin_posix_time a public function 2023-08-11 20:05:22 -04:00
microproofs
93135cebbb fix: redeemers in the script context are sorted by redeemer ptr not data hash 2023-06-16 12:24:44 -04:00
rvcas
5e3a902c75 fix: add back some extra info on display 2023-03-17 09:35:10 -04:00
rvcas
bd7b8792bf feat: introduce EvalResult type 2023-03-08 10:19:36 +01:00
rvcas
4f1d14f2a0 feat: introduce miette into uplc 2023-03-08 10:19:35 +01:00
rvcas
8f765bfd52 fix: some breaking changes from pallas v0.18 2023-03-06 13:17:14 -05:00
KtorZ
014c7a3d73 Fix error display in tx simulate. 2023-02-15 09:42:46 +01:00
KtorZ
428b5f2b37 Align output of tx simulate with other Aiken's commands.
And also return a structured output as JSON, so it's more easily used
  by other tools.

  ```
       Parsing script context
    Simulating 78ec148ea647cf9969446891af31939c5d57b275a2455706782c6183ef0b62f1
      Redeemer Spend → 0

  {"mem":151993,"cpu":58180696}
  ```
2023-02-14 16:50:55 +01:00
KtorZ
34596b3084 Fix collecting withdrawal scripts in eval_phase_one
The current implementation assumed that ALL withdrawals present in a
  transaction had to be locked by a script and failed otherwise. But a
  transaction can actually be composed of both. So instead of failing,
  we should rather just ignore withdrawals that can't be referenced by
  redeemers.
2023-02-14 15:58:34 +01:00
alessandrokonrad
3012a0b41d Fix constructor tag range 2023-02-08 13:14:26 +01:00
rvcas
a365649360 chore: clippy autofix 2023-02-01 18:53:11 -05:00
rvcas
c89802eaed chore: bump pallas version 2023-01-06 13:39:18 -05:00
alessandrokonrad
3aba9baba5 Fixed reward account creation in ScriptContext 2023-01-05 10:31:32 -05:00
alessandrokonrad
c6b5380c27 Fixed ex unit budget limit per redeemer 2022-12-27 17:08:05 -05:00
jmhrpr
775e90d782 chore: remove unnecessary Option wrapper on type 2022-12-15 18:22:31 -05:00
jmhrpr
325a7b7b45 fix: correct V1 to_plutus_data() for txout with no datum hash 2022-12-15 18:22:31 -05:00
rvcas
f250d3df84 feat: eval should take initial budget 2022-12-08 19:24:20 -05:00
alessandrokonrad
af7ca87ffc Fixed more clippy issues 2022-11-04 18:21:22 +01:00
alessandrokonrad
9a2c6753cd Fixed clippy issues 2022-11-04 18:13:46 +01:00
alessandrokonrad
d1141f306a Sorted all relevant structures in ScriptContext 2022-11-04 17:58:23 +01:00
Kasey White
887f5eeee9 sorts inputs for sc 2022-11-03 05:04:21 -04:00
alessandrokonrad
c6de827721 added apply_params_to_script function 2022-10-22 18:01:36 -04:00
alessandrokonrad
e6f3c40429 changed i64 -> i128 2022-10-19 17:04:43 -04:00
alessandrokonrad
a14dae5863 changed slot_length to u32 2022-10-17 08:35:45 -04:00
alessandrokonrad
3256bfbc32 Wrapped errors in redeemer error 2022-09-26 16:33:52 -04:00
rvcas
08596588a7 feat: output total budget spent from cli 2022-09-24 20:23:51 -04:00
rvcas
8620332b75 feat: move input from json to helper method 2022-09-24 19:40:07 -04:00
Kasey White
3cb24a1d00 update test mem and cpu assertions for eval tx tests 2022-09-24 18:19:18 -04:00
alessandrokonrad
aa111f0a65 fixed slot 2022-09-25 00:01:01 +02:00
alessandrokonrad
35d09c642b fixed time conversion 2022-09-24 23:59:58 +02:00
alessandrokonrad
fb0af3cfcf fixed bugs 2022-09-24 17:47:07 -04:00