Skip to content

Commit

Permalink
update to v1.0.28-alpha+c9a1519
Browse files Browse the repository at this point in the history
  • Loading branch information
acedward committed Sep 12, 2024
1 parent 53f8840 commit 596e757
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions cardano/aiken.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

[[requirements]]
name = "aiken-lang/stdlib"
version = "1.6.0"
version = "1.9.0"
source = "github"

[[packages]]
name = "aiken-lang/stdlib"
version = "1.6.0"
version = "1.9.0"
requirements = []
source = "github"

Expand Down
2 changes: 1 addition & 1 deletion cardano/aiken.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ platform = "github"

[[dependencies]]
name = "aiken-lang/stdlib"
version = "1.6.0"
version = "1.9.0"
source = "github"
32 changes: 16 additions & 16 deletions cardano/validators/hololocker.ak
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,17 @@ validator {

let mint = from_minted_value(mint)

let minted_assets =
let minted_assets: List<Pair<ByteArray, Int>> =
mint
|> value.tokens(policy_id)
|> dict.to_list()
|> dict.to_pairs()

when redeemer is {
BurnTokens ->
list.all(
minted_assets,
fn(asset) {
let (_, amount) = asset
let Pair(_, amount) = asset
amount == -1
},
)
Expand Down Expand Up @@ -285,22 +285,22 @@ fn check_partial_withdraw_outputs(
expect State { status, .. }: State = remainder_datum
expect status == Locked
// make sure no ADA is added to the state machine when unlocking
expect [(in_ada_policy, in_ada_amount), ..in_rest_values] =
expect [Pair(in_ada_policy, in_ada_amount), ..in_rest_values] =
input_value
|> to_dict
|> dict.to_list
|> dict.to_pairs

expect Some(in_ada_quantity) = dict.get(in_ada_amount, ada_token_name)

expect [(rem_ada_policy, rem_ada_amount), ..] =
expect [Pair(rem_ada_policy, rem_ada_amount), ..] =
rem_value
|> to_dict
|> dict.to_list
|> dict.to_pairs

expect [(out_ada_policy, out_ada_amount), ..] =
expect [Pair(out_ada_policy, out_ada_amount), ..] =
out_value
|> to_dict
|> dict.to_list
|> dict.to_pairs

expect Some(out_ada_quantity) = dict.get(out_ada_amount, ada_token_name)
expect Some(rem_ada_quantity) = dict.get(rem_ada_amount, ada_token_name)
Expand All @@ -316,7 +316,7 @@ fn check_partial_withdraw_outputs(
|> without_lovelace
|> merge(rem_value_no_ada)
|> to_dict
|> dict.to_list
|> dict.to_pairs

// Check other values have value conserved
expect in_rest_values == total_value_no_ada
Expand All @@ -333,17 +333,17 @@ fn check_full_withdraw_outputs(

let Output { address: out_address, value: out_value, .. } = unlocking_output

expect [(in_ada_policy, in_ada_amount), ..in_rest_values] =
expect [Pair(in_ada_policy, in_ada_amount), ..in_rest_values] =
input_value
|> to_dict
|> dict.to_list
|> dict.to_pairs

expect Some(in_ada_quantity) = dict.get(in_ada_amount, ada_token_name)

expect [(out_ada_policy, out_ada_amount), ..out_rest_values] =
expect [Pair(out_ada_policy, out_ada_amount), ..out_rest_values] =
out_value
|> to_dict
|> dict.to_list
|> dict.to_pairs

expect Some(out_ada_quantity) = dict.get(out_ada_amount, ada_token_name)

Expand All @@ -362,14 +362,14 @@ fn check_full_withdraw_outputs(
// Alternatively allow for token burning
// Otherwise fail
fn check_mint_to_output_datums(
minted_assets: List<(ByteArray, Int)>,
minted_assets: List<Pair<ByteArray, Int>>,
outputs: List<Output>,
expected_assets: List<ByteArray>,
validator_cred: PaymentCredential,
) -> Bool {
when minted_assets is {
[] -> True
[(minted_asset_name, quantity), ..rest_assets] ->
[Pair(minted_asset_name, quantity), ..rest_assets] ->
if quantity == 1 {
// 1) ensure the expected asset exists
expect
Expand Down

0 comments on commit 596e757

Please sign in to comment.