|
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@
|
@@ -85,31 +79,17 @@ finaliseCardanoConfiguration PartialCardanoConfiguration{..} = do
|
85 | 79 | -- | Finalize the @PartialCore@, convert to @Core@.
|
86 | 80 | finaliseCore :: PartialCore -> Either Text Core
|
87 | 81 | 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 | 82 |
|
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{..} |
| 83 | + coGenesisFile <- lastToEither "Unspecified coGenesisFile" pcoGenesisFile |
| 84 | + coGenesisHash <- lastToEither "Unspecified coGenesisHash" pcoGenesisHash |
105 | 85 |
|
106 |
| -finaliseStaticKeyMaterial :: PartialStaticKeyMaterial -> Either Text StaticKeyMaterial |
107 |
| -finaliseStaticKeyMaterial PartialStaticKeyMaterial{..} = do |
| 86 | + coStaticKeySigningKeyFile <- lastToEither "Unspecified coStaticKeySigningKeyFile" pcoStaticKeySigningKeyFile |
| 87 | + coStaticKeyDlgCertFile <- lastToEither "Unspecified coStaticKeyDlgCertFile" pcoStaticKeyDlgCertFile |
108 | 88 |
|
109 |
| - skmSigningKeyFile <- lastToEither "Unspecified skmSigningKeyFile" pskmSigningKeyFile |
110 |
| - skmDlgCertFile <- lastToEither "Unspecified skmDlgCertFile" pskmDlgCertFile |
| 89 | + coRequiresNetworkMagic <- lastToEither "Unspecified coRequiresNetworkMagic" pcoRequiresNetworkMagic |
| 90 | + coDBSerializeVersion <- lastToEither "Unspecified coDBSerializeVersion" pcoDBSerializeVersion |
111 | 91 |
|
112 |
| - pure StaticKeyMaterial{..} |
| 92 | + pure Core{..} |
113 | 93 |
|
114 | 94 | -- | Finalize the @PartialNode@, convert to @Node@.
|
115 | 95 | finaliseNode :: PartialNode -> Either Text Node
|
@@ -169,24 +149,16 @@ finaliseTLS PartialTLS{..} = do
|
169 | 149 |
|
170 | 150 | pure TLS{..}
|
171 | 151 |
|
172 |
| --- | Finalise the @PartialThrottle@, convert to @Throttle@. |
173 |
| -finaliseThrottle :: PartialThrottle -> Either Text Throttle |
174 |
| -finaliseThrottle PartialThrottle{..} = do |
| 152 | +-- | Finalize the @PartialWallet@, convert to @Wallet@. |
| 153 | +finaliseWallet :: PartialWallet -> Either Text Wallet |
| 154 | +finaliseWallet PartialWallet{..} = do |
175 | 155 |
|
176 | 156 | thEnabled <- lastToEither "Unspecified thEnabled" pthEnabled
|
177 | 157 | thRate <- lastToEither "Unspecified thRate" pthRate
|
178 | 158 | thPeriod <- lastToEither "Unspecified thPeriod" pthPeriod
|
179 | 159 | thBurst <- lastToEither "Unspecified thBurst" pthBurst
|
180 | 160 |
|
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{..} |
| 161 | + pure Wallet {..} |
190 | 162 |
|
191 | 163 |
|
192 | 164 | -- | Generate 'TopologyConfig' with given 'Cluster'
|
|
0 commit comments