Skip to content

Commit 16850b3

Browse files
author
euonymos
committed
chore: reformat
1 parent 481a7a9 commit 16850b3

File tree

6 files changed

+41
-178
lines changed

6 files changed

+41
-178
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ clear-sockets:
77

88
run-oura-daemon:
99
@clear-sockets || true
10-
@oura daemon --config ./test/daemon.toml
10+
@oura daemon --config ./test/daemon.toml
11+
12+
format:
13+
@fourmolu --mode inplace $(git ls-files '*.hs')

cem-script.cabal

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ library cardano-extras
129129
build-depends: template-haskell
130130
exposed-modules:
131131
Cardano.Extras
132-
Plutus.Deriving
133132
Plutus.Extras
134133

135134
library
@@ -148,9 +147,9 @@ library
148147
Cardano.CEM.Monads
149148
Cardano.CEM.Monads.CLB
150149
Cardano.CEM.Monads.L1
151-
Cardano.CEM.OuraConfig
152150
Cardano.CEM.OffChain
153151
Cardano.CEM.OnChain
152+
Cardano.CEM.OuraConfig
154153
Cardano.CEM.Stages
155154
Cardano.CEM.Testing.StateMachine
156155
Cardano.CEM.TH
@@ -160,59 +159,61 @@ library
160159
, cem-script:cardano-extras
161160
, cem-script:data-spine
162161
, clb
163-
, toml-parser
164162
, dependent-map
165163
, ouroboros-consensus
166164
, QuickCheck
167165
, quickcheck-dynamic
168166
, singletons-th
167+
, toml-parser
169168

170169
test-suite cem-sdk-test
171170
import:
172171
common-onchain,
173172
common-offchain,
174173

175174
type: exitcode-stdio-1.0
176-
ghc-options: -threaded -Wno-missing-signatures -Wno-incomplete-uni-patterns
175+
ghc-options:
176+
-threaded -Wno-missing-signatures -Wno-incomplete-uni-patterns
177+
177178
build-depends:
179+
, aeson
180+
, async
181+
, base16
182+
, base32
183+
, base64
184+
, cardano-api
185+
, cardano-ledger-core
178186
, cem-script
179187
, cem-script:cardano-extras
180188
, cem-script:data-spine
181189
, clb
182190
, dependent-map
191+
, directory
183192
, hspec
184193
, hspec-core
194+
, lens
195+
, network
196+
, process
185197
, QuickCheck
186198
, quickcheck-dynamic
187199
, random
188-
, network
189-
, directory
200+
, safe
190201
, toml-parser
191-
, process
192-
, async
193-
, lens
194-
, aeson
195-
, base64
196-
, cardano-api
197-
, cardano-ledger-core
198202
, vector
199-
, safe
200-
, base16
201-
, base32
202203

203204
hs-source-dirs: test/
204205
other-modules:
205206
Auction
206207
Dynamic
207208
OffChain
208-
TestNFT
209-
Utils
210-
Voting
211209
Oura
212210
Oura.Communication
213211
Oura.Config
214212
OuraFilters
215213
OuraFilters.Auction
216214
OuraFilters.Mock
215+
TestNFT
216+
Utils
217+
Voting
217218

218219
main-is: Main.hs

docs/arch_principles.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
## Principles
44

5-
* Generic compilation across: on-chain code,
6-
offchain Tx construction and indexing backend
5+
* Generic compilation across:
6+
* on-chain code
7+
* offchain Tx construction
8+
* indexing backend
79
* Simple normalization and SMT conversion for:
810
* Equivalence checking
911
* Bi-simulation checking
10-
* Constraints determine TxIn/Outs up to UTxO coin-selection
11-
(we call it almost-determinacy)
12+
* Constraints determine TxIn/Outs up to UTxO coin-selection (we call it almost-determinacy)
1213
* Datum properties encoded as class types
1314
* Common on-chain optimizations are performed if possible
14-
* Constraints normalization, and CSE
15+
* Constraints normalization, and CSE
1516
* Best error short-cutting
1617
* Common security problems prevention
1718

1819
## Potential obstacles
1920

2021
* Ease and optimality of backend compilation
2122
* Robustness of SMT conversion and overall normalization
22-
* Possibility for parsing and correct offchain usage
23-
of almost-determinacy
23+
* Possibility for parsing and correct offchain usage of almost-determinacy
2424
* Having enough information for Tx submit retrying strategies
2525
* Design for using custom Datum properties is not obvious
2626

@@ -32,9 +32,8 @@ all their principles and obstacles are affecting CEM as well.
3232
## Principles
3333

3434
* State-machine is deterministic modulo coin-change
35-
* Transaction can always be parsed back into SM transitions
36-
* Potential non-deterministic on-chain optimizations
37-
should not affect this principle.
35+
* Transaction can always be parsed back into SM transitions
36+
* Potential non-deterministic on-chain optimizations should not affect this principle.
3837

3938
## Potential obstacles
4039

docs/goals_and_soa.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
## Why Cardano DApp modeling language is important?
44

5-
While prototypes can be easily constructed with existing Cardano frameworks, making it secure and production ready is sisyphean task.
5+
While prototypes can be easily constructed with existing Cardano frameworks,
6+
making it secure and production ready is sisyphean task.
67

7-
We believe, that onchain PL improvements by themselves could not change that. Only higher-level modeling framework can lead to reliable DApp production.
8+
We believe, that onchain PL improvements by themselves could not change that.
9+
Only higher-level modeling framework can lead to reliable DApp production.
810

911
In following enumerate our high-level design goals
1012
and demonstrate them by list of specific problems
1113
arising in existing DApps codebase.
14+
1215
Such problems are specific security vulnerabilities types
1316
and various kinds development, audit and support cost increase.
1417
After that we examine how existing solutions

src-lib/cardano-extras/Plutus/Deriving.hs

Lines changed: 0 additions & 144 deletions
This file was deleted.

src/Cardano/CEM.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import PlutusTx.Show.TH qualified
1919
-- Project imports
2020
import Cardano.CEM.Stages
2121
import Data.Spine
22-
import qualified PlutusTx.IsData.Class
22+
import PlutusTx.IsData.Class qualified
2323

2424
-- | This is different ways to specify address
2525
data AddressSpec
@@ -35,7 +35,7 @@ addressSpecToAddress ownAddress addressSpec = case addressSpec of
3535
ByPubKey pubKey -> pubKeyHashAddress pubKey
3636
BySameScript -> ownAddress
3737

38-
-- "Tx Fan" - is transaction input or output
38+
-- "Tx Fan" - is transaction input or output
3939

4040
-- FIXME: What is this?
4141
data TxFanFilter script = MkTxFanFilter
@@ -67,6 +67,7 @@ bySameCEM ::
6767
bySameCEM = UnsafeBySameCEM . toBuiltinData
6868

6969
-- TODO: use natural numbers
70+
7071
-- | How many tx fans should satify a 'TxFansConstraint'
7172
data Quantifier
7273
= ExactlyNFans Integer

0 commit comments

Comments
 (0)