did hacky way for scope level, but now i know how it works and how to fix

This commit is contained in:
Kasey White
2022-10-29 04:02:44 -04:00
committed by Lucas
parent f7276df355
commit f6a72cc7f9
4 changed files with 390 additions and 298 deletions

View File

@@ -6,6 +6,7 @@ pub type Datum {
something: String,
}
pub fn thing(a: Datum, b){
a.something == b
pub fn thing(a: Bool) {
a
}

View File

@@ -7,12 +7,11 @@ pub type Redeemer {
Sell(Int)
}
pub fn spend(datum: Datum, rdmr: Redeemer, ctx: spend.ScriptContext) -> Bool {
if datum.something == "Aiken" {
True
} else if datum.something == "Wow" {
True
} else {
False
}
pub fn spend(datum: sample.Datum, rdmr: Redeemer, ctx: spend.ScriptContext) -> Bool {
let a = True
let b = sample.thing(a)
let c = sample.thing(b)
c
}