Add new acceptance test scenario: 036

```
  Error:
    × Main thread panicked.
    ├─▶ at /Users/ktorz/Documents/Projects/aiken-lang/aiken/crates/aiken-
    │   project/src/lib.rs:567:36
    ╰─▶ called `Result::unwrap()` on an `Err` value: FreeUnique(Name { text:
        "_not", unique: Unique(17) })
  ```
This commit is contained in:
KtorZ
2022-12-29 12:11:55 +01:00
parent 1701cacb52
commit 4f83d4fa1b
5 changed files with 45 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
# This file was generated by Aiken
# You typically do not need to edit this file
[[requirements]]
name = "aiken-lang/stdlib"
version = "6b482fa00ec37fe936c93155e8c670f32288a686"
source = "github"
[[packages]]
name = "aiken-lang/stdlib"
version = "6b482fa00ec37fe936c93155e8c670f32288a686"
requirements = []
source = "github"

View File

@@ -0,0 +1,6 @@
name = "aiken-lang/acceptance_test_036"
version = "0.0.0"
dependencies = [
{ name = "aiken-lang/stdlib", version = "6b482fa00ec37fe936c93155e8c670f32288a686", source = "github" },
]

View File

@@ -0,0 +1,18 @@
use aiken/dict
use aiken/list
use aiken/transaction.{Output, ScriptContext}
use aiken/transaction/value.{PolicyId}
const my_policy_id: PolicyId = #[0, 0, 0, 0, 0]
pub fn has_policy_id(self: Output, policy_id: PolicyId) -> Bool {
self.value
|> value.tokens(policy_id)
|> dict.is_empty
|> not
}
pub fn spend(_datum, _redeemer, ctx: ScriptContext) -> Bool {
ctx.transaction.outputs
|> list.any(has_policy_id(_, my_policy_id))
}