feat: typecheck If expressions

This commit is contained in:
rvcas
2022-10-23 19:34:51 -04:00
committed by Lucas
parent 5244e58c9f
commit 825783ca61
12 changed files with 971 additions and 32 deletions

View File

@@ -1,3 +1,7 @@
pub type ScriptContext {
idk: Int
}
pub fn append(a: ByteArray, b: ByteArray) -> ByteArray {
todo
}

View File

@@ -9,7 +9,13 @@ pub type Redeemer {
Sell
}
pub fn validate(datum: Datum, rdmr: Redeemer, ctx: ScriptContext) -> Bool {
pub fn validate(datum: Datum, rdmr: Redeemer, ctx: syntax.ScriptContext) -> Bool {
let thing = if True {
3
} else {
"thing"
}
when rdmr is {
Buy -> True
Sell -> datum.something == "Aiken"