Signed-off-by: KtorZ <matthias.benkort@gmail.com>
This commit is contained in:
KtorZ 2025-03-06 13:05:12 +01:00
parent 4ee7a48aab
commit 56e2c195cf
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
6 changed files with 66 additions and 5 deletions

View File

@ -11,6 +11,7 @@
- **aiken-lang**: Prevent (type error) backpassing blocks with empty continuation. See [#1111](https://github.com/aiken-lang/aiken/issues/1111). @KtorZ
- **aiken-lang**: Change default placeholder for `trace` to `Void` instead of `todo`. @KtorZ
- **aiken-lang**: Disallow (parse error) dangling colon `:` in traces. See [#1113](https://github.com/aiken-lang/aiken/issues/1113). @KtorZ
- **aiken-lang**: Fix `aiken blueprint apply` wrongly overriding all validators handlers names & ABI to the mint's one. See [#1099](https://github.com/aiken-lang/aiken/issues/1099). @KtorZ
### Fixed

View File

@ -714,12 +714,13 @@ where
blueprint.validators = blueprint
.validators
.into_iter()
.map(|validator| {
.map(|mut validator| {
if prefix(&applied_validator.title) == prefix(&validator.title) {
applied_validator.clone()
} else {
validator
validator.program = applied_validator.program.clone();
validator.parameters = applied_validator.parameters.clone();
}
validator
})
.collect();

View File

@ -0,0 +1,9 @@
name = "aiken-lang/120"
version = "0.0.0"
license = "Apache-2.0"
description = "Aiken contracts for project 'aiken-lang/120'"
[repository]
user = "aiken-lang"
project = "120"
platform = "github"

View File

@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e
cd $(dirname "$0")
cargo run -r -- build
JSON=$(cargo run -r -- blueprint apply 43666F6F)
if [ $(jq -r ".validators[0].title" <<< $JSON) != "tests.my_script.mint" ]; then
echo "❌ invalid mint handler name"
exit 1
fi
if [ $(jq -r ".validators[1].title" <<< $JSON) != "tests.my_script.spend" ]; then
echo "❌ invalid spend handler name"
exit 1
fi
if [ $(jq -r ".validators[2].title" <<< $JSON) != "tests.my_script.else" ]; then
echo "❌ invalid else handler name"
exit 1
fi
if [ $(jq -r ".validators[0].hash" <<< $JSON) != $(jq -r ".validators[1].hash" <<< $JSON) ]; then
echo "❌ hash mismatch between mint and spend handlers"
exit 1
fi
if [ $(jq -r ".validators[1].hash" <<< $JSON) != $(jq -r ".validators[2].hash" <<< $JSON) ]; then
echo "❌ hash mismatch between spend and else handlers"
exit 1
fi

View File

@ -0,0 +1,13 @@
validator my_script(_param: ByteArray) {
mint(_redeemer: Int, _policy_id: Data, _self: Data) {
True
}
spend(_datum: Option<Int>, _redeemer: Bool, _utxo: Data, _self: Data) {
True
}
else(_) {
fail
}
}

View File

@ -21,7 +21,12 @@ if [ "$?" -eq "0" ]; then
if [ -z "$VALIDATORS" ]; then
echo "✅ $(basename $TARGET)"
else
if [ ! -f "$TARGET/assert.sh" ]; then
cargo run -r --quiet -- build $TARGET 1>$TMP 2>/dev/null
else
$TARGET/assert.sh 1>$TMP 2>/dev/null
fi
if [ "$?" -eq "0" ]; then
echo "✅ $(basename $TARGET)"
else