Skip to content
Permalink
Browse files

Merge pull request #733 from input-output-hk/nc/tidy-forge

Tidying of block forging.
  • Loading branch information...
intricate committed Jul 12, 2019
2 parents e3336b5 + d17523f commit c7045df96dc5270cef24d37fcd5f01676b661b71
Showing with 7 additions and 4 deletions.
  1. +7 −4 ouroboros-consensus/src/Ouroboros/Consensus/Demo/Ledger/Byron/Forge.hs
@@ -100,15 +100,18 @@ forgeBlock cfg curSlot curNo prevHash txs () = do
}

headerGenesisKey :: Crypto.VerificationKey
VerKeyCardanoDSIGN headerGenesisKey = pbftGenVerKey $ encNodeConfigP cfg

dlgCertificate :: CC.Delegation.Certificate
(headerGenesisKey, dlgCertificate) = case findDelegate of
dlgCertificate = case findDelegate of
Just x -> x
Nothing -> error "Issuer is not a valid genesis key delegate."
where
dlgMap = CC.Genesis.unGenesisDelegation pbftGenesisDlg
VerKeyCardanoDSIGN issuer = pbftVerKey $ encNodeConfigP cfg
findDelegate = fmap (\crt -> (CC.Delegation.issuerVK crt, crt))
. find (\crt -> CC.Delegation.delegateVK crt == issuer)
VerKeyCardanoDSIGN delegate = pbftVerKey $ encNodeConfigP cfg
findDelegate = find (\crt -> CC.Delegation.delegateVK crt == delegate
&& CC.Delegation.issuerVK crt == headerGenesisKey
)
$ Map.elems dlgMap

forge :: PBftFields PBftCardanoCrypto CC.Block.ToSign

0 comments on commit c7045df

Please sign in to comment.
You can’t perform that action at this time.