From 8db4a60986950cb97327060709edcd4c9d0a4899 Mon Sep 17 00:00:00 2001 From: KtorZ Date: Sat, 7 Sep 2024 18:25:21 +0200 Subject: [PATCH] (re)format aiken sources in the repository. --- .../lib/benchmarks/knights/benchmark.ak | 371 ++---------------- .../lib/benchmarks/knights/heuristic.ak | 3 +- .../v3/validators/certificates.ak | 8 +- .../script_context/v3/validators/mint.ak | 4 +- .../v3/validators/proposing_all.ak | 6 +- .../v3/validators/proposing_pparams.ak | 2 +- .../v3/validators/simple_spend.ak | 2 +- 7 files changed, 45 insertions(+), 351 deletions(-) diff --git a/benchmarks/lib/benchmarks/knights/benchmark.ak b/benchmarks/lib/benchmarks/knights/benchmark.ak index b66d6859..33d190d7 100644 --- a/benchmarks/lib/benchmarks/knights/benchmark.ak +++ b/benchmarks/lib/benchmarks/knights/benchmark.ak @@ -88,42 +88,10 @@ const solution_100_6x6: Solution = move_number: 36, start: Some((1, 1)), visited: [ - (3, 2), - (5, 3), - (6, 1), - (4, 2), - (3, 4), - (2, 6), - (4, 5), - (6, 6), - (5, 4), - (6, 2), - (4, 1), - (2, 2), - (1, 4), - (3, 3), - (2, 1), - (1, 3), - (2, 5), - (4, 6), - (6, 5), - (4, 4), - (5, 2), - (6, 4), - (5, 6), - (3, 5), - (1, 6), - (2, 4), - (1, 2), - (3, 1), - (4, 3), - (5, 1), - (6, 3), - (5, 5), - (3, 6), - (1, 5), - (2, 3), - (1, 1), + (3, 2), (5, 3), (6, 1), (4, 2), (3, 4), (2, 6), (4, 5), (6, 6), (5, 4), + (6, 2), (4, 1), (2, 2), (1, 4), (3, 3), (2, 1), (1, 3), (2, 5), (4, 6), + (6, 5), (4, 4), (5, 2), (6, 4), (5, 6), (3, 5), (1, 6), (2, 4), (1, 2), + (3, 1), (4, 3), (5, 1), (6, 3), (5, 5), (3, 6), (1, 5), (2, 3), (1, 1), ], }, ), @@ -134,42 +102,10 @@ const solution_100_6x6: Solution = move_number: 36, start: Some((1, 1)), visited: [ - (3, 2), - (5, 3), - (6, 1), - (4, 2), - (3, 4), - (2, 2), - (4, 1), - (6, 2), - (5, 4), - (6, 6), - (4, 5), - (2, 6), - (1, 4), - (3, 3), - (2, 1), - (1, 3), - (2, 5), - (4, 6), - (6, 5), - (4, 4), - (5, 2), - (6, 4), - (5, 6), - (3, 5), - (1, 6), - (2, 4), - (1, 2), - (3, 1), - (4, 3), - (5, 1), - (6, 3), - (5, 5), - (3, 6), - (1, 5), - (2, 3), - (1, 1), + (3, 2), (5, 3), (6, 1), (4, 2), (3, 4), (2, 2), (4, 1), (6, 2), (5, 4), + (6, 6), (4, 5), (2, 6), (1, 4), (3, 3), (2, 1), (1, 3), (2, 5), (4, 6), + (6, 5), (4, 4), (5, 2), (6, 4), (5, 6), (3, 5), (1, 6), (2, 4), (1, 2), + (3, 1), (4, 3), (5, 1), (6, 3), (5, 5), (3, 6), (1, 5), (2, 3), (1, 1), ], }, ), @@ -180,42 +116,10 @@ const solution_100_6x6: Solution = move_number: 36, start: Some((1, 1)), visited: [ - (3, 2), - (5, 3), - (6, 1), - (4, 2), - (3, 4), - (2, 2), - (1, 4), - (2, 6), - (4, 5), - (6, 6), - (5, 4), - (6, 2), - (4, 1), - (3, 3), - (2, 1), - (1, 3), - (2, 5), - (4, 6), - (6, 5), - (4, 4), - (5, 2), - (6, 4), - (5, 6), - (3, 5), - (1, 6), - (2, 4), - (1, 2), - (3, 1), - (4, 3), - (5, 1), - (6, 3), - (5, 5), - (3, 6), - (1, 5), - (2, 3), - (1, 1), + (3, 2), (5, 3), (6, 1), (4, 2), (3, 4), (2, 2), (1, 4), (2, 6), (4, 5), + (6, 6), (5, 4), (6, 2), (4, 1), (3, 3), (2, 1), (1, 3), (2, 5), (4, 6), + (6, 5), (4, 4), (5, 2), (6, 4), (5, 6), (3, 5), (1, 6), (2, 4), (1, 2), + (3, 1), (4, 3), (5, 1), (6, 3), (5, 5), (3, 6), (1, 5), (2, 3), (1, 1), ], }, ), @@ -226,48 +130,15 @@ const solution_100_6x6: Solution = move_number: 36, start: Some((1, 1)), visited: [ - (3, 2), - (5, 3), - (6, 1), - (4, 2), - (3, 4), - (2, 6), - (1, 4), - (2, 2), - (4, 1), - (6, 2), - (5, 4), - (6, 6), - (4, 5), - (3, 3), - (2, 1), - (1, 3), - (2, 5), - (4, 6), - (6, 5), - (4, 4), - (5, 2), - (6, 4), - (5, 6), - (3, 5), - (1, 6), - (2, 4), - (1, 2), - (3, 1), - (4, 3), - (5, 1), - (6, 3), - (5, 5), - (3, 6), - (1, 5), - (2, 3), - (1, 1), + (3, 2), (5, 3), (6, 1), (4, 2), (3, 4), (2, 6), (1, 4), (2, 2), (4, 1), + (6, 2), (5, 4), (6, 6), (4, 5), (3, 3), (2, 1), (1, 3), (2, 5), (4, 6), + (6, 5), (4, 4), (5, 2), (6, 4), (5, 6), (3, 5), (1, 6), (2, 4), (1, 2), + (3, 1), (4, 3), (5, 1), (6, 3), (5, 5), (3, 6), (1, 5), (2, 3), (1, 1), ], }, ), ] - const solution_100_8x8: Solution = [ ( @@ -277,69 +148,13 @@ const solution_100_8x8: Solution = move_number: 64, start: Some((1, 1)), visited: [ - (3, 2), - (4, 4), - (5, 6), - (6, 4), - (8, 5), - (7, 7), - (6, 5), - (8, 4), - (7, 2), - (5, 3), - (3, 4), - (4, 6), - (5, 8), - (6, 6), - (4, 5), - (3, 7), - (1, 8), - (2, 6), - (4, 7), - (5, 5), - (6, 3), - (5, 1), - (4, 3), - (3, 5), - (5, 4), - (7, 3), - (8, 1), - (6, 2), - (4, 1), - (2, 2), - (1, 4), - (3, 3), - (2, 5), - (1, 3), - (2, 1), - (4, 2), - (6, 1), - (8, 2), - (7, 4), - (8, 6), - (7, 8), - (5, 7), - (3, 8), - (1, 7), - (3, 6), - (2, 8), - (1, 6), - (2, 4), - (1, 2), - (3, 1), - (5, 2), - (7, 1), - (8, 3), - (7, 5), - (8, 7), - (6, 8), - (7, 6), - (8, 8), - (6, 7), - (4, 8), - (2, 7), - (1, 5), - (2, 3), + (3, 2), (4, 4), (5, 6), (6, 4), (8, 5), (7, 7), (6, 5), (8, 4), (7, 2), + (5, 3), (3, 4), (4, 6), (5, 8), (6, 6), (4, 5), (3, 7), (1, 8), (2, 6), + (4, 7), (5, 5), (6, 3), (5, 1), (4, 3), (3, 5), (5, 4), (7, 3), (8, 1), + (6, 2), (4, 1), (2, 2), (1, 4), (3, 3), (2, 5), (1, 3), (2, 1), (4, 2), + (6, 1), (8, 2), (7, 4), (8, 6), (7, 8), (5, 7), (3, 8), (1, 7), (3, 6), + (2, 8), (1, 6), (2, 4), (1, 2), (3, 1), (5, 2), (7, 1), (8, 3), (7, 5), + (8, 7), (6, 8), (7, 6), (8, 8), (6, 7), (4, 8), (2, 7), (1, 5), (2, 3), (1, 1), ], }, @@ -351,69 +166,13 @@ const solution_100_8x8: Solution = move_number: 64, start: Some((1, 1)), visited: [ - (3, 2), - (4, 4), - (5, 6), - (7, 7), - (8, 5), - (6, 4), - (7, 2), - (8, 4), - (6, 5), - (5, 3), - (3, 4), - (4, 6), - (5, 8), - (6, 6), - (4, 5), - (3, 7), - (1, 8), - (2, 6), - (4, 7), - (5, 5), - (6, 3), - (5, 1), - (4, 3), - (3, 5), - (5, 4), - (7, 3), - (8, 1), - (6, 2), - (4, 1), - (2, 2), - (1, 4), - (3, 3), - (2, 5), - (1, 3), - (2, 1), - (4, 2), - (6, 1), - (8, 2), - (7, 4), - (8, 6), - (7, 8), - (5, 7), - (3, 8), - (1, 7), - (3, 6), - (2, 8), - (1, 6), - (2, 4), - (1, 2), - (3, 1), - (5, 2), - (7, 1), - (8, 3), - (7, 5), - (8, 7), - (6, 8), - (7, 6), - (8, 8), - (6, 7), - (4, 8), - (2, 7), - (1, 5), - (2, 3), + (3, 2), (4, 4), (5, 6), (7, 7), (8, 5), (6, 4), (7, 2), (8, 4), (6, 5), + (5, 3), (3, 4), (4, 6), (5, 8), (6, 6), (4, 5), (3, 7), (1, 8), (2, 6), + (4, 7), (5, 5), (6, 3), (5, 1), (4, 3), (3, 5), (5, 4), (7, 3), (8, 1), + (6, 2), (4, 1), (2, 2), (1, 4), (3, 3), (2, 5), (1, 3), (2, 1), (4, 2), + (6, 1), (8, 2), (7, 4), (8, 6), (7, 8), (5, 7), (3, 8), (1, 7), (3, 6), + (2, 8), (1, 6), (2, 4), (1, 2), (3, 1), (5, 2), (7, 1), (8, 3), (7, 5), + (8, 7), (6, 8), (7, 6), (8, 8), (6, 7), (4, 8), (2, 7), (1, 5), (2, 3), (1, 1), ], }, @@ -425,69 +184,13 @@ const solution_100_8x8: Solution = move_number: 64, start: Some((1, 1)), visited: [ - (3, 2), - (4, 4), - (6, 5), - (8, 4), - (7, 2), - (5, 3), - (3, 4), - (4, 6), - (5, 8), - (7, 7), - (5, 6), - (6, 4), - (8, 5), - (6, 6), - (4, 5), - (3, 7), - (1, 8), - (2, 6), - (4, 7), - (5, 5), - (6, 3), - (5, 1), - (4, 3), - (3, 5), - (5, 4), - (7, 3), - (8, 1), - (6, 2), - (4, 1), - (2, 2), - (1, 4), - (3, 3), - (2, 5), - (1, 3), - (2, 1), - (4, 2), - (6, 1), - (8, 2), - (7, 4), - (8, 6), - (7, 8), - (5, 7), - (3, 8), - (1, 7), - (3, 6), - (2, 8), - (1, 6), - (2, 4), - (1, 2), - (3, 1), - (5, 2), - (7, 1), - (8, 3), - (7, 5), - (8, 7), - (6, 8), - (7, 6), - (8, 8), - (6, 7), - (4, 8), - (2, 7), - (1, 5), - (2, 3), + (3, 2), (4, 4), (6, 5), (8, 4), (7, 2), (5, 3), (3, 4), (4, 6), (5, 8), + (7, 7), (5, 6), (6, 4), (8, 5), (6, 6), (4, 5), (3, 7), (1, 8), (2, 6), + (4, 7), (5, 5), (6, 3), (5, 1), (4, 3), (3, 5), (5, 4), (7, 3), (8, 1), + (6, 2), (4, 1), (2, 2), (1, 4), (3, 3), (2, 5), (1, 3), (2, 1), (4, 2), + (6, 1), (8, 2), (7, 4), (8, 6), (7, 8), (5, 7), (3, 8), (1, 7), (3, 6), + (2, 8), (1, 6), (2, 4), (1, 2), (3, 1), (5, 2), (7, 1), (8, 3), (7, 5), + (8, 7), (6, 8), (7, 6), (8, 8), (6, 7), (4, 8), (2, 7), (1, 5), (2, 3), (1, 1), ], }, diff --git a/benchmarks/lib/benchmarks/knights/heuristic.ak b/benchmarks/lib/benchmarks/knights/heuristic.ak index 3a7a6c82..f523156c 100644 --- a/benchmarks/lib/benchmarks/knights/heuristic.ak +++ b/benchmarks/lib/benchmarks/knights/heuristic.ak @@ -18,8 +18,7 @@ type Direction { RD } -const direction_list = - [UL, UR, DL, DR, LU, LD, RU, RD] +const direction_list = [UL, UR, DL, DR, LU, LD, RU, RD] fn move(direction: Direction, tile: Tile) -> Tile { let (x, y) = tile diff --git a/examples/acceptance_tests/script_context/v3/validators/certificates.ak b/examples/acceptance_tests/script_context/v3/validators/certificates.ak index c4a459fe..9d11bdba 100644 --- a/examples/acceptance_tests/script_context/v3/validators/certificates.ak +++ b/examples/acceptance_tests/script_context/v3/validators/certificates.ak @@ -1,4 +1,5 @@ use aiken/collection/list +use cardano/address.{Script, VerificationKey} use cardano/certificate.{ AlwaysAbstain, AlwaysNoConfidence, AuthorizeConstitutionalCommitteeProxy, Certificate, DelegateBlockProduction, DelegateBoth, DelegateCredential, @@ -7,7 +8,6 @@ use cardano/certificate.{ RetireFromConstitutionalCommittee, RetireStakePool, UnregisterCredential, UnregisterDelegateRepresentative, UpdateDelegateRepresentative, } -use cardano/address.{Script, VerificationKey} use cardano/transaction.{Transaction} const only0s = #"00000000000000000000000000000000000000000000000000000000" @@ -20,11 +20,7 @@ const only9s = #"9999999999999999999999999999999999999999999999999999999999999999" validator purposes { - publish( - _redeemer: Void, - certificate: Certificate, - transaction: Transaction, - ) -> Bool { + publish(_redeemer: Void, certificate: Certificate, transaction: Transaction) { assert_script_info(certificate) let certificates = transaction.certificates diff --git a/examples/acceptance_tests/script_context/v3/validators/mint.ak b/examples/acceptance_tests/script_context/v3/validators/mint.ak index dee85d6a..7c7a59ef 100644 --- a/examples/acceptance_tests/script_context/v3/validators/mint.ak +++ b/examples/acceptance_tests/script_context/v3/validators/mint.ak @@ -1,7 +1,7 @@ use aiken/collection/dict.{Dict} use aiken/collection/list -use cardano/assets.{PolicyId, Value} use cardano/address +use cardano/assets.{PolicyId, Value} use cardano/transaction.{ DatumHash, Input, Mint, NoDatum, Output, OutputReference, ScriptPurpose, Transaction, @@ -128,10 +128,10 @@ fn assert_mint(mint: Value, our_policy_id: PolicyId, other_policy_id: PolicyId) // below is meant to generate a small-enough hash... If this test fails // after some code-gen changes, it's probably because the new hash is // larger. -/// // How to fix? // Change the traced string down below in hope to get a // smaller hash. +/// validator test_2 { mint(_tmp2: Void, _policy_id: PolicyId, _transaction: Transaction) { trace @"slfhioer7w8yru" diff --git a/examples/acceptance_tests/script_context/v3/validators/proposing_all.ak b/examples/acceptance_tests/script_context/v3/validators/proposing_all.ak index 55d5240a..470193c6 100644 --- a/examples/acceptance_tests/script_context/v3/validators/proposing_all.ak +++ b/examples/acceptance_tests/script_context/v3/validators/proposing_all.ak @@ -14,11 +14,7 @@ const null32 = #"0000000000000000000000000000000000000000000000000000000000000000" validator guardrails { - propose( - _redeemer: Void, - _: ProposalProcedure, - transaction: Transaction, - ) -> Bool { + propose(_redeemer: Void, _: ProposalProcedure, transaction: Transaction) { let procedures = transaction.proposal_procedures assert_redeemers(transaction.redeemers) diff --git a/examples/acceptance_tests/script_context/v3/validators/proposing_pparams.ak b/examples/acceptance_tests/script_context/v3/validators/proposing_pparams.ak index 72d398c0..164189da 100644 --- a/examples/acceptance_tests/script_context/v3/validators/proposing_pparams.ak +++ b/examples/acceptance_tests/script_context/v3/validators/proposing_pparams.ak @@ -24,7 +24,7 @@ validator guardrails { _redeemer: Void, proposal: ProposalProcedure, _transaction: Transaction, - ) -> Bool { + ) { expect ProposalProcedure { governance_action: ProtocolParameters { ancestor: None, diff --git a/examples/acceptance_tests/script_context/v3/validators/simple_spend.ak b/examples/acceptance_tests/script_context/v3/validators/simple_spend.ak index d82ff311..b5226dad 100644 --- a/examples/acceptance_tests/script_context/v3/validators/simple_spend.ak +++ b/examples/acceptance_tests/script_context/v3/validators/simple_spend.ak @@ -1,6 +1,6 @@ use aiken/collection/dict -use cardano/assets use cardano/address.{Address, Script} +use cardano/assets use cardano/transaction.{ InlineDatum, Input, Output, OutputReference, ScriptPurpose, Spend, Transaction, }