feat: finished when constr is for IR and code gen

This commit is contained in:
Kasey White
2022-11-28 02:49:39 -05:00
committed by Lucas
parent 3fb3a3240a
commit 29a30aa61f
4 changed files with 369 additions and 56 deletions

View File

@@ -44,14 +44,14 @@ pub fn who(a: ByteArray) -> ByteArray {
}
pub type Datum {
Offer { price: Int, asset_class: ByteArray }
Offer { price: Int, asset_class: ByteArray, thing: Int }
Sell
Hold(Int)
}
pub fn spend(datum: Datum, _rdmr: Nil, _ctx: Nil) -> Bool {
when datum is {
Offer { price, .. } -> price > 0
Offer { price, thing: t, .. } -> price > 0
Hold(less) -> less < 0
Sell -> False
}