starting on field access in aiken

This commit is contained in:
Kasey White
2022-11-03 21:43:12 -04:00
committed by Lucas
parent 3cafb2bcbe
commit ad4a5e927d
3 changed files with 114 additions and 77 deletions

View File

@@ -1,19 +1,17 @@
pub type ScriptContext {
thing: String
thing: ByteArray
}
pub type Datum {
Datum2{
something: String,
fin: Int
}
None{}
something: ByteArray,
fin: Int
}
pub fn eqInt(a: Int, b: Int) {
a == b
}
pub fn eqString(a: String, b: String) {
pub fn eqString(a: ByteArray, b: ByteArray) {
a == b
}

View File

@@ -9,15 +9,11 @@ pub type Redeemer {
pub fn spend(datum: sample.Datum, rdmr: Redeemer, ctx: spend.ScriptContext) -> Bool {
let dat = sample.Datum{..}
let y = 2
let x = 1
let a = when datum is {
sample.Datum2(first, rest) -> rest
sample.None -> 0
}
let b = x
let a = datum.something
let e = dat.something
let b = 2
b == 1
}