Skip to content

Commit

Permalink
Merge pull request #683 from IntersectMBO/smelc/jordan-s-break-follow…
Browse files Browse the repository at this point in the history
…-ups

Follow-ups of merged PRs
  • Loading branch information
smelc authored Mar 29, 2024
2 parents a38d570 + 17065d8 commit f94b0ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 6 additions & 9 deletions cardano-cli/src/Cardano/CLI/Types/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ module Cardano.CLI.Types.Common
, ParserFileDirection (..)
, IdOutputFormat (..)
, PrivKeyFile(..)
, ProposalBinary(..)
, ProposalBinary
, ProposalFile
, ProposalText(..)
, ProposalText
, ProposalUrl(..)
, ProtocolParamsFile(..)
, QueryOutputFormat(..)
Expand Down Expand Up @@ -92,7 +92,6 @@ import qualified Cardano.Chain.Slotting as Byron

import Data.Aeson (FromJSON (..), ToJSON (..), object, pairs, (.=))
import qualified Data.Aeson as Aeson
import qualified Data.ByteString as BS
import Data.String (IsString)
import Data.Text (Text)
import qualified Data.Text as Text
Expand Down Expand Up @@ -124,13 +123,11 @@ newtype ProposalUrl = ProposalUrl
{ unProposalUrl :: L.Url
} deriving (Eq, Show)

newtype ProposalBinary = ProposalBinary
{ unProposalBinary :: BS.ByteString
} deriving (Eq, Show)
-- | Tag for tracking proposals submitted as 'Bytestring'
data ProposalBinary

newtype ProposalText = ProposalText
{ unProposalText :: Text
} deriving (Eq, Show)
-- | Tag for tracking proposals submitted as 'Text.Text'
data ProposalText

newtype VoteUrl = VoteUrl
{ unVoteUrl :: L.Url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,16 @@ hprop_golden_create_testnet_data_deleg_non_deleg =
(L.sgMaxLovelaceSupply genesis) H.=== (fromIntegral totalSupply)

let initialFunds = ListMap.toList $ L.sgInitialFunds genesis

-- This checks that there is actually only one funded address
(length initialFunds) H.=== 1

let L.Coin onlyHolderCoin = snd $ initialFunds !! 0

-- The check below may seem weird, but we cannot do a very precise check
-- on balances, because of the treasury "stealing" some of the money.
-- Nevertheless, this check catches a confusion between delegated and
-- non-delegated coins, by virtue of --delegated-supply being a fourth
-- of --total-supply above.
-- https://github.com/IntersectMBO/cardano-cli/issues/631
-- of --total-supply above. This confusion actually happened in the past, as
-- https://github.com/IntersectMBO/cardano-cli/issues/631 witnesses.

H.assertWith (fromIntegral onlyHolderCoin) (\ohc -> ohc > totalSupply `div` 2)

0 comments on commit f94b0ac

Please sign in to comment.