Skip to content
Permalink
Browse files

Add an update proposal interface module, and the interface state data…

…type.
  • Loading branch information...
dnadales committed Mar 13, 2019
1 parent a88428b commit 51336585a883f471f95746adc41338ed797d6087
Showing with 48 additions and 0 deletions.
  1. +1 −0 cardano-chain.cabal
  2. +47 −0 src/Cardano/Chain/Update/Validation/Interface.hs
@@ -105,6 +105,7 @@ library
Cardano.Chain.Update.SoftwareVersion
Cardano.Chain.Update.SystemTag
Cardano.Chain.Update.Undo
Cardano.Chain.Update.Validation.Interface
Cardano.Chain.Update.Validation.Registration
Cardano.Chain.Update.Validation.Voting
Cardano.Chain.Update.Vote
@@ -0,0 +1,47 @@

-- | Blockchain interface validation rules.
--
module Cardano.Chain.Update.Validation.Interface
(State (..))
where

import Cardano.Prelude (Map, Set)

import Cardano.Chain.Slotting (EpochIndex, FlatSlotId)
import Cardano.Chain.Common.StakeholderId (StakeholderId)

import Cardano.Chain.Update.ApplicationName (ApplicationName)
import Cardano.Chain.Update.ProtocolParameters (ProtocolParameters)
import Cardano.Chain.Update.ProtocolVersion (ProtocolVersion)
import Cardano.Chain.Update.SoftwareVersion
( NumSoftwareVersion
, SoftwareVersion
)
import Cardano.Chain.Update.Vote (UpId)

-- | Update interface state.
data TODO
data State
= State
{ prevEpoch :: !EpochIndex
-- ^ Previously seen epoch
, adoptedProtocolParams :: !ProtocolParameters
-- ^ Adopted protocol parameters
, futureAdopts :: !TODO -- We should take this from Cardano.Chain.Update.Validation.Endorsement
-- ^ Future protocol version adoptions
, appVersions :: !(Map ApplicationName (NumSoftwareVersion, FlatSlotId))
-- ^ Current application versions (by application name)
, registeredProtocolUpdateProposals :: !(Map UpId (ProtocolVersion, ProtocolParameters))
-- ^ Registered protocol update proposals
, registeredSoftwareUpdateProposals :: !(Map UpId SoftwareVersion)
-- ^ Registered software update proposals
, confirmedProposals :: !(Map UpId FlatSlotId)
-- ^ Confirmed update proposals
, proposalVotes :: !(Map UpId (Set StakeholderId))
-- ^ Update proposals votes
, proposalsEndorsements :: TODO -- We should take this from Cardano.Chain.Update.Validation.Endorsement
-- So this should be a @Set Endorsement@
-- ^ Update proposals endorsements
, proposalRegistrationSlot :: Map UpId FlatSlotId
-- ^ Slot at which an update proposal was registered
}

0 comments on commit 5133658

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