Skip to content

Commit 9674590

Browse files
committed
add remaining premises of Dijkstra UTXO rule
clean up documnetation prose in Utxo module
1 parent 94a207a commit 9674590

File tree

5 files changed

+146
-138
lines changed

5 files changed

+146
-138
lines changed

src/Ledger/Core/Specification/Address.lagda.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,18 @@ record HasNetworkId {a} (A : Type a) : Type a where
108108
field NetworkIdOf : A → Network
109109
open HasNetworkId ⦃...⦄ public
110110
111+
record HasMaybeNetworkId {a} (A : Type a) : Type a where
112+
field MaybeNetworkIdOf : A → Maybe Network
113+
open HasMaybeNetworkId ⦃...⦄ public
114+
111115
record HasWithdrawals {a} (A : Type a) : Type a where
112116
field WithdrawalsOf : A → Withdrawals
113117
open HasWithdrawals ⦃...⦄ public
114118
119+
record HasAttrSize {a} (A : Type a) : Type a where
120+
field AttrSizeOf : A → ℕ
121+
open HasAttrSize ⦃...⦄ public
122+
115123
instance
116124
HasNetworkId-BaseAddr : HasNetworkId BaseAddr
117125
HasNetworkId-BaseAddr .NetworkIdOf = BaseAddr.net
@@ -124,6 +132,9 @@ instance
124132
125133
HasCredential-RewardAddress : HasCredential RewardAddress
126134
HasCredential-RewardAddress .CredentialOf = RewardAddress.stake
135+
136+
HasAttrSize-BootstrapAddr : HasAttrSize BootstrapAddr
137+
HasAttrSize-BootstrapAddr .AttrSizeOf = BootstrapAddr.attrsSize
127138
```
128139
-->
129140

src/Ledger/Dijkstra/Specification/Script/Validation.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ txInfo : (ℓ : TxLevel) → UTxO → Tx ℓ → TxInfo
6262
6363
txInfo TxLevelTop utxo tx =
6464
record { realizedInputs = utxo ∣ (SpendInputsOf tx)
65-
; txOuts = IndexedOutputsOf tx
65+
; txOuts = TxOutsOf tx
6666
; txFee = FeesOf? tx
6767
; mint = MintedValueOf tx
6868
; txCerts = DCertsOf tx

src/Ledger/Dijkstra/Specification/Transaction.lagda.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,6 @@ could be either of them.
342342
field ReferenceInputsOf : A → ℙ TxIn
343343
open HasReferenceInputs ⦃...⦄ public
344344
345-
record HasIndexedOutputs {a} (A : Type a) : Type a where
346-
field IndexedOutputsOf : A → Ix ⇀ TxOut
347-
open HasIndexedOutputs ⦃...⦄ public
348-
349345
record HasMintedValue {a} (A : Type a) : Type a where
350346
field MintedValueOf : A → Value
351347
open HasMintedValue ⦃...⦄ public
@@ -386,6 +382,10 @@ could be either of them.
386382
field RequiredSignerHashesOf : A → ℙ KeyHash
387383
open HasRequiredSingerHashes ⦃...⦄ public
388384
385+
record HasCurrentTreasury {a} (A : Type a) : Type a where
386+
field CurrentTreasuryOf : A → Maybe Coin
387+
open HasCurrentTreasury ⦃...⦄ public
388+
389389
instance
390390
HasTxBody-Tx : HasTxBody (Tx txLevel)
391391
HasTxBody-Tx .TxBodyOf = Tx.txBody
@@ -398,7 +398,6 @@ could be either of them.
398398
399399
HasRedeemers-TxWitnesses : HasRedeemers (TxWitnesses txLevel)
400400
HasRedeemers-TxWitnesses .RedeemersOf = TxWitnesses.txRedeemers
401-
402401
HasRedeemers-Tx : HasRedeemers (Tx txLevel)
403402
HasRedeemers-Tx .RedeemersOf = RedeemersOf ∘ TxWitnessesOf
404403
@@ -439,11 +438,6 @@ could be either of them.
439438
HasReferenceInputs-Tx : HasReferenceInputs (Tx txLevel)
440439
HasReferenceInputs-Tx .ReferenceInputsOf = ReferenceInputsOf ∘ TxBodyOf
441440
442-
HasIndexedOutputs-TxBody : HasIndexedOutputs (TxBody txLevel)
443-
HasIndexedOutputs-TxBody .IndexedOutputsOf = TxBody.txOuts
444-
HasIndexedOutputs-Tx : HasIndexedOutputs (Tx txLevel)
445-
HasIndexedOutputs-Tx .IndexedOutputsOf = IndexedOutputsOf ∘ TxBodyOf
446-
447441
HasMintedValue-TxBody : HasMintedValue (TxBody txLevel)
448442
HasMintedValue-TxBody .MintedValueOf = TxBody.mint
449443
HasMintedValue-Tx : HasMintedValue (Tx txLevel)
@@ -459,6 +453,11 @@ could be either of them.
459453
HasListOfGovProposals-Tx : HasListOfGovProposals (Tx txLevel)
460454
HasListOfGovProposals-Tx .ListOfGovProposalsOf = ListOfGovProposalsOf ∘ TxBodyOf
461455
456+
HasMaybeNetworkId-TxBody : HasMaybeNetworkId (TxBody txLevel)
457+
HasMaybeNetworkId-TxBody .MaybeNetworkIdOf = TxBody.txNetworkId
458+
HasMaybeNetworkId-Tx : HasMaybeNetworkId (Tx txLevel)
459+
HasMaybeNetworkId-Tx .MaybeNetworkIdOf = MaybeNetworkIdOf ∘ TxBodyOf
460+
462461
HasFees?-TxBody : {ℓ : TxLevel} → HasFees? (TxBody ℓ)
463462
HasFees?-TxBody {TxLevelTop} .FeesOf? tbTop = just (TxBody.txFee tbTop)
464463
HasFees?-TxBody {TxLevelSub} .FeesOf? tbSub = nothing
@@ -502,6 +501,11 @@ could be either of them.
502501
HasRequiredSingerHashes-TxBody .RequiredSignerHashesOf = TxBody.requiredSignerHashes
503502
HasRequiredSingerHashes-Tx : HasRequiredSingerHashes (Tx txLevel)
504503
HasRequiredSingerHashes-Tx .RequiredSignerHashesOf = RequiredSignerHashesOf ∘ TxBodyOf
504+
505+
HasCurrentTreasury-TxBody : HasCurrentTreasury (TxBody txLevel)
506+
HasCurrentTreasury-TxBody .CurrentTreasuryOf = TxBody.currentTreasury
507+
HasCurrentTreasury-Tx : HasCurrentTreasury (Tx txLevel)
508+
HasCurrentTreasury-Tx .CurrentTreasuryOf = CurrentTreasuryOf ∘ TxBodyOf
505509
```
506510
-->
507511

0 commit comments

Comments
 (0)