Skip to content

Commit

Permalink
Merge pull request #338 from input-output-hk/newhoggy/add-support-for…
Browse files Browse the repository at this point in the history
…-committee-hot-key-witnesses

Add support for committee hot key witnesses
  • Loading branch information
Jimbo4350 authored Oct 5, 2023
2 parents 474d1eb + 4df9418 commit 3d47a18
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2023-08-08T19:56:09Z
, cardano-haskell-packages 2023-10-03T23:50:17Z
, cardano-haskell-packages 2023-10-05T20:00:00Z

packages:
cardano-cli
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/cardano-cli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ library
, binary
, bytestring
, canonical-json
, cardano-api ^>= 8.25
, cardano-api ^>= 8.25.2.0
, cardano-binary
, cardano-crypto
, cardano-crypto-class ^>= 2.1.2
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Json/Friendly.hs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ friendlyCertificates sbe = \case
TxCertificates _ cs _ -> array $ map (friendlyCertificate sbe) cs

friendlyCertificate :: ShelleyBasedEra era -> Certificate era -> Aeson.Value
friendlyCertificate sbe = withShelleyBasedEraConstraintsForLedger sbe $
friendlyCertificate sbe = shelleyBasedEraConstraints sbe $
object . (: []) . renderCertificate sbe

renderCertificate :: ShelleyBasedEra era -> Certificate era -> (Aeson.Key, Aeson.Value)
Expand Down
9 changes: 6 additions & 3 deletions cardano-cli/src/Cardano/CLI/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ data SomeSigningWitness
| AGenesisDelegateExtendedSigningWitness (SigningKey GenesisDelegateExtendedKey)
| AGenesisUTxOSigningWitness (SigningKey GenesisUTxOKey)
| ADRepSigningWitness (SigningKey DRepKey)
| ACommitteeSigningWitness (SigningKey CommitteeColdKey)
| ACommitteeColdSigningWitness (SigningKey CommitteeColdKey)
| ACommitteeHotSigningWitness (SigningKey CommitteeHotKey)
deriving Show


Expand Down Expand Up @@ -655,7 +656,8 @@ categoriseSomeSigningWitness swsk =
AGenesisDelegateExtendedSigningWitness sk -> AShelleyKeyWitness (WitnessGenesisDelegateExtendedKey sk)
AGenesisUTxOSigningWitness sk -> AShelleyKeyWitness (WitnessGenesisUTxOKey sk)
ADRepSigningWitness sk -> AShelleyKeyWitness (WitnessPaymentKey $ castDrep sk)
ACommitteeSigningWitness sk -> AShelleyKeyWitness (WitnessCommitteeColdKey sk)
ACommitteeColdSigningWitness sk -> AShelleyKeyWitness (WitnessCommitteeColdKey sk)
ACommitteeHotSigningWitness sk -> AShelleyKeyWitness (WitnessCommitteeHotKey sk)

-- TODO: Conway era - Add constrctor for SigningKey DrepKey to ShelleyWitnessSigningKey
castDrep :: SigningKey DRepKey -> SigningKey PaymentKey
Expand Down Expand Up @@ -708,7 +710,8 @@ readWitnessSigningData (KeyWitnessSigningData skFile mbByronAddr) = do
, FromSomeType (AsSigningKey AsGenesisDelegateExtendedKey ) AGenesisDelegateExtendedSigningWitness
, FromSomeType (AsSigningKey AsGenesisUTxOKey ) AGenesisUTxOSigningWitness
, FromSomeType (AsSigningKey AsDRepKey ) ADRepSigningWitness
, FromSomeType (AsSigningKey AsCommitteeColdKey ) ACommitteeSigningWitness
, FromSomeType (AsSigningKey AsCommitteeColdKey ) ACommitteeColdSigningWitness
, FromSomeType (AsSigningKey AsCommitteeHotKey ) ACommitteeHotSigningWitness
]

bech32FileTypes =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ hprop_golden_shelleyTransactionSign = propertyOnce $ H.moduleWorkspace "tmp" $ \
utxoSigningKeyFile <- noteInputFile "test/cardano-cli-golden/files/input/shelley/transaction-sign/utxo.skey"
stakeSigningKeyFile <- noteInputFile "test/cardano-cli-golden/files/input/shelley/transaction-sign/stake.skey"
nodeColdSigningKeyFile <- noteInputFile "test/cardano-cli-golden/files/input/shelley/transaction-sign/node-cold.skey"
ccHotSigningKeyFile <- noteInputFile "test/cardano-cli-golden/files/input/governance/cc-hot.skey"
signedTransactionFile <- noteTempFile tempDir "signed.tx"
transactionPoolRegSignedFile <- noteTempFile tempDir "tx-pool-reg.signed"

Expand Down Expand Up @@ -64,3 +65,14 @@ hprop_golden_shelleyTransactionSign = propertyOnce $ H.moduleWorkspace "tmp" $ \

H.assertFileOccurences 1 "Tx MaryEra" transactionPoolRegSignedFile
H.assertEndsWithSingleNewline transactionPoolRegSignedFile

void $ execCardanoCLI
[ "transaction","sign"
, "--mainnet"
, "--tx-body-file", txBodyFile
, "--signing-key-file", ccHotSigningKeyFile
, "--tx-file", transactionPoolRegSignedFile
]

H.assertFileOccurences 1 "Tx MaryEra" transactionPoolRegSignedFile
H.assertEndsWithSingleNewline transactionPoolRegSignedFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "ConstitutionalCommitteeColdSigningKey_ed25519",
"description": "Constitutional Committee Cold Signing Key",
"cborHex": "5820ef19a7c87cf4979232da72647fe91f633facd4d1fa817712d6d978ddd68cde33"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "ConstitutionalCommitteeColdVerificationKey_ed25519",
"description": "Constitutional Committee Cold Verification Key",
"cborHex": "582017c7526f7cd307a361f959b6ab2e7fa339852c9a08309b968023a0df9b84c47a"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "ConstitutionalCommitteeHotSigningKey_ed25519",
"description": "Constitutional Committee Hot Signing Key",
"cborHex": "5820d2039207db7cff9dad95b0f98bfe2aea192e9d159e7c0e9a1f31bd2dc8cd4b47"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "ConstitutionalCommitteeHotVerificationKey_ed25519",
"description": "Constitutional Committee Hot Verification Key",
"cborHex": "58202b35e914764560fcf7655523d303d8cf27fc8306b6e86891802feedcfa087715"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "CertificateShelley",
"description": "Constitutional Committee Hot Key Registration Certificate",
"cborHex": "830e8200581c9c0682d5a71b1496ccbe4a79c332fcbc7cb317ec3b8faf6d45723e408200581cbb0fe4aca8548f6fd2050e5bd1b419d12bac166f3719b4959f323908"
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d47a18

Please sign in to comment.