Draft a few more core types for ScriptContext / Transaction

Interesting points:

  - We don't have tuples yet, so we fake it until we make it.
  - Aliases are 'order-sensitive', especially if an alias uses another not-yet-declared alias.
This commit is contained in:
KtorZ 2022-11-16 18:04:58 +01:00 committed by Lucas
parent 771e011630
commit f63da1a367
1 changed files with 34 additions and 4 deletions

View File

@ -4,14 +4,44 @@ pub type ScriptContext(purpose) {
}
pub type Transaction {
inputs: List(Nil),
inputs: List(Input),
reference_inputs: List(Input),
outputs: List(Nil),
fee: Nil,
mint: Nil,
fee: Value,
mint: Value,
certificates: List(Nil),
withdrawals: List(Nil),
validity_range: Nil,
extra_signatories: Nil,
redeemers: List(Nil),
datums: List(Nil),
id: ByteArray,
id: TransactionId,
}
pub type TransactionId =
ByteArray
pub type Input {
output_reference: OutputReference,
output: Output,
}
pub type OutputReference {
transction_id: TransactionId,
output_index: Int,
}
pub type PolicyId =
ByteArray
pub type Output =
Nil
pub type AssetName =
ByteArray
pub type Pair(a, b) =
Nil
pub type Value =
List(Pair(PolicyId, List(Pair(AssetName, Int))))