From 983c1298aa3256d7eed6541094e2394a1529a621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enis=20Bayramo=C4=9Flu?= Date: Thu, 10 Aug 2023 22:56:17 +0200 Subject: [PATCH] Add fast-development version encoding/decoding --- lib/Chainweb/Api/BlockHeader.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Chainweb/Api/BlockHeader.hs b/lib/Chainweb/Api/BlockHeader.hs index 94498ae..eeb2e6a 100644 --- a/lib/Chainweb/Api/BlockHeader.hs +++ b/lib/Chainweb/Api/BlockHeader.hs @@ -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" @@ -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"