Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chainweb.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ library
, Chainweb.CutDB.RestAPI.Server
, Chainweb.CutDB.Sync
, Chainweb.Difficulty
, Chainweb.ForkState
, Chainweb.Graph
, Chainweb.HostAddress
, Chainweb.Logger
Expand Down
4 changes: 2 additions & 2 deletions cwtools/ea/Ea/Genesis.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
Expand Down Expand Up @@ -66,7 +67,7 @@ module Ea.Genesis
import Control.Lens
import Control.Monad

import qualified Data.Text as T
import Data.Text qualified as T
import Data.Word

import Chainweb.Graph
Expand All @@ -77,7 +78,6 @@ import Chainweb.Version.RecapDevelopment
import Chainweb.Version.Mainnet
import Chainweb.Version.Testnet04


-- ---------------------------------------------------------------------- --
-- Genesis Tx Data

Expand Down
46 changes: 32 additions & 14 deletions src/Chainweb/BlockHeader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,12 @@ module Chainweb.BlockHeader
, I.decodeEpochStartTime
, I.epochStart

-- * FeatureFlags
, I.FeatureFlags
, I.mkFeatureFlags
, I.encodeFeatureFlags
, I.decodeFeatureFlags

-- * POW Target
, I.powTarget

-- * BlockHeader
, I.BlockHeader

-- ** Getters
, blockFlags
, blockCreationTime
Expand All @@ -61,6 +56,10 @@ module Chainweb.BlockHeader
, blockEpochStart
, blockNonce
, blockHash
, blockForkState
, blockForkVotes
, blockForkNumber

-- ** Utilities
, I._blockPow
, I.blockPow
Expand All @@ -78,13 +77,22 @@ module Chainweb.BlockHeader
, I.decodeBlockHeaderCheckedChainId
, I.blockHeaderShortDescription
, I.ObjectEncoded(..)
, I.ExtendedObjectEncoded(..)

, I.timeBetween
, I.getAdjacentHash
, I.computeBlockHash
, I.adjacentChainIds
, I.absBlockHeightDiff

-- ** Fork State
, I.isForkEpochStart
, I.forkEpochLength
, I.isForkCountBlock
, I.isForkVoteBlock
, I.newForkState
, I.genesisForkState

-- * IsBlockHeader
, I.IsBlockHeader(..)

Expand All @@ -107,18 +115,19 @@ module Chainweb.BlockHeader
)
where

import Chainweb.ChainId (ChainId)
import Chainweb.BlockWeight (BlockWeight)
import Chainweb.BlockHeight (BlockHeight)
import Chainweb.Version (ChainwebVersionCode)
import Chainweb.Payload (BlockPayloadHash)
import Chainweb.Difficulty (HashTarget)
import Chainweb.ForkState (ForkState, ForkVotes, ForkNumber)
import Chainweb.BlockCreationTime (BlockCreationTime)
import Chainweb.BlockHash (BlockHash, BlockHashRecord)
import Chainweb.BlockHeader.Internal qualified as I
import Chainweb.BlockCreationTime (BlockCreationTime)
import Chainweb.BlockHeight (BlockHeight)
import Chainweb.BlockWeight (BlockWeight)
import Chainweb.ChainId (ChainId)
import Chainweb.Difficulty (HashTarget)
import Chainweb.Payload (BlockPayloadHash)
import Chainweb.Version (ChainwebVersionCode)
import Control.Lens (Getter)

blockFlags :: Getter I.BlockHeader I.FeatureFlags
blockFlags :: Getter I.BlockHeader ForkState
blockFlags = I.blockFlags

blockCreationTime :: Getter I.BlockHeader BlockCreationTime
Expand Down Expand Up @@ -156,3 +165,12 @@ blockNonce = I.blockNonce

blockHash :: Getter I.BlockHeader BlockHash
blockHash = I.blockHash

blockForkState :: Getter I.BlockHeader ForkState
blockForkState = I.blockForkState

blockForkVotes :: Getter I.BlockHeader ForkVotes
blockForkVotes = I.blockForkVotes

blockForkNumber :: Getter I.BlockHeader ForkNumber
blockForkNumber = I.blockForkNumber
Loading
Loading