Skip to content

Commit

Permalink
chore: fix the formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas committed Aug 31, 2024
1 parent e4e79ba commit 8ac4ad4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
3 changes: 1 addition & 2 deletions lib/fortuna/utils.ak
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ pub fn value_has_nft_and_lovelace(
policy: PolicyId,
asset_name: AssetName,
) -> Bool {
expect [Pair(policy1, amount1),
Pair(policy2, amount2)] =
expect [Pair(policy1, amount1), Pair(policy2, amount2)] =
val
|> value.to_dict()
|> dict.to_pairs()
Expand Down
3 changes: 1 addition & 2 deletions lib/fortunav2.ak
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ pub fn genesis_v2(tx, own_policy, fortuna_v1_hash: Data, fork_script_hash: Data)
expect fork_script_hash: ByteArray = fork_script_hash

// 2 tokens minted
expect [Pair(_, 1),
Pair(_, 1)] =
expect [Pair(_, 1), Pair(_, 1)] =
mint
|> value.from_minted_value
|> tokens(own_policy)
Expand Down
22 changes: 8 additions & 14 deletions validators/tunav2.ak
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ validator(fortuna_v1_hash: Data, fork_script_hash: Data) {
let big_tuna_name =
bytearray.concat(fortunav2.big_tuna_prefix, spend_cred)

expect [Pair(token1, 1),
Pair(token2, 1)] = spend_value |> tokens(own_policy)
expect [Pair(token1, 1), Pair(token2, 1)] =
spend_value |> tokens(own_policy)

let in_token_name =
// By ledger rules we should only hit this first since token names
Expand Down Expand Up @@ -112,10 +112,8 @@ validator(fortuna_v1_hash: Data, fork_script_hash: Data) {
[]
} else {
[
Pair(
fortuna.token_name,
initial_payout / pow2(halving_exponent),
),
Pair(fortuna.token_name,
initial_payout / pow2(halving_exponent)),
]
}

Expand Down Expand Up @@ -363,19 +361,15 @@ validator(fortuna_v1_hash: Data, fork_script_hash: Data) {

if builtin.less_than_bytearray(minted, burned) {
[
Pair(
bytearray.concat(fortunav2.nominated_prefix, script_hash),
-1,
),
Pair(bytearray.concat(fortunav2.nominated_prefix, script_hash),
-1),
Pair(minted, 1),
Pair(burned, -1),
]
} else {
[
Pair(
bytearray.concat(fortunav2.nominated_prefix, script_hash),
-1,
),
Pair(bytearray.concat(fortunav2.nominated_prefix, script_hash),
-1),
Pair(burned, -1),
Pair(minted, 1),
]
Expand Down

0 comments on commit 8ac4ad4

Please sign in to comment.