Commit Graph

108 Commits

Author SHA1 Message Date
microproofs
a86f08c6d1 update tests for new trace reduction 2023-10-07 19:42:24 -04:00
KtorZ
524d0dadf5 Add compiler's version to blueprint. 2023-10-06 14:17:55 +02:00
microproofs
8a1c824dd7 chore: add specific error for when the validator returns false 2023-10-04 11:08:22 -04:00
microproofs
83f0dd2cbe chore: fix blueprint validator tests 2023-09-29 17:47:39 -04:00
microproofs
47596f0324 feat: Remove tuple_index and record_access in favor of faster more direct functions for
accessing an item in a tuple or a field in a record
2023-09-28 01:05:05 -04:00
microproofs
1bcc9e8524 fix: expect on tuples from data now checks for no more items after the last 2023-09-26 12:49:50 -04:00
rvcas
7b915b7dcf chore: allow clippy::arc_with_non_send_sync in tests 2023-09-13 19:07:45 -04:00
rvcas
d808197507 chore: clippy fix 2023-09-13 18:17:59 -04:00
KtorZ
961e323c36 Enable iterating over validator's parameters with a callback
This is how we'll construct parameters interactively. We need to lookup the definition, and provide a data representation for it.
2023-08-19 13:39:39 -04:00
microproofs
90c7753201 update tests for new recursion optmization 2023-08-07 19:00:39 -04:00
microproofs
36c80f36c1 fix tests 2023-08-07 12:02:44 -04:00
rvcas
8a7df7f66b test: add empty list test 2023-07-04 17:19:29 -04:00
Pi Lanningham
4a8cb72708 Add a blueprint policy command
Computes the policy ID of a minting policy; added guards for blueprint address to check that it's not a minting policy; Wasn't 100% sure where the errors should live, so I'm happy to move them if there's objections
2023-07-01 16:17:10 -04:00
microproofs
db369da96e feat: Make traces produced by expect dependent on
the value of the tracing flag.
2023-06-23 14:03:23 -04:00
rvcas
cf6d04e95b chore: some clippy warnings 2023-06-02 19:47:52 -04:00
rvcas
9c29f4f26b fix: blueprints gen failing on List
closes #569

* added new methods to Definitions
  it doesn't use expect
* lookup was failing for the special map/pair case
  when resolving list generics

