Skip to content

Commit

Permalink
Byron: Force startTime in genesis data to be strict
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketd committed Aug 27, 2024
1 parent 8d7d261 commit 41bbd6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions eras/byron/ledger/impl/cardano-ledger-byron.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ library
contra-tracer,
cryptonite,
Cabal-syntax,
deepseq,
digest,
directory,
filepath,
Expand Down
4 changes: 3 additions & 1 deletion eras/byron/ledger/impl/src/Cardano/Chain/Genesis/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Cardano.Crypto (
)
import Cardano.Ledger.Binary
import Cardano.Prelude
import Control.DeepSeq ((<$!!>))
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
import Data.List (lookup)
Expand All @@ -48,6 +49,7 @@ import Text.JSON.Canonical (
parseCanonicalJSON,
renderCanonicalJSON,
)
import Prelude (id)

-- | Genesis data contains all data which determines consensus rules. It must be
-- same for all nodes. It's used to initialize global state, slotting, etc.
Expand Down Expand Up @@ -93,7 +95,7 @@ instance MonadError SchemaError m => FromJSON m GenesisData where
GenesisData
<$> fromJSField obj "bootStakeholders"
<*> fromJSField obj "heavyDelegation"
<*> fromJSField obj "startTime"
<*> (id <$!!> fromJSField obj "startTime")
<*> fromJSField obj "nonAvvmBalances"
<*> fromJSField obj "blockVersionData"
-- The above is called blockVersionData for backwards compatibility with
Expand Down

0 comments on commit 41bbd6e

Please sign in to comment.