Skip to content

Commit

Permalink
Merge pull request #317 from input-output-hk/newhoggy/use-caseShelley…
Browse files Browse the repository at this point in the history
…ToBabbageOrConwayEraOnwards-from-cardano-api

Use `caseShelleyToBabbageOrConwayEraOnwards` from `cardano-api`
  • Loading branch information
newhoggy authored Sep 29, 2023
2 parents 000ba9c + a9e6363 commit 5e7a7bf
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions cardano-cli/src/Cardano/CLI/EraBased/Run/StakeAddress.hs
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,6 @@ runStakeAddressStakeDelegationCertificateCmd sbe stakeVerifier poolVKeyOrHashOrF
$ writeLazyByteStringFile outFp
$ textEnvelopeToJSON (Just @TextEnvelopeDescr "Stake Address Delegation Certificate") certificate

-- TODO use the version in cardano-api
caseShelleyToBabbageAndConwayEraOnwards :: forall a era. ()
=> (ShelleyToBabbageEra era -> a)
-> (ConwayEraOnwards era -> a)
-> ShelleyBasedEra era
-> a
caseShelleyToBabbageAndConwayEraOnwards l r = \case
ShelleyBasedEraShelley -> l ShelleyToBabbageEraShelley
ShelleyBasedEraAllegra -> l ShelleyToBabbageEraAllegra
ShelleyBasedEraMary -> l ShelleyToBabbageEraMary
ShelleyBasedEraAlonzo -> l ShelleyToBabbageEraAlonzo
ShelleyBasedEraBabbage -> l ShelleyToBabbageEraBabbage
ShelleyBasedEraConway -> r ConwayEraOnwardsConway

runStakeAddressStakeAndVoteDelegationCertificateCmd :: ()
=> ConwayEraOnwards era
-> StakeIdentifier
Expand Down Expand Up @@ -276,7 +262,7 @@ createStakeDelegationCertificate :: forall era. ()
-> ShelleyBasedEra era
-> Certificate era
createStakeDelegationCertificate stakeCredential (StakePoolKeyHash poolStakeVKeyHash) = do
caseShelleyToBabbageAndConwayEraOnwards
caseShelleyToBabbageOrConwayEraOnwards
(\w ->
shelleyToBabbageEraConstraints w
$ ShelleyRelatedCertificate w
Expand Down

0 comments on commit 5e7a7bf

Please sign in to comment.