Skip to content

Commit

Permalink
Adjust the version encoder for fast-development rename
Browse files Browse the repository at this point in the history
  • Loading branch information
enobayram committed Mar 26, 2024
1 parent 33022a1 commit 75ec400
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Chainweb/Api/BlockHeader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ encodeChainId = putWord32le . fromIntegral . unChainId
{-# INLINE encodeChainId #-}

encodeChainwebVersion :: Putter Text
encodeChainwebVersion "development" = putWord32le 0x01
encodeChainwebVersion "fast-development" = putWord32le 0x02
encodeChainwebVersion "recap-development" = putWord32le 0x01
encodeChainwebVersion "development" = putWord32le 0x02
encodeChainwebVersion "mainnet01" = putWord32le 0x05
encodeChainwebVersion "testnet04" = putWord32le 0x07
encodeChainwebVersion v = error $ "chainweb version " <> unpack v <> " does not exist"
Expand Down Expand Up @@ -192,8 +192,8 @@ decodeAdjacents = label "Adjacents" $ do

decodeChainwebVersion :: Get Text
decodeChainwebVersion = label "ChainwebVersion" $ getWord32le >>= \case
0x01 -> return "development"
0x02 -> return "fast-development"
0x01 -> return "recap-development"
0x02 -> return "development"
0x05 -> return "mainnet01"
0x07 -> return "testnet04"
x -> fail $ "chainweb version " <> show x <> " does not exist"
Expand Down

0 comments on commit 75ec400

Please sign in to comment.