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:
13
examples/acceptance_tests/036/aiken.lock
Normal file
13
examples/acceptance_tests/036/aiken.lock
Normal 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"
|
||||
6
examples/acceptance_tests/036/aiken.toml
Normal file
6
examples/acceptance_tests/036/aiken.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
name = "aiken-lang/acceptance_test_036"
|
||||
version = "0.0.0"
|
||||
|
||||
dependencies = [
|
||||
{ name = "aiken-lang/stdlib", version = "6b482fa00ec37fe936c93155e8c670f32288a686", source = "github" },
|
||||
]
|
||||
18
examples/acceptance_tests/036/validators/spend.ak
Normal file
18
examples/acceptance_tests/036/validators/spend.ak
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user