fix: better constructor pattern parsing

This commit is contained in:
rvcas
2022-11-16 21:29:14 -05:00
parent ef9fd15e12
commit 72bf27d467
5 changed files with 95 additions and 42 deletions

View File

@@ -33,9 +33,10 @@ pub fn spend(
rdmr: Redeemer,
ctx: spend.ScriptContext,
) -> Bool {
when datum.rdmr is {
sample.Buy(tipo1, fin) -> fin > 0
sample.Sell(twice, find: fin) -> fin > 0
let x = datum.rdmr
when x is {
sample.Buy { fin: fin, .. } -> fin > 0
sample.Sell { find: fin, .. } -> fin > 0
sample.Hold(some) -> some > 0
}
}