feat(aiken_stdlib): add script context type
This commit is contained in:
parent
021237f265
commit
771e011630
|
@ -9,7 +9,7 @@ pub fn length(bytes: ByteArray) -> Int {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_empty(bytes: ByteArray) -> Bool {
|
pub fn is_empty(bytes: ByteArray) -> Bool {
|
||||||
builtin.emptyByteArray(bytes)
|
length(bytes) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn concat(left front: ByteArray, right back: ByteArray) -> ByteArray {
|
pub fn concat(left front: ByteArray, right back: ByteArray) -> ByteArray {
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
pub type ScriptContext(purpose) {
|
||||||
|
transaction: Transaction,
|
||||||
|
purpose: purpose,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type Transaction {
|
||||||
|
inputs: List(Nil),
|
||||||
|
outputs: List(Nil),
|
||||||
|
fee: Nil,
|
||||||
|
mint: Nil,
|
||||||
|
certificates: List(Nil),
|
||||||
|
withdrawals: List(Nil),
|
||||||
|
validity_range: Nil,
|
||||||
|
extra_signatories: Nil,
|
||||||
|
datums: List(Nil),
|
||||||
|
id: ByteArray,
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
pub type Mint {
|
||||||
|
currency_symbol: ByteArray,
|
||||||
|
}
|
|
@ -1,3 +1,6 @@
|
||||||
pub fn spend(d: Nil, r: Nil, ctx: Nil) -> Bool {
|
use aiken/context.{ScriptContext}
|
||||||
|
use aiken/context/mint.{Mint}
|
||||||
|
|
||||||
|
pub fn mint(d: Nil, r: Nil, ctx: ScriptContext(Mint)) -> Bool {
|
||||||
True
|
True
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue