starting on field access in aiken
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user