Skip to content

Commit

Permalink
Add fast-development version encoding/decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
enobayram committed Aug 10, 2023
1 parent ef2bee3 commit 983c129
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Chainweb/Api/BlockHeader.hs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ encodeChainId = putWord32le . fromIntegral . unChainId

encodeChainwebVersion :: Putter Text
encodeChainwebVersion "development" = putWord32le 0x01
encodeChainwebVersion "fast-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,6 +193,7 @@ decodeAdjacents = label "Adjacents" $ do
decodeChainwebVersion :: Get Text
decodeChainwebVersion = label "ChainwebVersion" $ getWord32le >>= \case
0x01 -> return "development"
0x02 -> return "fast-development"
0x05 -> return "mainnet01"
0x07 -> return "testnet04"
x -> fail $ "chainweb version " <> show x <> " does not exist"
Expand Down

0 comments on commit 983c129

Please sign in to comment.