Got nested field access working efficiently. Will clean up code soon.

This commit is contained in:
Kasey White
2022-11-06 01:58:47 -04:00
committed by Lucas
parent e3fa9ac105
commit 805bf19081
3 changed files with 65 additions and 38 deletions

View File

@@ -1,10 +1,22 @@
pub type Signer {
hash: Int
}
pub type ScriptContext {
thing: ByteArray
signer: Signer
}
pub type Redeem {
Buy
Sell
}
pub type Datum {
something: ScriptContext,
fin: Int
fin: Int,
sc: ScriptContext,
rdmr: Redeem,
}
pub fn eqInt(a: Int, b: Int) {

View File

@@ -11,8 +11,9 @@ pub type Redeemer {
pub fn spend(datum: sample.Datum, rdmr: Redeemer, ctx: spend.ScriptContext) -> Bool {
let y = 2
let x = 1
let a = datum.something.thing
let b = 2
b == 1
let x = datum.sc.signer
let a = datum.sc.signer.hash
let b = datum.rdmr
let c = 1
c == 1
}