Prelude
{-# OPTIONS --safe #-}
open import Ledger.Prelude hiding (fromList; ε); open Computational
module Test.Prelude (D : Set) {{DecEq-Data : DecEq D}} where
open import Tactic.Derive.DecEq
open import Data.Vec
SDatum = D
SValue = ℕ
STxId = ℕ
SIx = ℕ
STxIn = STxId × SIx
SNetwork = ℕ
SSlot = ℕ
SKeyHash = ℕ
data SCredential : Type where
KeyHashObj : ℕ → SCredential
ScriptObj : ℕ → SCredential
instance
unquoteDecl DecEq-SCredential = derive-DecEq
((quote SCredential , DecEq-SCredential) ∷ [])
record SBaseAddr : Set where
field net : SNetwork
pay : SCredential
stake : Maybe SCredential
instance
unquoteDecl DecEq-SBaseAddr = derive-DecEq
((quote SBaseAddr , DecEq-SBaseAddr) ∷ [])
record SBootstrapAddr : Set where
field net : SNetwork
pay : SCredential
attrsSize : ℕ
instance
unquoteDecl DecEq-SBootstrapAddr = derive-DecEq
((quote SBootstrapAddr , DecEq-SBootstrapAddr) ∷ [])
SAddr = SBaseAddr ⊎ SBootstrapAddr
STxOut = SAddr × SValue × Maybe (D ⊎ D)
SUTxO = List (STxIn × STxOut)
record SRwdAddr : Set where
field net : SNetwork
stake : SCredential
instance
unquoteDecl DecEq-SRwdAddr = derive-DecEq
((quote SRwdAddr , DecEq-SRwdAddr) ∷ [])
data SScriptPurpose : Set where
Rwrd : SRwdAddr → SScriptPurpose
Mint : SValue → SScriptPurpose
Spend : STxIn → SScriptPurpose
Empty : SScriptPurpose
instance
unquoteDecl DecEq-SScriptPurpose = derive-DecEq
((quote SScriptPurpose , DecEq-SScriptPurpose) ∷ [])
record STxInfo : Set where
field realizedInputs : SUTxO
txouts : List (SIx × STxOut)
fee : SValue
mint : SValue
txwdrls : List (SRwdAddr × Coin)
txvldt : Maybe SSlot × Maybe SSlot
vkey : ℙ SKeyHash
txdats : List D
txid : STxId
instance
unquoteDecl DecEq-STxInfo = derive-DecEq
((quote STxInfo , DecEq-STxInfo) ∷ [])