-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix remaining acceptance tests to be V3-compatible
- Loading branch information
Showing
59 changed files
with
357 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ version = "0.0.0" | |
|
||
[[dependencies]] | ||
name = 'aiken-lang/stdlib' | ||
version = 'main' | ||
version = 'v2' | ||
source = 'github' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,42 @@ | ||
use aiken/dict | ||
use aiken/list | ||
use aiken/transaction.{Output, OutputReference, ScriptContext} | ||
use aiken/transaction/value.{PolicyId} | ||
use aiken/collection/dict | ||
use aiken/collection/list | ||
use cardano/assets.{PolicyId} | ||
use cardano/transaction.{Output, OutputReference, Transaction} | ||
|
||
const my_policy_id: PolicyId = #"0000000000" | ||
|
||
pub fn has_policy_id(self: Output, policy_id: PolicyId) -> Bool { | ||
self.value | ||
|> value.tokens(policy_id) | ||
|> assets.tokens(policy_id) | ||
|> dict.is_empty | ||
|> not | ||
} | ||
|
||
validator foo { | ||
spend(_datum: Data, _redeemer: Data, o_ref: Data, tx: Transaction) -> Bool { | ||
ctx.transaction.outputs | ||
spend(_datum: Option<Data>, _redeemer: Data, _o_ref: Data, self: Transaction) { | ||
self.outputs | ||
|> list.any(has_policy_id(_, my_policy_id)) | ||
} | ||
|
||
else(_) { | ||
fail | ||
} | ||
} | ||
|
||
validator bar(output_reference: OutputReference) { | ||
mint(_redeemer: Void, _policy_id: Data, tx: Transaction) -> Bool { | ||
mint(_redeemer: Void, _policy_id, self: Transaction) { | ||
when | ||
list.find( | ||
ctx.transaction.inputs, | ||
self.inputs, | ||
fn(input) { input.output_reference == output_reference }, | ||
) | ||
is { | ||
Some(_) -> True | ||
None -> False | ||
} | ||
} | ||
|
||
else(_) { | ||
fail | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.