Skip to content
Permalink
Browse files

Define the undefined [skip ci]

  • Loading branch information...
dnadales committed Mar 14, 2019
1 parent 8c74b10 commit 2551b82cebf3e8559cc00127b2f4ca8fef8c0e77
@@ -4,7 +4,31 @@
-- | Blockchain interface validation rules.
--
module Cardano.Chain.Update.Validation.Interface
( State(..)
( -- * Environment
Environment (..)
-- ** Lenses
, protocolMagic
, currentEpoch
, currentSlot
, delegationMap
-- * State
, State (..)
-- * Lenses
, prevEpoch
, adoptedProtocolVersion
, adoptedProtocolParams
, futureAdopts
, appVersions
, registeredProtocolUpdateProposals
, registeredSoftwareUpdateProposals
, confirmedProposals
, proposalVotes
, proposalsEndorsements
, proposalRegistrationSlot
-- *Error
, Error (..)
-- * Interface functions
, registerProposal
)
where

@@ -52,6 +76,7 @@ data State
= State
{ _prevEpoch :: !EpochIndex
-- ^ Previously seen epoch
, _adoptedProtocolVersion :: !ProtocolVersion
, _adoptedProtocolParams :: !ProtocolParameters
-- ^ Adopted protocol parameters
, _futureAdopts :: !TODO -- We should take this from Cardano.Chain.Update.Validation.Endorsement
@@ -89,16 +114,18 @@ registerProposal
-> m State
registerProposal env st proposal = do
let
pm = undefined
pv = undefined
pps = undefined
avs = undefined
dms = undefined
regSubSt = undefined
Registration.State rpus raus <-
pm = env ^. protocolMagic
pv = st ^. adoptedProtocolVersion
pps = st ^. adoptedProtocolParams
avs = st ^. appVersions
dms = env ^. delegationMap
rpus = st ^. registeredProtocolUpdateProposals
raus = st ^. registeredSoftwareUpdateProposals
regSubSt = Registration.State rpus raus
Registration.State rpus' raus' <-
(Registration.registerProposal pm pv pps avs dms regSubSt proposal)
`wrapError` Registration
pure $! st
& registeredProtocolUpdateProposals .~ rpus
& registeredSoftwareUpdateProposals .~ raus
& registeredProtocolUpdateProposals .~ rpus'
& registeredSoftwareUpdateProposals .~ raus'
& proposalRegistrationSlot %~ M.insert (recoverUpId proposal) (env ^. currentSlot)
@@ -38,7 +38,7 @@ data State = State
type ProtocolUpdateProposals = Map UpId (ProtocolVersion, ProtocolParameters)
type SoftwareUpdateProposals = Map UpId SoftwareVersion

type ApplicationVersions = Map ApplicationName (NumSoftwareVersion, SlotId)
type ApplicationVersions = Map ApplicationName (NumSoftwareVersion, FlatSlotId)

-- | Error captures the ways in which registration could fail
data Error

0 comments on commit 2551b82

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