Co-authored-by: Pi <pi@sundaeswap.finance>
2023-06-02 17:53:10 -04:00
microproofs
deee50b77e fix: just change as_key
Co-authored-by: Lucas Rosa <x@rvcas.dev>
2023-05-31 00:27:31 -04:00
microproofs
a6807f0bfb fix: seems like definition lookups weren't working
Co-authored-by: Lucas Rosa <x@rvcas.dev>
2023-05-31 00:18:05 -04:00
microproofs
b36cf1c029 chore: refactor default functions in uplc_code_gen.
feat: Add an identity optimization to remove functions that return the argument only.
2023-05-08 16:15:09 -04:00
microproofs
0d0c96deda commit validator changes and tests 2023-04-28 17:05:46 -04:00
microproofs
b050018a37 test fix: blueprint change 2023-04-25 02:06:56 -04:00
microproofs
9bb1a88f23 fix: expect [] on a non-empty list now fails. 2023-04-21 17:39:21 -04:00
microproofs
c2ee631d07 feat: new setup for the gen_uplc testing
* new test only module aiken_project::tests
* move TestProject to tests/mod.rs
* new tests go in gen_uplc.rs
2023-04-19 16:08:55 -04:00
microproofs
23a7e7e680 chore: convert acceptance test 5
Also constructors with no fields are now converted to a constant data term.
2023-04-19 16:08:55 -04:00
microproofs
022d557906 chore: convert acceptance test 4 2023-04-19 16:08:55 -04:00
microproofs
7da3ac2c99 chore: convert acceptance test 3 2023-04-19 16:08:55 -04:00
microproofs
7dd13f8d73 feat: add end to end tests to replace acceptance tests with strict uplc comparison.
Add acceptance tests 1,2, 6 as end to end tests
2023-04-19 16:08:55 -04:00
Kasey White
02d57cc076 tests pass now after adding in final wrapper as air elements 2023-04-09 17:43:56 -04:00
Kasey White
9e95e24624 now tests are passing 2023-04-09 17:43:56 -04:00
Kasey White
4d97719e6d update blueprint tests with new hashes and script outputs 2023-04-09 17:43:56 -04:00
Kasey White
abd97f0ade changed assert_on_list from being defined at uplc level to being defined at air level to enable proper hoisting 2023-04-09 17:43:56 -04:00
KtorZ
4799af3242 Rework 'blueprint apply' command and wrap up wiring up validation.
The apply command now works only from a serialized CBOR data (instead of a UPLC syntax). So it is no longer possible to specify arbitrary cbor terms through the CLI. I believe it to be an acceptable limitation for now; especially given that Aiken will never generate blueprints with non-data terms at the interface boundary.
2023-04-08 08:57:40 +02:00
KtorZ
bf222a3ea2 Fix reference JSON deserialization. 2023-04-08 08:57:40 +02:00
KtorZ
c18deecdc8 Show slightly better schema mismatch errors
Display terms as CBOR diagnostic when they are Plutus data.
2023-04-08 08:57:38 +02:00
KtorZ
176cb45524 Factor out error (schema mismatch) creation during blueprint validation. 2023-04-08 08:57:04 +02:00
KtorZ
7d6612b108 Rework parameter validation to work from 'Constant' instead of 'Term'
This simplifies the code and makes it more efficient as we no longer need to wrap and unwrap constant terms constantly.
2023-04-08 08:57:03 +02:00
KtorZ
d58ef1a079 Implement blueprint schema & data validations. 2023-04-08 08:57:03 +02:00
KtorZ
ee220881b6 Generalize schema definition to work from inline schema or reference. 2023-04-08 08:57:03 +02:00
KtorZ
d620f6367c Bootstrap schema validation for simple constants. 2023-04-08 08:57:03 +02:00
KtorZ
f311e048b7 Improve error message on 'ParameterizedValidator'. 2023-04-08 08:57:01 +02:00
KtorZ
cdc7ebf9a0 Remove now-unnecessary blueprint generics.
These were needed before as a way to _partially deserialize_
  blueprints. Indeed, some commands required accessing information of
  the blueprint, but not necessarily the schema. So out of laziness (or
  cleverness?), we only deserialized validators as serde::Value and
  achieved that through the use of generics.

  Now that validators and schemas have proper deserialisers, we can
  simply deserialize a blueprint.

  TODO: Our serialisation/deserialisation is safe with regards to
  itself; i.e. it roundtrips. However, we only supports a subset of the
  specified blueprint format. For example, we would fail to deserialize
  blueprints that have inline data-schemas (we only use references).
2023-04-08 08:53:51 +02:00
KtorZ
f0d2d20a4c Impl JSON deserialization for blueprint's 'Schema'. 2023-04-08 08:53:51 +02:00
KtorZ
565c0bea74 Write JSON deserializers for Reference, Constructors, Items and Data.
This is needed in order to deserialize a JSON blueprint and use it to perform validation.
  Still TODO:

  - [ ] Write JSON deserializer for 'Schema'

  Which should now be relatively straightforward.
2023-04-08 08:53:49 +02:00
rvcas
1444c9328d fix some typos 2023-04-07 16:51:18 -04:00
rvcas
3e6f688e2d feat: refactor some methods and modules
* move uplc::ast::builder to uplc::builder
* rename aiken_lang::uplc to aiken_lang::gen_uplc
* move aiken_lang::air and aiken_lang::builder to aiken_lang::gen_uplc
  as submodules

Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2023-03-27 20:00:32 -04:00
KtorZ
bc690c5410 Generated wrapped schemas for multi-validators' redeemers 2023-03-17 18:40:49 -04:00
Kasey White
bb6fc76971 start on registering redeemer wrapper type in definitions 2023-03-17 18:40:49 -04:00
KtorZ
7e1403a3b2 Complete generation of blueprint multi-validators. 2023-03-17 18:40:49 -04:00
Kasey White
fe92b27d50 start on refactoring validator to support multi-validators in blueprint 2023-03-17 18:40:49 -04:00
KtorZ
61113cd7b9 distinguish between multi vs single validator case in blueprint schema generation. 2023-03-17 18:40:48 -04:00