Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: chessai <[email protected]>
Co-authored-by: Edmund Noble <[email protected]>
  • Loading branch information
3 people committed Jan 3, 2025
1 parent b0b99c4 commit b93a15b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Chainweb/MinerReward.hs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ newtype Kda = Kda_ Decimal
deriving stock (Show, Eq, Ord, Generic)

-- | Smart constructor for KDA. It is an error if the Decimal has more than
-- twelf decimal digits.
-- twelve decimal digits.
--
pattern Kda :: HasCallStack => Decimal -> Kda
pattern Kda { _kda } <- Kda_ _kda where
Expand Down Expand Up @@ -209,12 +209,12 @@ mkMinerRewards =
$ "cannot construct miner rewards table: " <> sshow e
Right vs ->
let rewards = M.fromList . V.toList . V.map formatRow $ vs
in if (minerRewardsHash rewards == expectedMinerRewardsHash)
in if minerRewardsHash rewards == expectedMinerRewardsHash
then rewards
else error $ "hash of miner rewards table does not match expected hash"
where
formatRow :: (Word64, CsvDecimal) -> (BlockHeight, Stu)
formatRow (!a,!b) = (BlockHeight $ int a, kdaToStu (Kda $ _csvDecimal b))
formatRow (a, b) = (BlockHeight $ int a, kdaToStu (Kda $ _csvDecimal b))

-- -------------------------------------------------------------------------- --
-- Miner Rewards File
Expand Down

0 comments on commit b93a15b

Please sign in to comment.