rvcas
ccc450659a
chore: switch discharge value back to the recursive form for simplicity
2023-04-13 01:28:27 -04:00
microproofs
564939ab61
feat
...
* remove more Rc's
* reconstruct Value::Builtin only when needed
Co-authored-by: Lucas Rosa <x@rvcas.dev>
2023-04-13 01:28:27 -04:00
microproofs
09a6ea51d6
feat(machine): reduce term allocations
...
* remove term from VBuiltin
* and also means we don't need the useless wrapping
Co-authored-by: Lucas Rosa <x@rvcas.dev>
2023-04-13 01:28:27 -04:00
rvcas
70f12d3fc5
chore: new branch with some things from the bumpalo branch
2023-04-13 01:28:27 -04:00
microproofs
fc1b8738df
fix: fixed how the ir was generating for expect Void, expect Bool, let Void
...
add some acceptance tests for the various scenarios
2023-04-12 22:37:33 -04:00
Matthias Benkort
280284d4a1
Merge pull request #456 from aiken-lang/clause-guard-wildcard-pattern
...
Add new failing test case for 048 (clause guards)
2023-04-12 08:40:16 +02:00
Kasey White
1e35281650
clause guard with discard is now handled
2023-04-12 08:26:03 +02:00
KtorZ
0846fe2d5f
Add new failing test case for 048 (clause guards)
...
It seems like we don't properly handle clause guards for wildcard
patterns. Seems like a codegen issue here as the code type-check
properly.
2023-04-12 08:24:18 +02:00
Kasey White
ff290bc582
add expect false test
2023-04-09 17:43:56 -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
e69a70f49c
remove final wrapper and replace with equivalent 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
efb901f3b4
fix: issue with modifying a functions dependencies and adding a function that depended on it causing infinite loops
2023-04-09 17:43:56 -04:00
Kasey White
a17ebf301f
fix: now we monomorphize __expect_type functions
2023-04-09 17:43:56 -04:00
Kasey White
9d9f8a914a
fix generics causing a free unique due to ordering in expect_type
2023-04-09 17:43:56 -04:00
Kasey White
581c86ed83
chore: commented code removal
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
8d81345fb1
fix: diff_defined_types was not being filled if constructor had 0 args
2023-04-09 17:43:56 -04:00
Kasey White
897011e9bc
misc changes
2023-04-09 17:43:56 -04:00
Kasey White
f8483da4e0
Code gen now handles expecting on validator args in the air stack.
...
Thus allowing us to use code gen created functions to expect on data types including recursive ones.
Some minor tweaks to the air.
Added a uplc optimization for later.
2023-04-09 17:43:56 -04:00
Kasey White
4e4eed13e1
refactor define_ir_recurse to use let else
2023-04-09 17:43:56 -04:00
Kasey White
4ff0504d58
feat: change define_ir_processor to handle code_gen_functions
...
Also flattened out that function by using let else
2023-04-09 17:43:56 -04:00
Kasey White
bc7b07c1d9
fix: expect_type now works on recursice constructors and validator args are now handled by air
2023-04-09 17:43:56 -04:00
Kasey White
a1b3ae52d8
fix: optimization that was being ignored
2023-04-09 17:43:56 -04:00
Kasey White
6c932bb562
expect on map and list now use a function that gets instantiated as air in code gen functions
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
Kasey White
f4ba6b8985
fix: unused validator args had an incorrect if check
2023-04-09 17:43:56 -04:00
Kasey White
3f45b524b8
feat: unused validator args are not expect checked
2023-04-09 17:43:56 -04:00
Kasey White
8c8312a412
fix: expect true was always expecting false
2023-04-09 17:43:56 -04:00
Kasey White
ddf0fbfa0a
fix: expect void now checks for unit instead of expecting data
...
Args in validator are now fully expected on.
Add new air FieldsEmpty to make checking for empty constructors easier
2023-04-09 17:43:56 -04:00
KtorZ
23b72e18f3
Add new acceptance test scenario: expect unary constructors.
...
```
Error:
× Main thread panicked.
├─▶ at crates/aiken-lang/src/gen_uplc.rs:1852:33
╰─▶ called `Option::unwrap()` on a `None` value
```
2023-04-09 17:43:56 -04:00
KtorZ
5bdf9053cf
[create-pull-request] automated change
2023-04-08 10:16:09 -04:00
Matthias Benkort
ee8509956d
Merge pull request #477 from aiken-lang/blueprint-json-deserializers
...
Blueprint schema validation
2023-04-08 10:26:11 +02: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
9033b44044
Implement quick builder on PlutusData.
...
In the same spirit of the existing Term builder; I also added a `data`
method to lift a `PlutusData` into a `Term<T>` and generalized a bit
the builder to only require a `Term<Name>` when necessary and remain
generic otherwise.
The `PlutusData` builder could potentially be upstreamed to pallas
diretly.
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
9d2d99ed02
[create-pull-request] automated change
2023-04-07 21:16:55 -04:00
dependabot[bot]
9a73535610
chore(deps): bump openssl from 0.10.45 to 0.10.49
...
Bumps [openssl](https://github.com/sfackler/rust-openssl ) from 0.10.45 to 0.10.49.
- [Release notes](https://github.com/sfackler/rust-openssl/releases )
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.45...openssl-v0.10.49 )
---
updated-dependencies:
- dependency-name: openssl
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 17:21:51 -04:00
rvcas
1444c9328d
fix some typos
2023-04-07 16:51:18 -04:00
rvcas
d0d482b3cb
chore(gift_card): run fmt
2023-04-07 16:35:58 -04:00