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 8 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
8 changes: 4 additions & 4 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ package yet-another-logger
source-repository-package
type: git
location: https://github.com/kadena-io/pact.git
tag: d4f03045df6ba5178a76e534d619b6233ad1c659
--sha256: 1q4b3i606davn6iyk6az2q7cw5f7llxjhkbqyzw4bsxhrkah7fch
tag: 4208012e3f2fdf1721c24cdcb97de5f64fd5f58a
--sha256: 1al11csqr291avfwbb7hcrfxapz9sx0iclv3j5ipnli287h52cvs

source-repository-package
type: git
location: https://github.com/kadena-io/pact-5.git
tag: 6c81f4cf0631a4087f8350230bd9b7c3714f9751
--sha256: sha256-7SttW6Aexh+sQLdT1JZ4sZIhRXJ5G4q23aBvRh0sEK0=
tag: bfc5310c462aaefabe7c512407ac6dab87fc8c42
--sha256: 05xp1vwxkvjxrn8pij9z4g1hadbkb8hrgziwzs408yxxxmkcv6kq

source-repository-package
type: git
Expand Down
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
6 changes: 3 additions & 3 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 Data.Text
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 Expand Up @@ -108,7 +108,7 @@ chainIdRangeTag (ChainIdRange l u)
data Genesis = Genesis
{ _version :: ChainwebVersion
-- ^ chainweb version (e.g. Testnet04)
, _tag :: Text
, _tag :: T.Text
-- ^ Module name tag
, _txChainIds :: ChainIdRange
-- ^ chain id
Expand Down
45 changes: 31 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 @@ -85,6 +84,14 @@ module Chainweb.BlockHeader
, 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 +114,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 +164,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