Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extended payment keys to be specified as a Plutus required signer. #3319

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions cardano-cli/src/Cardano/CLI/Shelley/Run/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import Ouroboros.Consensus.Shelley.Eras (StandardAllegra, StandardMary
import qualified Cardano.Binary as CBOR

--TODO: following import needed for orphan Eq Script instance
import Cardano.Ledger.ShelleyMA.TxBody ()
import Cardano.Ledger.Shelley.Scripts ()
import Cardano.Ledger.ShelleyMA.TxBody ()

import Cardano.CLI.Environment (EnvSocketError, readEnvSocketPath, renderEnvSocketError)
import Cardano.CLI.Run.Friendly (friendlyTxBodyBS)
Expand Down Expand Up @@ -712,12 +712,16 @@ validateRequiredSigners era reqSigs =
$ mapM readWitnessSigningData reqSigs
let (_sksByron, sksShelley) = partitionSomeWitnesses $ map categoriseSomeWitness keyWits
shelleySigningKeys = map toShelleySigningKey sksShelley
paymentKeyHashes = map (verificationKeyHash . getVerificationKey) $ mapMaybe excludeExtendedKeys shelleySigningKeys
paymentKeyHashes = map getHash shelleySigningKeys
return $ TxExtraKeyWitnesses supported paymentKeyHashes
where
excludeExtendedKeys :: ShelleySigningKey -> Maybe (SigningKey PaymentKey)
excludeExtendedKeys (ShelleyExtendedSigningKey _) = Nothing
excludeExtendedKeys (ShelleyNormalSigningKey sk) = Just $ PaymentSigningKey sk
getHash :: ShelleySigningKey -> Hash PaymentKey
getHash (ShelleyExtendedSigningKey sk) =
let extSKey = PaymentExtendedSigningKey sk
payVKey = castVerificationKey $ getVerificationKey extSKey
in verificationKeyHash payVKey
getHash (ShelleyNormalSigningKey sk) =
verificationKeyHash . getVerificationKey $ PaymentSigningKey sk

validateTxWithdrawals
:: forall era.
Expand Down