Skip to content

Commit

Permalink
Merge pull request #682 from IntersectMBO/comments-and-indentation
Browse files Browse the repository at this point in the history
Comments and indentation
  • Loading branch information
palas authored Mar 27, 2024
2 parents 669bbc8 + d846e33 commit a38d570
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/CreateTestnetData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ runGenesisCreateTestNetDataCmd Cmd.GenesisCreateTestNetDataCmdArgs
stakeKeyToCredential :: Hash StakeKey -> L.Credential L.Staking L.StandardCrypto
stakeKeyToCredential (StakeKeyHash v) = L.KeyHashObj v

-- | 'zipWithDeepSeq' is like 'zipWith' but it ensures each element of the result is fully
-- evaluated before calculating the rest of the list. We do this in order to avoid the
-- case were we expand the intermediate representation (the two input lists) before
-- converging to the result. The intermediate representation is larger than the result,
-- so we try to avoid having it all in memory at once to reduce the memory footprint.
zipWithDeepSeq :: NFData c => (a -> b -> c) -> [a] -> [b] -> [c]
zipWithDeepSeq _ _ [] = []
zipWithDeepSeq _ [] _ = []
Expand Down Expand Up @@ -571,9 +576,9 @@ buildPoolParams nw dir index specifiedRelays = do

-- | This function should only be used for testing purposes.
-- Keys returned by this function are not cryptographically secure.
computeInsecureStakeKeyAddr :: StdGen
-> IO (StdGen, ( VerificationKey PaymentKey
, VerificationKey StakeKey ))
computeInsecureStakeKeyAddr
:: StdGen
-> IO (StdGen, (VerificationKey PaymentKey, VerificationKey StakeKey))
computeInsecureStakeKeyAddr g0 = do
(paymentKeys, g1) <- first getVerificationKey <$> generateInsecureSigningKey g0 AsPaymentKey
(stakeKeys , g2) <- first getVerificationKey <$> generateInsecureSigningKey g1 AsStakeKey
Expand Down

0 comments on commit a38d570

Please sign in to comment.