Skip to content

Commit 3263896

Browse files
committed
post-merge fixes and improvements
1 parent edba388 commit 3263896

File tree

7 files changed

+19
-25
lines changed

7 files changed

+19
-25
lines changed

src/Ledger.lagda.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ import Ledger.Core
1212
import Ledger.Conway
1313
import Ledger.Dijkstra
1414
15+
import Test.Examples
16+
1517
import EssentialAgda
1618
```

src/Ledger/Conway/Specification.lagda.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,6 @@ import Ledger.Conway.Specification.Script
124124
import Ledger.Conway.Specification.Script.Validation
125125
```
126126

127-
## Tests and Examples
128-
129-
```agda
130-
import Test.Examples
131-
import Test.StructuredContracts
132-
```
133-
134127
## Token Algebras
135128

136129
```agda

src/Test/Examples.lagda.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The "Examples" module aims to add a couple of example smart contract
77
validators written as part of the Cardano Formal Ledger Specification.
88
These validator scripts are functions that examine a transaction and decide
99
if the UTxO locked by their script can be spent as part of the current
10-
transaction.
10+
transaction.
1111

1212
<!--
1313
```agda
@@ -30,7 +30,7 @@ of the UTxO rule, we also run the scripts locking any consumed outputs,
3030
which in our case are the validator scripts.
3131

3232
The other examples are more in-depth and are separated across
33-
multiple modules.
33+
multiple modules.
3434

3535
```agda
3636
import Test.Examples.MultiSig.Datum
@@ -69,8 +69,7 @@ Formal Ledger Rules.
6969
An "OffChain" folder, which defines the "endpoints" used to interact with
7070
our account. Essentially, this defines a way to easily create a transaction
7171
where we are attempting to execute one of the actions our validator
72-
might allow. This includes various aspects, such as making sure the transaction
73-
72+
might allow. This includes various aspects, such as making sure the transaction
7473
is signed by the right person, that the correct fees are paid, that payments
7574
are sent to the correct recipients, that the smart contract self-perpetuates, etc.
7675

@@ -93,7 +92,7 @@ a payment. This trace succeeds and is tested with both the UTxO and UTxOw
9392
rules. We also have a failing trace, where after the first payment, we try
9493
to propose another payment of a larger amount than is contained in the wallet,
9594
which naturally fails.
96-
95+
9796
```agda
9897
import Test.Examples.AccountSim.Datum
9998
import Test.Examples.AccountSim.Validator

src/Test/Examples/AccountSim/Test/Trace.agda

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ data Tx' : Set where
4747
openn : Tx'
4848
close : Tx'
4949
withdraw : Value Tx'
50-
deposit :-> Value -> Tx'
51-
transfer :->-> Value -> Tx'
52-
cleanup :-> Tx'
50+
deposit : Value Tx'
51+
transfer : Value Tx'
52+
cleanup : Tx'
5353

5454

5555
makeTx : UTxOState PlutusScript Tx' (id : ℕ) Maybe Tx
@@ -82,7 +82,7 @@ evalTransanctionsW env (success s) (tx' ∷ txs') id =
8282
maybe
8383
(λ tx evalTransanctions
8484
initEnv
85-
(UTXO-stepW initEnv s tx)
85+
(UTXO-step initEnv s tx)
8686
txs'
8787
(suc id))
8888
(failure "failed to generate tx")

src/Test/Examples/DEx/Test/Trace.agda

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ initState' : UTxO
4242
initState' = fromList' (createInitUtxoState 5 startValue)
4343

4444

45-
data Tx' : Set where
45+
data Tx' : Set where
4646
start : Value Q.ℚ Tx'
4747
close : Tx'
4848
updatetx : Value Q.ℚ Tx'
4949
exchange : Value Tx'
50-
50+
5151

5252
makeTx : UTxOState PlutusScript Tx' (id : ℕ) Maybe Tx
5353
makeTx s script (start w v r) id = just (startTx id w 999 v r script)
5454
makeTx s script (close w) id = makeCloseTx id s script w
55-
makeTx s script (updatetx w v r) id = makeUpdateTx id s script w v r
55+
makeTx s script (updatetx w v r) id = makeUpdateTx id s script w v r
5656
makeTx s script (exchange w v) id = makeExchangeTx id s script w v
5757

5858
evalTransanctions : UTxOEnv ComputationResult String UTxOState List Tx' ComputationResult String UTxOState
@@ -75,7 +75,7 @@ evalTransanctionsW env (success s) (tx' ∷ txs') id =
7575
maybe
7676
(λ tx evalTransanctions
7777
initEnv
78-
(UTXO-stepW initEnv s tx)
78+
(UTXO-step initEnv s tx)
7979
txs'
8080
(suc id))
8181
(failure "failed to generate tx")
@@ -105,7 +105,7 @@ validTrace = start 5 (adaValueOf 80000000) rate
105105

106106
validTrace2 : List Tx'
107107
validTrace2 = start 5 (adaValueOf 8000000000) rate
108-
∷ exchange 1 (adaValueOf 70000000)
108+
∷ exchange 1 (adaValueOf 70000000)
109109
∷ []
110110

111111

@@ -123,7 +123,7 @@ opaque
123123

124124
evalValidTrace : ComputationResult String UTxOState
125125
evalValidTrace = evalTransanctionsW initEnv (success ⟦ initState' , 0 , ∅ , 0 ⟧ᵘ) validTrace 6
126-
126+
127127
evalValidTrace2 : ComputationResult String UTxOState
128128
evalValidTrace2 = evalTransanctionsW initEnv (success ⟦ initState' , 0 , ∅ , 0 ⟧ᵘ) validTrace2 6
129129

@@ -137,4 +137,4 @@ opaque
137137
_ = refl
138138

139139
_ : isSuccess evalFailingTrace ≡ false
140-
_ = refl
140+
_ = refl

src/Test/Examples/MultiSig/Test/Trace.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ evalTransanctionsW env (success s) (tx' ∷ txs') =
7878
maybe
7979
(λ tx evalTransanctions
8080
initEnv
81-
(UTXO-stepW initEnv s tx)
81+
(UTXO-step initEnv s tx)
8282
txs')
8383
(failure "failed to generate tx")
8484
(makeTx s multiSigScript tx')

src/Test/Examples/MultiSigV2/Test/Trace.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ evalTransanctionsW env (success s) (tx' ∷ txs') =
8585
maybe
8686
(λ tx evalTransanctions
8787
initEnv
88-
(UTXO-stepW initEnv s tx)
88+
(UTXO-step initEnv s tx)
8989
txs')
9090
(failure "failed to generate tx")
9191
(makeTx s multiSigScript tx')

0 commit comments

Comments
 (0)