add string comparison and int comparison
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user