File tree Expand file tree Collapse file tree 8 files changed +21
-16
lines changed
Core/Specification/TokenAlgebra Expand file tree Collapse file tree 8 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import Ledger.Conway.Specification.PParams
2727import Ledger.Conway.Specification.Script.Base
2828import Ledger.Conway.Specification.Gov.Actions
2929import Ledger.Conway.Specification.Certs
30- import Ledger.Conway .Specification.TokenAlgebra.Base
30+ import Ledger.Core .Specification.TokenAlgebra.Base
3131import Ledger.Core.Specification.Address
3232
3333open import Relation.Nullary.Decidable using (⌊_⌋)
@@ -88,7 +88,7 @@ record TransactionStructure : Type₁ where
8888
8989 field cryptoStructure : _
9090 open CryptoStructure cryptoStructure public
91- open Ledger.Conway .Specification.TokenAlgebra.Base ScriptHash public
91+ open Ledger.Core .Specification.TokenAlgebra.Base ScriptHash public
9292 open Ledger.Core.Specification.Address Network KeyHash ScriptHash ⦃ it ⦄ ⦃ it ⦄ ⦃ it ⦄ public
9393
9494 field epochStructure : _
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ instance
137137```
138138-->
139139
140- * UTxO transitions*
140+ * UTxO transitions*
141141
142142``` agda
143143data _⊢_⇀⦇_,UTXO⦈_ : UTxOEnv → UTxOState → Tx → UTxOState → Type
Original file line number Diff line number Diff line change 11---
22source_branch : master
3- source_path : src/Ledger/Conway /Specification/TokenAlgebra/Base.lagda
3+ source_path : src/Ledger/Core /Specification/TokenAlgebra/Base.lagda
44---
55
66# Token Algebras {#sec: token-algebra }
@@ -11,7 +11,7 @@ Token algebras are used for multiple assets.
1111```agda
1212{-# OPTIONS --safe #-}
1313open import Prelude using (Type)
14- module Ledger.Conway .Specification.TokenAlgebra.Base (
14+ module Ledger.Core .Specification.TokenAlgebra.Base (
1515```
1616-->
1717 * Abstract types*
Original file line number Diff line number Diff line change 11---
22source_branch : master
3- source_path : src/Ledger/Conway /Specification/TokenAlgebra/Coin.lagda.md
3+ source_path : src/Ledger/Core /Specification/TokenAlgebra/Coin.lagda.md
44---
55
66``` agda
77{-# OPTIONS --safe #-}
88open import Ledger.Prelude
99
10- module Ledger.Conway .Specification.TokenAlgebra.Coin (X : Type) where
10+ module Ledger.Core .Specification.TokenAlgebra.Coin (X : Type) where
1111
1212open import Algebra.Morphism.Construct.Identity
1313 using (isMonoidHomomorphism)
1414
15- open import Ledger.Conway .Specification.TokenAlgebra.Base X
15+ open import Ledger.Core .Specification.TokenAlgebra.Base X
1616
1717open TokenAlgebra
1818
Original file line number Diff line number Diff line change 11---
22source_branch : master
3- source_path : src/Ledger/Conway /Specification/TokenAlgebra/ValueSet.lagda.md
3+ source_path : src/Ledger/Core /Specification/TokenAlgebra/ValueSet.lagda.md
44---
55
66## Value Set {#sec: value-set }
@@ -12,11 +12,11 @@ source_path: src/Ledger/Conway/Specification/TokenAlgebra/ValueSet.lagda.md
1212
1313open import Prelude using (Type)
1414
15- module Ledger.Conway .Specification.TokenAlgebra.ValueSet (PolicyId AssetName : Type) where
15+ module Ledger.Core .Specification.TokenAlgebra.ValueSet (PolicyId AssetName : Type) where
1616
1717open import Ledger.Prelude hiding (lookup ; update ; isMagma ; isEquivalence) renaming (TotalMap to _⇒_)
1818open _⇒_
19- open import Ledger.Conway .Specification.TokenAlgebra.Base PolicyId using (TokenAlgebra)
19+ open import Ledger.Core .Specification.TokenAlgebra.Base PolicyId using (TokenAlgebra)
2020
2121open import Algebra using (Op₂ ; IsSemigroup ; IsMonoid ; IsMagma ; IsCommutativeMonoid)
2222open import Algebra.Morphism using (IsMonoidHomomorphism ; IsMagmaHomomorphism)
Original file line number Diff line number Diff line change 11---
22source_branch : master
3- source_path : src/Ledger/Conway /Specification/TokenAlgebra/ValueVector.lagda.md
3+ source_path : src/Ledger/Core /Specification/TokenAlgebra/ValueVector.lagda.md
44---
55
66``` agda
77{-# OPTIONS --safe #-}
88open import Ledger.Prelude hiding (_∙_; ε)
99
10- module Ledger.Conway .Specification.TokenAlgebra.ValueVector (PolicyId : Type) (n : ℕ) where
10+ module Ledger.Core .Specification.TokenAlgebra.ValueVector (PolicyId : Type) (n : ℕ) where
1111
1212import Algebra as Alg
1313open import Algebra.Construct.DirectProduct
@@ -19,7 +19,7 @@ open import Data.Vec as Vec
1919import stdlib.Data.Vec.Instances as Vec
2020import Data.Vec.Relation.Binary.Pointwise.Inductive as Vec
2121
22- open import Ledger.Conway .Specification.TokenAlgebra.Base PolicyId
22+ open import Ledger.Core .Specification.TokenAlgebra.Base PolicyId
2323
2424Quantity = ℕ
2525
Original file line number Diff line number Diff line change @@ -7,5 +7,5 @@ source_path: src/Ledger/Dijkstra/Specification/TokenAlgebra/Base.lagda.md
77open import Prelude using (Type)
88module Ledger.Dijkstra.Specification.TokenAlgebra.Base (PolicyId : Type) where
99
10- open import Ledger.Conway .Specification.TokenAlgebra.Base PolicyId public
10+ open import Ledger.Core .Specification.TokenAlgebra.Base PolicyId public
1111```
Original file line number Diff line number Diff line change @@ -191,7 +191,8 @@ The fields that depend on the transaction level use the auxiliary functions
191191 field
192192 txBody : TxBody txLevel
193193 txWitnesses : TxWitnesses txLevel
194- isValid : InTopLevel txLevel Bool
194+ txSize : InSubLevel txLevel ℕ -- only in sub-level tx
195+ isValid : InTopLevel txLevel Bool -- only in top-level tx
195196 txAuxData : Maybe AuxiliaryData
196197
197198 record TxBody (txLevel : TxLevel) : Type where
@@ -391,6 +392,10 @@ could be either of them.
391392 getTxScripts {TxLevelSub} = getSubTxScripts
392393 getTxScripts {TxLevelTop} =
393394 concatMapˢ getSubTxScripts ∘ fromList ∘ TxBody.txSubTransactions ∘ TxBodyOf
395+
396+ getTopLevelTxSize : TopLevelTx → ℕ
397+ getTopLevelTxSize txTop = sum (map (λ subTx → subTx .txSize) (txTop .txBody .txSubTransactions))
398+ where open Tx; open TxBody
394399```
395400-->
396401
You can’t perform that action at this time.
0 commit comments