Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed May 7, 2020
1 parent ab4b5c5 commit 73b5ea3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cardano-api/src/Cardano/Api.hs
Expand Up @@ -271,7 +271,7 @@ buildShelleyTransaction
-> [Certificate]
-> TxUnsigned
buildShelleyTransaction txins txouts ttl fee certs = do
let relevantCerts = catMaybes [ certDiscrim c | c <- certs ]
let relevantCerts = [ certDiscrim c | c <- certs ]
TxUnsignedShelley $
Shelley.TxBody
(Set.fromList (map toShelleyTxIn txins))
Expand All @@ -283,9 +283,9 @@ buildShelleyTransaction txins txouts ttl fee certs = do
Shelley.SNothing -- update proposals
Shelley.SNothing -- metadata hash
where
certDiscrim :: Certificate -> Maybe ShelleyCertificate
certDiscrim (ShelleyDelegationCertificate delegCert) = Just delegCert
certDiscrim (ShelleyStakePoolCertificate sPoolCert) = Just sPoolCert
certDiscrim :: Certificate -> ShelleyCertificate
certDiscrim (ShelleyDelegationCertificate delegCert) = delegCert
certDiscrim (ShelleyStakePoolCertificate sPoolCert) = sPoolCert

{-
inputs outputs, attributes:
Expand Down Expand Up @@ -325,7 +325,7 @@ witnessTransaction txu nw signKey =
TxWitShelley $ shelleyWitnessTransaction tx signKey

byronWitnessTransaction :: Crypto.Hash Byron.Tx -> Network -> SigningKey -> ByronWitness
byronWitnessTransaction _ _ (SigningKeyShelley _) = panic "Cardano.Api.byronWitnessTransaction: Please provide a shelley signing key."
byronWitnessTransaction _ _ (SigningKeyShelley _) = panic "Cardano.Api.byronWitnessTransaction: Please provide a byron signing key."
byronWitnessTransaction txHash nw (SigningKeyByron signKey) =
Byron.VKWitness
(Crypto.toVerification signKey)
Expand All @@ -339,7 +339,7 @@ byronWitnessTransaction txHash nw (SigningKeyByron signKey) =
Testnet pm -> pm

shelleyWitnessTransaction :: ShelleyTxBody -> SigningKey -> ShelleyWitnessVKey
shelleyWitnessTransaction _ (SigningKeyByron _) = panic "Cardano.Api.shelleyWitnessTransaction: Please provide a byron signing key."
shelleyWitnessTransaction _ (SigningKeyByron _) = panic "Cardano.Api.shelleyWitnessTransaction: Please provide a shelley signing key."
shelleyWitnessTransaction txbody (SigningKeyShelley sk) =
Shelley.WitVKey vk sig
where
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
Expand Up @@ -322,7 +322,7 @@ pTransaction =
<*> pTxTTL
<*> pTxFee
<*> pTxBodyFile Output
<*> some pCertificate
<*> many pCertificate

pTransactionSign :: Parser TransactionCmd
pTransactionSign = TxSign <$> pTxBodyFile Input
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs
Expand Up @@ -42,4 +42,4 @@ runTxBuildRaw txins txouts ttl amount (TxBodyFile fpath) certFps = do
-- a custom error type and an error rendering function.
readShelleyCert :: CertificateFile -> ExceptT CliError IO Certificate
readShelleyCert (CertificateFile fp) =
firstExceptT ShelleyCertReadError . newExceptT $ readCertificate fp
firstExceptT ShelleyCertReadError . newExceptT $ readCertificate fp

0 comments on commit 73b5ea3

Please sign in to comment.