Skip to content
Permalink
Browse files

Fix golden tests.

  • Loading branch information...
dnadales committed Mar 13, 2019
1 parent 9d80227 commit 358269a33832197e14c617ee71c642dc35977f68
Showing with 14 additions and 2 deletions.
  1. +1 −0 cardano-chain.cabal
  2. +4 −2 src/Cardano/Chain/Common/BlockCount.hs
  3. +9 −0 src/Cardano/Chain/Common/BlockCount/JSON.hs
@@ -51,6 +51,7 @@ library
Cardano.Chain.Common.AddressHash
Cardano.Chain.Common.Attributes
Cardano.Chain.Common.BlockCount
Cardano.Chain.Common.BlockCount.JSON
Cardano.Chain.Common.ChainDifficulty
Cardano.Chain.Common.Lovelace
Cardano.Chain.Common.LovelacePortion
@@ -9,11 +9,13 @@ where

import Cardano.Prelude

import Data.Aeson.TH (defaultOptions, deriveJSON)
import Data.Aeson.TH (defaultOptions, deriveJSON, fieldLabelModifier)
import Formatting.Buildable (Buildable)

import Cardano.Binary.Class (Bi(..))

import Cardano.Chain.Common.BlockCount.JSON (unToGet)

newtype BlockCount = BlockCount
{ unBlockCount :: Word64
} deriving ( Eq
@@ -34,4 +36,4 @@ instance Bi BlockCount where
decode = BlockCount <$> decode
encodedSizeExpr size pxy = size (unBlockCount <$> pxy)

deriveJSON defaultOptions ''BlockCount
deriveJSON (defaultOptions { fieldLabelModifier = unToGet }) ''BlockCount
@@ -0,0 +1,9 @@
{-# LANGUAGE OverloadedStrings #-}

module Cardano.Chain.Common.BlockCount.JSON (unToGet) where

import Cardano.Prelude

unToGet :: [Char] -> [Char]
unToGet "unBlockCount" = "getBlockCount"
unToGet x = x

0 comments on commit 358269a

Please sign in to comment.
You can’t perform that action at this time.