-
Notifications
You must be signed in to change notification settings - Fork 86
/
Examples.hs
508 lines (454 loc) · 19.7 KB
/
Examples.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
module Test.Consensus.Shelley.Examples (
-- * Setup
testEpochInfo
, testShelleyGenesis
, codecConfig
, mkDummyHash
-- * Examples
, examples
, exampleBlock
, exampleHeader
, exampleHeaderHash
, exampleTx
, exampleGenTx
, exampleGenTxId
, exampleApplyTxErr
, exampleChainDepState
, exampleLedgerState
, exampleHeaderState
, exampleExtLedgerState
) where
import Data.ByteString (ByteString)
import qualified Data.ByteString as Strict
import Data.Coerce (coerce)
import Data.Functor.Identity (Identity (..))
import qualified Data.Map.Strict as Map
import Data.Maybe (fromJust)
import qualified Data.Sequence.Strict as StrictSeq
import qualified Data.Set as Set
import Data.Time (UTCTime (..), fromGregorian)
import Data.Word (Word64, Word8)
import Cardano.Binary (toCBOR)
import Cardano.Crypto.DSIGN (DSIGNAlgorithm)
import qualified Cardano.Crypto.DSIGN as DSIGN
import Cardano.Crypto.Hash (HashAlgorithm)
import qualified Cardano.Crypto.Hash as Hash
import qualified Cardano.Crypto.Seed as Seed
import Cardano.Crypto.VRF (VRFAlgorithm)
import qualified Cardano.Crypto.VRF as VRF
import Cardano.Slotting.EpochInfo
import Ouroboros.Network.Block (Serialised (..))
import Ouroboros.Consensus.Block
import Ouroboros.Consensus.HeaderValidation
import Ouroboros.Consensus.Ledger.Abstract
import Ouroboros.Consensus.Ledger.Extended
import Ouroboros.Consensus.Ledger.SupportsMempool
import Ouroboros.Consensus.Protocol.Abstract
import Ouroboros.Consensus.Storage.Serialisation
import Ouroboros.Consensus.Util.Time
import Cardano.Ledger.Crypto (ADDRHASH, Crypto, DSIGN, VRF)
import Shelley.Spec.Ledger.API (StrictMaybe (..))
import qualified Shelley.Spec.Ledger.API as SL
import qualified Shelley.Spec.Ledger.BaseTypes as SL (mkNonceFromNumber,
textToUrl)
import qualified Shelley.Spec.Ledger.BlockChain as SL (TxSeq (..))
import qualified Shelley.Spec.Ledger.Coin as SL (DeltaCoin (..))
import qualified Shelley.Spec.Ledger.Delegation.Certificates as SL
(IndividualPoolStake (..))
import qualified Shelley.Spec.Ledger.EpochBoundary as SL (BlocksMade (..),
emptySnapShots)
import qualified Shelley.Spec.Ledger.Keys as SL (asWitness, hashWithSerialiser,
signedKES)
import qualified Shelley.Spec.Ledger.LedgerState as SL (emptyDPState,
emptyPPUPState)
import qualified Shelley.Spec.Ledger.MetaData as SL (hashMetaData)
import qualified Shelley.Spec.Ledger.PParams as SL (emptyPParams,
emptyPParamsUpdate)
import qualified Shelley.Spec.Ledger.Rewards as SL (emptyNonMyopic)
import qualified Shelley.Spec.Ledger.STS.Ledger as SL
(LedgerPredicateFailure (..))
import qualified Shelley.Spec.Ledger.STS.Ledgers as SL
(LedgersPredicateFailure (..))
import qualified Shelley.Spec.Ledger.STS.Utxow as SL
(UtxowPredicateFailure (..))
import qualified Shelley.Spec.Ledger.Tx as SL (addrWits)
import qualified Shelley.Spec.Ledger.TxBody as SL (eraIndTxBodyHash)
import qualified Shelley.Spec.Ledger.UTxO as SL (makeWitnessesVKey)
import qualified Test.Shelley.Spec.Ledger.Generator.Core as SL
(AllIssuerKeys (..), genesisId, mkOCert)
import Test.Shelley.Spec.Ledger.Orphans ()
import qualified Test.Shelley.Spec.Ledger.Utils as SL hiding (mkKeyPair,
mkKeyPair', mkVRFKeyPair)
import Ouroboros.Consensus.Shelley.Eras (EraCrypto, StandardShelley)
import Ouroboros.Consensus.Shelley.Ledger
import Ouroboros.Consensus.Shelley.Protocol (PraosCrypto,
TPraosState (..))
import Test.Util.Orphans.Arbitrary ()
import Test.Util.Serialisation.Golden (labelled, unlabelled)
import qualified Test.Util.Serialisation.Golden as Golden
import Test.Util.Serialisation.Roundtrip (SomeResult (..))
{-------------------------------------------------------------------------------
Setup
-------------------------------------------------------------------------------}
testEpochInfo :: EpochInfo Identity
testEpochInfo = SL.epochInfo SL.testGlobals
-- | These are dummy values.
testShelleyGenesis :: SL.ShelleyGenesis era
testShelleyGenesis = SL.ShelleyGenesis {
sgSystemStart = UTCTime (fromGregorian 2020 5 14) 0
, sgNetworkMagic = 0
, sgNetworkId = SL.Testnet
-- Chosen to match SL.activeSlotCoeff
, sgActiveSlotsCoeff = 0.9
, sgSecurityParam = SL.securityParameter SL.testGlobals
, sgEpochLength = runIdentity $ epochInfoSize testEpochInfo 0
, sgSlotsPerKESPeriod = SL.slotsPerKESPeriod SL.testGlobals
, sgMaxKESEvolutions = SL.maxKESEvo SL.testGlobals
-- Not important
, sgSlotLength = secondsToNominalDiffTime 2
, sgUpdateQuorum = SL.quorum SL.testGlobals
, sgMaxLovelaceSupply = SL.maxLovelaceSupply SL.testGlobals
, sgProtocolParams = SL.emptyPParams
, sgGenDelegs = Map.empty
, sgInitialFunds = Map.empty
, sgStaking = SL.emptyGenesisStaking
}
codecConfig :: CodecConfig (ShelleyBlock StandardShelley)
codecConfig = ShelleyCodecConfig
mkDummyHash :: forall h a. HashAlgorithm h => Proxy h -> Int -> Hash.Hash h a
mkDummyHash _ = coerce . SL.hashWithSerialiser @h toCBOR
mkKeyHash :: forall c discriminator. Crypto c => Int -> SL.KeyHash discriminator c
mkKeyHash = SL.KeyHash . mkDummyHash (Proxy @(ADDRHASH c))
mkScriptHash :: forall era. ShelleyBasedEra era => Int -> SL.ScriptHash era
mkScriptHash = SL.ScriptHash . mkDummyHash (Proxy @(ADDRHASH (EraCrypto era)))
-- | @mkKeyPair'@ from @Test.Shelley.Spec.Ledger.Utils@ doesn't work for real
-- crypto:
-- <https://github.com/input-output-hk/cardano-ledger-specs/issues/1770>
mkDSIGNKeyPair ::
forall c kd. DSIGNAlgorithm (DSIGN c)
=> Word8
-> SL.KeyPair kd c
mkDSIGNKeyPair byte = SL.KeyPair (SL.VKey $ DSIGN.deriveVerKeyDSIGN sk) sk
where
seed =
Seed.mkSeedFromBytes $
Strict.replicate
(fromIntegral (DSIGN.seedSizeDSIGN (Proxy @(DSIGN c))))
byte
sk = DSIGN.genKeyDSIGN seed
mkVRFKeyPair ::
forall c. VRFAlgorithm (VRF c)
=> Proxy c
-> Word8
-> (SL.SignKeyVRF c, SL.VerKeyVRF c)
mkVRFKeyPair _ byte = (sk, VRF.deriveVerKeyVRF sk)
where
seed =
Seed.mkSeedFromBytes $
Strict.replicate
(fromIntegral (VRF.seedSizeVRF (Proxy @(VRF c))))
byte
sk = VRF.genKeyVRF seed
keyToCredential :: ShelleyBasedEra era => SL.KeyPair r (EraCrypto era) -> SL.Credential r era
keyToCredential = SL.KeyHashObj . SL.hashKey . SL.vKey
{-------------------------------------------------------------------------------
Examples
-------------------------------------------------------------------------------}
examples :: Golden.Examples (ShelleyBlock StandardShelley)
examples = Golden.Examples {
exampleBlock = unlabelled exampleBlock
, exampleSerialisedBlock = unlabelled exampleSerialisedBlock
, exampleHeader = unlabelled exampleHeader
, exampleSerialisedHeader = unlabelled exampleSerialisedHeader
, exampleHeaderHash = unlabelled exampleHeaderHash
, exampleGenTx = unlabelled exampleGenTx
, exampleGenTxId = unlabelled exampleGenTxId
, exampleApplyTxErr = unlabelled exampleApplyTxErr
, exampleQuery = queries
, exampleResult = results
, exampleAnnTip = unlabelled exampleAnnTip
, exampleLedgerState = unlabelled exampleLedgerState
, exampleChainDepState = unlabelled exampleChainDepState
, exampleExtLedgerState = unlabelled exampleExtLedgerState
}
where
queries = labelled [
("GetLedgerTip", SomeSecond GetLedgerTip)
, ("GetEpochNo", SomeSecond GetEpochNo)
, ("GetCurrentPParams", SomeSecond GetCurrentPParams)
, ("GetProposedPParamsUpdates", SomeSecond GetProposedPParamsUpdates)
, ("GetStakeDistribution", SomeSecond GetStakeDistribution)
, ("GetNonMyopicMemberRewards",
SomeSecond $ GetNonMyopicMemberRewards $ Set.fromList [
Left (SL.Coin 100)
, Right (SL.ScriptHashObj (mkScriptHash 1))
, Right (SL.KeyHashObj (mkKeyHash 2))
])
, ("GetGenesisConfig", SomeSecond GetGenesisConfig)
]
results = labelled [
("LedgerTip", SomeResult GetLedgerTip (blockPoint exampleBlock))
, ("EpochNo", SomeResult GetEpochNo 10)
, ("EmptyPParams", SomeResult GetCurrentPParams SL.emptyPParams)
, ("ProposedPParamsUpdates", SomeResult GetProposedPParamsUpdates proposedPParamsUpdates)
, ("StakeDistribution", SomeResult GetStakeDistribution examplePoolDistr)
, ("NonMyopicMemberRewards", SomeResult (GetNonMyopicMemberRewards Set.empty)
(NonMyopicMemberRewards $ Map.fromList [
(Left (SL.Coin 100), Map.singleton (mkKeyHash 2) (SL.Coin 3))
, (Right (SL.ScriptHashObj (mkScriptHash 1)), Map.empty)
, (Right (SL.KeyHashObj (mkKeyHash 2)), Map.singleton (mkKeyHash 3) (SL.Coin 9))
]))
, ("GenesisConfig", SomeResult GetGenesisConfig (compactGenesis testShelleyGenesis))
]
proposedPParamsUpdates :: SL.ProposedPPUpdates StandardShelley
proposedPParamsUpdates = SL.ProposedPPUpdates $ Map.singleton
(mkKeyHash 0)
(SL.emptyPParamsUpdate {SL._keyDeposit = SJust (SL.Coin 100)})
examplePoolDistr :: forall c. PraosCrypto c => SL.PoolDistr c
examplePoolDistr = SL.PoolDistr $ Map.fromList [
(mkKeyHash 1, SL.IndividualPoolStake
1
(SL.hashVerKeyVRF (snd (SL.vrf (exampleKeys @c)))))
]
-- | This is not a valid block. We don't care, we are only interested in
-- serialisation, not validation.
exampleBlock :: forall era. era ~ StandardShelley => ShelleyBlock era
exampleBlock = mkShelleyBlock $ SL.Block blockHeader blockBody
where
keys :: SL.AllIssuerKeys (EraCrypto era) 'SL.StakePool
keys = exampleKeys
(_, (hotKey, _)) = head $ SL.hot keys
SL.KeyPair vKeyCold _ = SL.cold keys
blockHeader :: SL.BHeader (EraCrypto era)
blockHeader = SL.BHeader blockHeaderBody (SL.signedKES () 0 blockHeaderBody hotKey)
blockHeaderBody :: SL.BHBody (EraCrypto era)
blockHeaderBody = SL.BHBody {
bheaderBlockNo = BlockNo 3
, bheaderSlotNo = SlotNo 9
, bheaderPrev = SL.BlockHash (SL.HashHeader (mkDummyHash Proxy 2))
, bheaderVk = SL.coerceKeyRole vKeyCold
, bheaderVrfVk = snd $ SL.vrf keys
, bheaderEta = SL.mkCertifiedVRF (mkBytes 0) (fst $ SL.vrf keys)
, bheaderL = SL.mkCertifiedVRF (mkBytes 1) (fst $ SL.vrf keys)
, bsize = 2345
, bhash = SL.bbHash blockBody
, bheaderOCert = SL.mkOCert keys 0 (SL.KESPeriod 0)
, bprotver = SL.ProtVer 2 0
}
blockBody :: SL.TxSeq era
blockBody = SL.TxSeq (StrictSeq.fromList [exampleTx])
mkBytes :: Word8 -> ByteString
mkBytes =
Strict.replicate
(fromIntegral (VRF.sizeOutputVRF (Proxy @(VRF (EraCrypto era)))))
exampleSerialisedBlock :: Serialised (ShelleyBlock StandardShelley)
exampleSerialisedBlock = Serialised "<BLOCK>"
exampleHeader :: Header (ShelleyBlock StandardShelley)
exampleHeader = getHeader exampleBlock
exampleSerialisedHeader :: SerialisedHeader (ShelleyBlock StandardShelley)
exampleSerialisedHeader = SerialisedHeaderFromDepPair $
GenDepPair (NestedCtxt CtxtShelley) (Serialised "<HEADER>")
exampleHeaderHash :: HeaderHash (ShelleyBlock StandardShelley)
exampleHeaderHash = blockHash exampleBlock
-- | This is not a valid transaction. We don't care, we are only interested in
-- serialisation, not validation.
exampleTx :: forall era. era ~ StandardShelley => SL.Tx era
exampleTx = SL.Tx txBody witnessSet (SJust metadata)
where
txBody :: SL.TxBody era
txBody = SL.TxBody
(Set.fromList [
SL.TxIn SL.genesisId 0
])
(StrictSeq.fromList [
SL.TxOut (SL.mkAddr (examplePayKey, exampleStakeKey)) (SL.Coin 100000)
])
(StrictSeq.fromList [
SL.DCertDeleg (SL.RegKey (keyToCredential exampleStakeKey))
, SL.DCertPool (SL.RegPool examplePoolParams)
, SL.DCertMir $ SL.MIRCert SL.ReservesMIR $ Map.fromList [
(keyToCredential (mkDSIGNKeyPair 2), SL.Coin 110)
]
])
(SL.Wdrl $ Map.fromList [
(SL._poolRAcnt examplePoolParams, (SL.Coin 100))
])
(SL.Coin 3)
(SlotNo 10)
(SJust (SL.Update ppup (EpochNo 0)))
(SJust (SL.hashMetaData metadata))
where
ppup :: SL.ProposedPPUpdates era
ppup = SL.ProposedPPUpdates $
Map.singleton
(mkKeyHash 1)
(SL.emptyPParamsUpdate { SL._maxBHSize = SJust 4000 })
witnessSet :: SL.WitnessSet era
witnessSet = mempty {
SL.addrWits =
SL.makeWitnessesVKey (SL.eraIndTxBodyHash txBody) witnesses
}
where
witnesses :: [SL.KeyPair 'SL.Witness (EraCrypto era)]
witnesses = [
SL.asWitness examplePayKey
, SL.asWitness exampleStakeKey
, SL.asWitness $ SL.cold (exampleKeys @(EraCrypto era) @'SL.StakePool)
]
metadata :: SL.MetaData
metadata = SL.MetaData $ Map.fromList [
(1, SL.S "string")
, (2, SL.B "bytes")
, (3, SL.List [SL.I 1, SL.I 2])
, (4, SL.Map [(SL.I 3, SL.B "b")])
]
exampleGenTx :: GenTx (ShelleyBlock StandardShelley)
exampleGenTx = mkShelleyTx exampleTx
exampleGenTxId :: GenTxId (ShelleyBlock StandardShelley)
exampleGenTxId = txId exampleGenTx
-- TODO incomplete, this type has tons of constructors that can all change.
-- <https://github.com/input-output-hk/ouroboros-network/issues/1896.
exampleApplyTxErr :: ApplyTxErr (ShelleyBlock StandardShelley)
exampleApplyTxErr =
ApplyTxError
$ pure
$ SL.LedgerFailure
$ SL.UtxowFailure
$ SL.InvalidWitnessesUTXOW [SL.asWitness (SL.vKey exampleStakeKey)]
exampleAnnTip :: AnnTip (ShelleyBlock StandardShelley)
exampleAnnTip = AnnTip {
annTipSlotNo = SlotNo 14
, annTipBlockNo = BlockNo 6
, annTipInfo = exampleHeaderHash
}
exampleChainDepState ::
forall era. era ~ StandardShelley
=> ChainDepState (BlockProtocol (ShelleyBlock era))
exampleChainDepState = TPraosState (NotOrigin 1) (mkPrtclState 1)
where
mkPrtclState :: Word64 -> SL.ChainDepState (EraCrypto era)
mkPrtclState seed = SL.ChainDepState
{ SL.csProtocol = SL.PrtclState
(Map.fromList [
(mkKeyHash 1, 1)
, (mkKeyHash 2, 2)
])
(SL.mkNonceFromNumber seed)
(SL.mkNonceFromNumber seed)
, SL.csTickn = SL.TicknState
SL.NeutralNonce
(SL.mkNonceFromNumber seed)
, SL.csLabNonce =
SL.mkNonceFromNumber seed
}
-- | This is probably not a valid ledger. We don't care, we are only
-- interested in serialisation, not validation.
exampleNewEpochState ::
forall era. era ~ StandardShelley
=> SL.NewEpochState era
exampleNewEpochState = SL.NewEpochState {
nesEL = EpochNo 0
, nesBprev = SL.BlocksMade (Map.singleton (mkKeyHash 1) 10)
, nesBcur = SL.BlocksMade (Map.singleton (mkKeyHash 2) 3)
, nesEs = epochState
, nesRu = SJust rewardUpdate
, nesPd = examplePoolDistr
}
where
epochState :: SL.EpochState era
epochState = SL.EpochState {
esAccountState = SL.AccountState {
_treasury = SL.Coin 10000
, _reserves = SL.Coin 1000
}
, esSnapshots = SL.emptySnapShots
, esLState = SL.LedgerState {
_utxoState = SL.UTxOState {
_utxo = SL.UTxO $ Map.fromList [
(SL.TxIn (SL.TxId (mkDummyHash Proxy 1)) 0,
SL.TxOut addr (SL.Coin 10))
]
, _deposited = SL.Coin 1000
, _fees = SL.Coin 1
, _ppups = SL.emptyPPUPState
}
, _delegationState = SL.emptyDPState
}
, esPrevPp = SL.emptyPParams
, esPp = SL.emptyPParams { SL._minUTxOValue = SL.Coin 1 }
, esNonMyopic = nonMyopic
}
where
addr :: SL.Addr era
addr = SL.Addr
SL.Testnet
(keyToCredential examplePayKey)
(SL.StakeRefBase (keyToCredential exampleStakeKey))
rewardUpdate :: SL.RewardUpdate era
rewardUpdate = SL.RewardUpdate {
deltaT = SL.Coin 10
, deltaR = SL.DeltaCoin (- 100)
, rs = Map.singleton (keyToCredential exampleStakeKey) (SL.Coin 10)
, deltaF = SL.DeltaCoin (- 3)
, nonMyopic = nonMyopic
}
nonMyopic :: SL.NonMyopic era
nonMyopic = SL.emptyNonMyopic
exampleLedgerState :: LedgerState (ShelleyBlock StandardShelley)
exampleLedgerState = ShelleyLedgerState {
shelleyLedgerTip = NotOrigin ShelleyTip {
shelleyTipSlotNo = blockSlot exampleBlock
, shelleyTipBlockNo = blockNo exampleBlock
, shelleyTipHash = blockHash exampleBlock
}
, shelleyLedgerState = exampleNewEpochState
, shelleyLedgerTransition = ShelleyTransitionInfo {shelleyAfterVoting = 0}
}
exampleHeaderState :: HeaderState (ShelleyBlock StandardShelley)
exampleHeaderState = genesisHeaderState exampleChainDepState
exampleExtLedgerState :: ExtLedgerState (ShelleyBlock StandardShelley)
exampleExtLedgerState = ExtLedgerState {
ledgerState = exampleLedgerState
, headerState = exampleHeaderState
}
{-------------------------------------------------------------------------------
Keys
-------------------------------------------------------------------------------}
examplePayKey :: Crypto c => SL.KeyPair 'SL.Payment c
examplePayKey = mkDSIGNKeyPair 0
exampleStakeKey :: Crypto c => SL.KeyPair 'SL.Staking c
exampleStakeKey = mkDSIGNKeyPair 1
exampleKeys :: forall c r. Crypto c => SL.AllIssuerKeys c r
exampleKeys =
SL.AllIssuerKeys
coldKey
(mkVRFKeyPair (Proxy @c) 1)
[(SL.KESPeriod 0, SL.mkKESKeyPair (1, 0, 0, 0, 3))]
(SL.hashKey (SL.vKey coldKey))
where
coldKey = mkDSIGNKeyPair 1
examplePoolParams :: forall era. ShelleyBasedEra era => SL.PoolParams era
examplePoolParams = SL.PoolParams {
_poolId = SL.hashKey $ SL.vKey $ SL.cold poolKeys
, _poolVrf = SL.hashVerKeyVRF $ snd $ SL.vrf poolKeys
, _poolPledge = SL.Coin 1
, _poolCost = SL.Coin 5
, _poolMargin = SL.unsafeMkUnitInterval 0.1
, _poolRAcnt = SL.RewardAcnt SL.Testnet (keyToCredential exampleStakeKey)
, _poolOwners = Set.singleton $ SL.hashKey $ SL.vKey exampleStakeKey
, _poolRelays = StrictSeq.empty
, _poolMD = SJust $ SL.PoolMetaData {
_poolMDUrl = fromJust $ SL.textToUrl "consensus.pool"
, _poolMDHash = "{}"
}
}
where
poolKeys = exampleKeys @(EraCrypto era) @'SL.StakePool