Enforce newline after assignment / clause.
This leads to more consistent formatting across entire Aiken programs. Before that commit, only long expressions would be formatted on a newline, causing non-consistent formatting and additional reading barrier when looking at source code. Programs also now take more vertical space, which is better for more friendly diffing in version control systems (especially git).
This commit is contained in:
@@ -4,12 +4,15 @@ use aiken/transaction/value.{add, zero}
|
||||
|
||||
validator staking {
|
||||
fn(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
|
||||
expect Spend(ref) = context.purpose
|
||||
expect Spend(ref) =
|
||||
context.purpose
|
||||
|
||||
expect Some(i) =
|
||||
find(context.transaction.inputs, fn(x) { x.output_reference == ref })
|
||||
let Input { output, .. } = i
|
||||
let staking_addr = output.address
|
||||
let Input { output, .. } =
|
||||
i
|
||||
let staking_addr =
|
||||
output.address
|
||||
|
||||
let v_in =
|
||||
foldr(
|
||||
|
||||
@@ -3,13 +3,16 @@ use aiken/transaction.{Output, ScriptContext}
|
||||
|
||||
validator backtrace {
|
||||
fn(_datum: Void, _redeemer: Void, context: ScriptContext) -> Bool {
|
||||
expect Some(_) = list.find(context.transaction.outputs, fn(_) { True })
|
||||
let _ = find_stuff(context)
|
||||
expect Some(_) =
|
||||
list.find(context.transaction.outputs, fn(_) { True })
|
||||
let _ =
|
||||
find_stuff(context)
|
||||
True
|
||||
}
|
||||
}
|
||||
|
||||
fn find_stuff(context) -> Output {
|
||||
expect Some(stuff) = list.find(context.transaction.outputs, fn(_) { True })
|
||||
expect Some(stuff) =
|
||||
list.find(context.transaction.outputs, fn(_) { True })
|
||||
stuff
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user