add string comparison and int comparison

This commit is contained in:
Kasey White
2022-10-31 01:35:14 -04:00
committed by Lucas
parent 8a99b8c071
commit 6162128427
3 changed files with 129 additions and 11 deletions

View File

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

View File

@@ -9,9 +9,18 @@ pub type Redeemer {
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
let x = "x"
let a = "y"
let b = sample.eqString(x, a)
let c = 1
let y = 1
let d = sample.eqInt(y, c)
if b {
c == 1
} else{
d
}
}