Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TOSQUASH: take the HList suggestions
Browse files Browse the repository at this point in the history
nfrisby committed Aug 9, 2023

Verified

This commit was signed with the committer’s verified signature.
fazibear Michał Kalbarczyk
1 parent e79ccc1 commit ce768a4
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cardano-api/gen/Test/Gen/Cardano/Api/Typed.hs
Original file line number Diff line number Diff line change
@@ -1127,7 +1127,7 @@ genTxVotes :: CardanoEra era -> Gen (TxVotes era)
genTxVotes era = fromMaybe (pure TxVotesNone) $ do
w <- featureInEra Nothing Just era
let votes = Gen.list (Range.constant 0 10) $ genVote w
pure $ (TxVotes w . Map.fromList) <$> votes
pure $ TxVotes w . Map.fromList <$> votes
where
genVote
:: ConwayEraOnwards era
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ import Cardano.Ledger.SafeHash
import Data.ByteString (ByteString)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.Maybe (fromMaybe)
import qualified Data.Set as Set

-- | A representation of whether the era supports tx governance actions.
@@ -111,7 +112,7 @@ toGovernanceAction _ (ProposeNewCommittee oldCommitteeMembers newCommitteeMember
Gov.Committee
{ Gov.committeeMembers = Map.mapKeys toCommitteeMember newCommitteeMembers
, Gov.committeeQuorum =
maybe (error "impossible!") id
fromMaybe (error "impossible!")
$ boundRational @UnitInterval quor
}
toGovernanceAction _ InfoAct = Gov.InfoAction
@@ -209,13 +210,13 @@ fromProposalProcedure
-> Proposal era
-> (Lovelace, (Network, StakeCredential), GovernanceAction, (Url, ByteString))
fromProposalProcedure sbe (Proposal pp) =
shelleyBasedEraConstraints sbe $
( fromShelleyLovelace $ Gov.pProcDeposit pp
, (L.getRwdNetwork $ Gov.pProcReturnAddr pp, fromShelleyStakeCredential $ L.getRwdCred $ Gov.pProcReturnAddr pp)
, fromGovernanceAction sbe (Gov.pProcGovernanceAction pp)
, let anchor = Gov.pProcAnchor pp
in (Gov.anchorUrl anchor, Crypto.hashToBytes $ extractHash $ Gov.anchorDataHash anchor)
)
shelleyBasedEraConstraints sbe
( fromShelleyLovelace $ Gov.pProcDeposit pp
, (L.getRwdNetwork $ Gov.pProcReturnAddr pp, fromShelleyStakeCredential $ L.getRwdCred $ Gov.pProcReturnAddr pp)
, fromGovernanceAction sbe (Gov.pProcGovernanceAction pp)
, let anchor = Gov.pProcAnchor pp
in (Gov.anchorUrl anchor, Crypto.hashToBytes $ extractHash $ Gov.anchorDataHash anchor)
)

-- ----------------------------------------------------------------------------
-- TODO conversions that likely need to live elsewhere and may even deserve

0 comments on commit ce768a4

Please sign in to comment.