fix: constr issue

- also fixed constant parsing
- added new cbor flag to eval

Co-authored-by: rvcas <x@rvcas.dev>
This commit is contained in:
Kasey White
2022-12-05 22:46:33 -05:00
committed by Lucas
parent 7875af7d35
commit 3f47a1f4b8
16 changed files with 155 additions and 329 deletions

View File

@@ -1,49 +1,7 @@
pub type Signer {
hash: ByteArray,
}
pub type ScriptContext {
signer: Signer,
}
pub type Redeem {
Buy { tipo: ByteArray, fin: Int }
Sell { twice: ByteArray, find: Int }
Hold(Int)
pub type Redeemer {
signer: ByteArray,
}
pub type Datum {
fin: Int,
sc: ScriptContext,
rdmr: Redeem,
random: ByteArray,
}
pub fn eqIntPlusOne(a: Int, b: Int) {
a + 1 == b
}
pub fn eqString(a: ByteArray, b: ByteArray) {
a == b
}
pub type Thing {
Some
None
}
pub type Other {
Wow
Yes
}
pub fn incrementor(counter: Int, target: Int) -> Int {
if counter == target {
counter
} else if counter > target {
counter - target
} else {
incrementor(counter + 1, target)
}
}
pub const big_a = 5

View File

@@ -1,8 +0,0 @@
pub type ScriptContext(purpose) {
tx_info: TxInfo,
script_purpose: purpose,
}
pub type TxInfo {
idk: Int,
}

View File

@@ -1,8 +0,0 @@
use sample/context
pub type Mint {
currency_symbol: ByteArray,
}
pub type ScriptContext =
context.ScriptContext(Mint)

View File

@@ -1,8 +0,0 @@
use sample/context
pub type Spend {
idk: Int,
}
pub type ScriptContext =
context.ScriptContext(Spend)