Skip to content

Commit

Permalink
Apply review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ffakenz committed Dec 20, 2023
1 parent c00ca7e commit 03d136b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions hydra-cluster/src/CardanoNode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ module CardanoNode where

import Hydra.Prelude

import Control.Lens (ix, (^?), (^?!))
import Control.Lens ((^?), (^?!))
import Control.Tracer (Tracer, traceWith)
import Data.Aeson ((.=))
import Data.Aeson qualified as Aeson
import Data.Aeson.KeyMap qualified as Aeson.KeyMap
import Data.Aeson.Lens (key, _Number, _Object)
import Data.Aeson.Lens (key, _Number)
import Data.Fixed (Centi)
import Data.Time.Clock.POSIX (posixSecondsToUTCTime, utcTimeToPOSIXSeconds)
import Hydra.Cardano.Api (AsType (AsPaymentKey), File (..), NetworkId, PaymentKey, SigningKey, SocketPath, VerificationKey, generateSigningKey, getVerificationKey)
Expand Down Expand Up @@ -372,7 +372,7 @@ refreshSystemStart stateDirectory args = do
config <-
unsafeDecodeJsonFile (stateDirectory </> nodeConfigFile args)
<&> addField "ByronGenesisFile" (nodeByronGenesisFile args)
. addField "ShelleyGenesisFile" (nodeShelleyGenesisFile args)
. addField "ShelleyGenesisFile" (nodeShelleyGenesisFile args)

Aeson.encodeFile
(stateDirectory </> nodeByronGenesisFile args)
Expand Down Expand Up @@ -425,7 +425,7 @@ addField :: ToJSON a => Aeson.Key -> a -> Aeson.Value -> Aeson.Value
addField k v = withObject (Aeson.KeyMap.insert k (toJSON v))

getField :: ToJSON a => Aeson.Key -> a -> Aeson.Value
getField k v = fromMaybe Aeson.Null $ toJSON v ^? (_Object . ix k)
getField k v = fromMaybe Aeson.Null $ toJSON v ^? key k . _Value

-- | Do something with an a JSON object. Fails if the given JSON value isn't an
-- object.
Expand Down
2 changes: 1 addition & 1 deletion hydra-node/src/Hydra/Chain/CardanoClient.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ instance Eq QueryException where
instance Exception QueryException where
displayException = \case
QueryAcquireException failure -> show failure
QueryEraMismatchException _ -> "Connected to cardano-node in not supported era. Please upgrade your hydra-node."
QueryEraMismatchException _ -> "Connected to cardano-node in unsupported era. Please upgrade your hydra-node."
QueryProtocolParamsConversionException err -> show err

-- * CardanoClient handle
Expand Down
2 changes: 1 addition & 1 deletion hydra-node/src/Hydra/Chain/Direct.hs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ data ChainClientException

instance Exception ChainClientException where
displayException = \case
EraNotSupportedException -> "Received blocks in not supported era. Please upgrade your hydra-node."
EraNotSupportedException -> "Received blocks in unsupported era. Please upgrade your hydra-node."

-- | The block type used in the node-to-client protocols.
type BlockType = BlockInMode CardanoMode
Expand Down

0 comments on commit 03d136b

Please sign in to comment.