Skip to content

Commit d9655fc

Browse files
committed
fix formatting and update workflow version
1 parent e475816 commit d9655fc

File tree

5 files changed

+58
-58
lines changed

5 files changed

+58
-58
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: 🧰 Install Aiken
3434
uses: aiken-lang/[email protected]
3535
with:
36-
version: v1.0.25-alpha
36+
version: v1.0.26-alpha
3737

3838
- name: 📝 Run fmt
3939
run: aiken fmt --check

lib/aiken/cbor.ak

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ fn do_diagnostic(self: Data, builder: ByteArray) -> ByteArray {
201201

202202
bytes
203203
|> encode_base16(
204-
length_of_bytearray(bytes) - 1,
205-
append_bytearray(#"27", builder),
206-
)
204+
length_of_bytearray(bytes) - 1,
205+
append_bytearray(#"27", builder),
206+
)
207207
|> append_bytearray(#"6827", _)
208208
},
209209
)

lib/aiken/int.ak

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,26 @@ pub fn compare(left: Int, right: Int) -> Ordering {
3232
pub fn from_utf8(bytes: ByteArray) -> Option<Int> {
3333
bytes
3434
|> bytearray.foldr(
35-
Some((0, 0)),
36-
fn(byte, st) {
37-
when st is {
38-
None -> None
39-
Some((n, e)) ->
40-
if byte < 48 || byte > 57 {
41-
if byte == 45 {
42-
Some((-n, 0))
43-
} else {
44-
None
45-
}
46-
} else if n < 0 {
47-
None
48-
} else {
49-
let digit = byte - 48
50-
Some((n + digit * math.pow(10, e), e + 1))
51-
}
52-
}
53-
},
54-
)
35+
Some((0, 0)),
36+
fn(byte, st) {
37+
when st is {
38+
None -> None
39+
Some((n, e)) ->
40+
if byte < 48 || byte > 57 {
41+
if byte == 45 {
42+
Some((-n, 0))
43+
} else {
44+
None
45+
}
46+
} else if n < 0 {
47+
None
48+
} else {
49+
let digit = byte - 48
50+
Some((n + digit * math.pow(10, e), e + 1))
51+
}
52+
}
53+
},
54+
)
5555
|> option.map(fn(tuple) { tuple.1st })
5656
}
5757

lib/aiken/math/rational.ak

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ test compare_with_eq() {
644644
expect Some(x) = new(2, 3)
645645
expect Some(y) = new(3, 4)
646646

647-
!eq(x, y)? && ( !eq(y, x)? && eq(x, x)? )
647+
!eq(x, y)? && !eq(y, x)? && eq(x, x)?
648648
}
649649

650650
test compare_with_neq() {
@@ -654,7 +654,7 @@ test compare_with_neq() {
654654
expect Some(x) = new(2, 3)
655655
expect Some(y) = new(3, 4)
656656

657-
neq(x, y)? && ( neq(y, x)? && !neq(x, x)? )
657+
neq(x, y)? && neq(y, x)? && !neq(x, x)?
658658
}
659659

660660
test compare_with_gte() {
@@ -664,7 +664,7 @@ test compare_with_gte() {
664664
expect Some(x) = new(2, 3)
665665
expect Some(y) = new(3, 4)
666666

667-
!gte(x, y)? && ( gte(y, x)? && gte(x, x)? )
667+
!gte(x, y)? && gte(y, x)? && gte(x, x)?
668668
}
669669

670670
test compare_with_gt() {
@@ -674,7 +674,7 @@ test compare_with_gt() {
674674
expect Some(x) = new(2, 3)
675675
expect Some(y) = new(3, 4)
676676

677-
!gt(x, y)? && ( gt(y, x)? && !gt(x, x)? )
677+
!gt(x, y)? && gt(y, x)? && !gt(x, x)?
678678
}
679679

680680
test compare_with_lte() {
@@ -684,7 +684,7 @@ test compare_with_lte() {
684684
expect Some(x) = new(2, 3)
685685
expect Some(y) = new(3, 4)
686686

687-
lte(x, y)? && ( !lte(y, x)? && lte(x, x)? )
687+
lte(x, y)? && !lte(y, x)? && lte(x, x)?
688688
}
689689

690690
test compare_with_lt() {
@@ -694,7 +694,7 @@ test compare_with_lt() {
694694
expect Some(x) = new(2, 3)
695695
expect Some(y) = new(3, 4)
696696

697-
lt(x, y)? && ( !lt(y, x)? && !lt(x, x)? )
697+
lt(x, y)? && !lt(y, x)? && !lt(x, x)?
698698
}
699699

700700
/// Calculate the arithmetic mean between two `Rational` values.

lib/aiken/transaction.ak

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -183,26 +183,26 @@ pub fn find_datum(
183183
datums
184184
|> dict.get(datum_hash)
185185
|> option.or_try(
186-
fn() {
187-
outputs
188-
|> list.filter_map(
189-
fn(output) {
190-
when output.datum is {
191-
InlineDatum(data) ->
192-
if
193-
blake2b_256(builtin.serialise_data(data)) == datum_hash{
194-
195-
Some(data)
196-
} else {
197-
None
198-
}
199-
_ -> None
200-
}
201-
},
202-
)
203-
|> list.head
204-
},
205-
)
186+
fn() {
187+
outputs
188+
|> list.filter_map(
189+
fn(output) {
190+
when output.datum is {
191+
InlineDatum(data) ->
192+
if
193+
blake2b_256(builtin.serialise_data(data)) == datum_hash{
194+
195+
Some(data)
196+
} else {
197+
None
198+
}
199+
_ -> None
200+
}
201+
},
202+
)
203+
|> list.head
204+
},
205+
)
206206
}
207207

208208
/// Find all outputs that are paying into the given script hash, if any. This is useful for
@@ -213,12 +213,12 @@ pub fn find_script_outputs(
213213
) -> List<Output> {
214214
outputs
215215
|> list.filter(
216-
fn(output) {
217-
when output.address.payment_credential is {
218-
ScriptCredential(addr_script_hash) ->
219-
script_hash == addr_script_hash
220-
VerificationKeyCredential(_) -> False
221-
}
222-
},
223-
)
216+
fn(output) {
217+
when output.address.payment_credential is {
218+
ScriptCredential(addr_script_hash) ->
219+
script_hash == addr_script_hash
220+
VerificationKeyCredential(_) -> False
221+
}
222+
},
223+
)
224224
}

0 commit comments

Comments
 (0)