Skip to content

Commit

Permalink
feat: many more tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas committed Jan 31, 2024
1 parent 3178a2e commit 77214b1
Show file tree
Hide file tree
Showing 3 changed files with 915 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/opt/homebrew/bin/fish
aiken build --trace-level verbose
aiken build

aiken blueprint apply --validator "marlowe.execute" --out plutus.json 581c(cat plutus.json | jq -r '.validators[1].hash')

Expand Down
913 changes: 907 additions & 6 deletions plutus.json

Large diffs are not rendered by default.

21 changes: 7 additions & 14 deletions validators/marlowe.ak
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use aiken/builtin
use aiken/cbor
use aiken/dict
use aiken/interval.{Finite, Interval, IntervalBound}
use aiken/list
Expand Down Expand Up @@ -270,11 +269,11 @@ type ApplyAction {
}

validator(validator_hash: ByteArray) {
fn execute(datum: Data, redeemer: Data, ctx: ScriptContext) -> Bool {
// trace cbor.diagnostic(redeemer)
expect datum: MarloweData = datum
expect redeemer: MarloweInput = redeemer

fn execute(
datum: MarloweData,
redeemer: MarloweInput,
ctx: ScriptContext,
) -> Bool {
let ScriptContext { transaction, purpose } = ctx
expect Spend(own_out_ref) = purpose

Expand Down Expand Up @@ -430,25 +429,19 @@ validator(validator_hash: ByteArray) {
}
},
)
trace val |> cbor.diagnostic()

trace_if_false(greater_eq_value(output_val, val), @"p")
}
PRole(role) -> {
let hsh =
dict.find(datums, Datum { currency: marlowe_params, role })

let addr =
Address {
payment_credential: ScriptCredential(validator_hash),
stake_credential: None,
}

trace tx_outputs
|> list.length
|> cbor.diagnostic()

trace hsh
|> cbor.diagnostic()

trace_if_false(
list.any(
tx_outputs,
Expand Down

0 comments on commit 77214b1

Please sign in to comment.