create ir and start to replace plutus code gen with ir

This commit is contained in:
Kasey White
2022-11-26 02:50:49 -05:00
committed by Lucas
parent 6870a5cab7
commit 2a00b896fc
4 changed files with 581 additions and 10 deletions

View File

@@ -11,8 +11,8 @@ pub type Redeemer {
}
pub type Reen {
Buy { signer: ByteArray, amount: Int }
Sell
Buy1 { signer: ByteArray, amount: Int }
Sell1
}
pub fn twice(f: fn(Int) -> Int, initial: Int) -> Int {
@@ -43,13 +43,14 @@ pub fn who(a: ByteArray) -> ByteArray {
builtin.append_bytearray(a, #[12, 255])
}
pub fn spend(
datum: sample.Datum,
rdmr: Redeemer,
ctx: spend.ScriptContext,
) -> Bool {
when [1, 2, 3] is {
[a, b, ..] -> True
[] -> False
pub type Datum {
Buy
Sell
}
pub fn spend(datum: Datum, _rdmr: Nil, _ctx: Nil) -> Bool {
when datum is {
Sell -> True
Buy -> False
}
}