3
3
module Cardano.Shell.Configuration.Lib
4
4
( finaliseCardanoConfiguration
5
5
, finaliseCore
6
- , finaliseGenesis
7
6
, mkLauncher
8
7
, mkTopology
9
8
, mkOSConfig
@@ -32,18 +31,13 @@ import Cardano.Shell.Configuration.Types (BlockchainConfig,
32
31
import Cardano.Shell.Constants.PartialTypes (PartialBlock (.. ), PartialCardanoConfiguration (.. ),
33
32
PartialCertificate (.. ),
34
33
PartialCore (.. ),
35
- PartialGenesis (.. ),
36
34
PartialNode (.. ),
37
- PartialStaticKeyMaterial (.. ),
38
35
PartialTLS (.. ),
39
- PartialThrottle (.. ),
40
36
PartialWallet (.. ))
41
37
import Cardano.Shell.Constants.Types (Block (.. ),
42
38
CardanoConfiguration (.. ),
43
39
Certificate (.. ), Core (.. ),
44
- Genesis (.. ), Node (.. ),
45
- StaticKeyMaterial (.. ),
46
- TLS (.. ), Throttle (.. ),
40
+ Node (.. ), TLS (.. ),
47
41
Wallet (.. ))
48
42
49
43
-- | Converting a @Last@ to an @Either@
@@ -64,52 +58,35 @@ finaliseCardanoConfiguration PartialCardanoConfiguration{..} = do
64
58
ccDBPath <- lastToEither " Unspecified ccDBPath" pccDBPath
65
59
ccApplicationLockFile <- lastToEither " Unspecified ccApplicationLockFile"
66
60
pccApplicationLockFile
67
- ccCore <- join $ finaliseCore <$>
68
- lastToEither " Unspecified ccCore" pccCore
61
+ ccCore <- finaliseCore pccCore
69
62
ccNTP <- lastToEither " Unspecified ccNTP" pccNTP
70
63
ccUpdate <- lastToEither " Unspecified ccUpdate" pccUpdate
71
64
ccTXP <- lastToEither " Unspecified ccTXP" pccTXP
72
65
ccSSC <- lastToEither " Unspecified ccSSC" pccSSC
73
66
ccDLG <- lastToEither " Unspecified ccDLG" pccDLG
74
- ccBlock <- join $ finaliseBlock <$>
75
- lastToEither " Unspecified ccBlock" pccBlock
67
+ ccBlock <- finaliseBlock pccBlock
76
68
ccNode <- join $ finaliseNode <$>
77
69
lastToEither " Unspecified ccNode" pccNode
78
70
ccTLS <- join $ finaliseTLS <$>
79
71
lastToEither " Unspecified ccTLS" pccTLS
80
- ccWallet <- join $ finaliseWallet <$>
81
- lastToEither " Unspecified ccWallet" pccWallet
72
+ ccWallet <- finaliseWallet pccWallet
82
73
83
74
pure CardanoConfiguration {.. }
84
75
85
76
-- | Finalize the @PartialCore@, convert to @Core@.
86
77
finaliseCore :: PartialCore -> Either Text Core
87
78
finaliseCore PartialCore {.. } = do
88
- coGenesis <- join $ finaliseGenesis <$>
89
- lastToEither " Unspecified coGenesis" pcoGenesis
90
- coStaticKeyMaterial <- join $ finaliseStaticKeyMaterial <$>
91
- lastToEither " Unspecified coStaticKeyMaterial" pcoStaticKeyMaterial
92
- coRequiresNetworkMagic <- lastToEither " Unspecified coRequiresNetworkMagic" pcoRequiresNetworkMagic
93
- coDBSerializeVersion <- lastToEither " Unspecified coDBSerializeVersion" pcoDBSerializeVersion
94
79
95
- pure Core {.. }
96
-
97
- -- | Finalize the @PartialGenesis@, convert to @Genesis@.
98
- finaliseGenesis :: PartialGenesis -> Either Text Genesis
99
- finaliseGenesis PartialGenesis {.. } = do
100
-
101
- geSrc <- lastToEither " Unspecified geSrc" pgeSrc
102
- geGenesisHash <- lastToEither " Unspecified geGenesisHash" pgeGenesisHash
103
-
104
- pure Genesis {.. }
80
+ coGenesisFile <- lastToEither " Unspecified coGenesisFile" pcoGenesisFile
81
+ coGenesisHash <- lastToEither " Unspecified coGenesisHash" pcoGenesisHash
105
82
106
- finaliseStaticKeyMaterial :: PartialStaticKeyMaterial -> Either Text StaticKeyMaterial
107
- finaliseStaticKeyMaterial PartialStaticKeyMaterial { .. } = do
83
+ coStaticKeySigningKeyFile <- lastToEither " Unspecified coStaticKeySigningKeyFile " pcoStaticKeySigningKeyFile
84
+ coStaticKeyDlgCertFile <- lastToEither " Unspecified coStaticKeyDlgCertFile " pcoStaticKeyDlgCertFile
108
85
109
- skmSigningKeyFile <- lastToEither " Unspecified skmSigningKeyFile " pskmSigningKeyFile
110
- skmDlgCertFile <- lastToEither " Unspecified skmDlgCertFile " pskmDlgCertFile
86
+ coRequiresNetworkMagic <- lastToEither " Unspecified coRequiresNetworkMagic " pcoRequiresNetworkMagic
87
+ coDBSerializeVersion <- lastToEither " Unspecified coDBSerializeVersion " pcoDBSerializeVersion
111
88
112
- pure StaticKeyMaterial {.. }
89
+ pure Core {.. }
113
90
114
91
-- | Finalize the @PartialNode@, convert to @Node@.
115
92
finaliseNode :: PartialNode -> Either Text Node
@@ -169,24 +146,16 @@ finaliseTLS PartialTLS{..} = do
169
146
170
147
pure TLS {.. }
171
148
172
- -- | Finalise the @PartialThrottle @, convert to @Throttle @.
173
- finaliseThrottle :: PartialThrottle -> Either Text Throttle
174
- finaliseThrottle PartialThrottle {.. } = do
149
+ -- | Finalize the @PartialWallet @, convert to @Wallet @.
150
+ finaliseWallet :: PartialWallet -> Either Text Wallet
151
+ finaliseWallet PartialWallet {.. } = do
175
152
176
153
thEnabled <- lastToEither " Unspecified thEnabled" pthEnabled
177
154
thRate <- lastToEither " Unspecified thRate" pthRate
178
155
thPeriod <- lastToEither " Unspecified thPeriod" pthPeriod
179
156
thBurst <- lastToEither " Unspecified thBurst" pthBurst
180
157
181
- pure Throttle {.. }
182
-
183
- -- | Finalize the @PartialWallet@, convert to @Wallet@.
184
- finaliseWallet :: PartialWallet -> Either Text Wallet
185
- finaliseWallet PartialWallet {.. } = do
186
-
187
- waThrottle <- join $ finaliseThrottle <$> lastToEither " Unspecified waThrottle" pwaThrottle
188
-
189
- pure Wallet {.. }
158
+ pure Wallet {.. }
190
159
191
160
192
161
-- | Generate 'TopologyConfig' with given 'Cluster'
0 commit comments