Skip to content

Commit b8d6644

Browse files
committed
Propagate HasCallStack through tx signing chain
Add HasCallStack constraints to callers of makeShelleySignature so that stack traces show the full signing call chain: makeShelleyKeyWitness, makeShelleyKeyWitness', makeShelleyBootstrapWitness, makeShelleyBasedBootstrapWitness, makeKeyWitness, issueOperationalCertificate.
1 parent 38b39c8 commit b8d6644

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

cardano-api/src/Cardano/Api/Certificate/Internal/OperationalCertificate.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Cardano.Protocol.Crypto (StandardCrypto)
3737
import Cardano.Protocol.TPraos.OCert qualified as Shelley
3838

3939
import Data.Word
40+
import GHC.Stack (HasCallStack)
4041

4142
-- ----------------------------------------------------------------------------
4243
-- Operational certificates
@@ -107,7 +108,8 @@ instance Error OperationalCertIssueError where
107108
-- TODO: include key ids
108109

109110
issueOperationalCertificate
110-
:: VerificationKey KesKey
111+
:: HasCallStack
112+
=> VerificationKey KesKey
111113
-> Either
112114
AnyStakePoolSigningKey
113115
(SigningKey GenesisDelegateExtendedKey)

cardano-api/src/Cardano/Api/Experimental/Tx.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ hashTxBody
264264
hashTxBody = L.extractHash . L.hashAnnotated
265265

266266
makeKeyWitness
267-
:: Era era
267+
:: HasCallStack
268+
=> Era era
268269
-> UnsignedTx (LedgerEra era)
269270
-> ShelleyWitnessSigningKey
270271
-> L.WitVKey L.Witness

cardano-api/src/Cardano/Api/Tx/Internal/Sign.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,7 @@ data WitnessNetworkIdOrByronAddress
10881088
makeShelleyBootstrapWitness
10891089
:: forall era
10901090
. ()
1091+
=> HasCallStack
10911092
=> ShelleyBasedEra era
10921093
-> WitnessNetworkIdOrByronAddress
10931094
-> TxBody era
@@ -1100,6 +1101,7 @@ makeShelleyBootstrapWitness sbe nwOrAddr txBody sk =
11001101
makeShelleyBasedBootstrapWitness
11011102
:: forall era
11021103
. ()
1104+
=> HasCallStack
11031105
=> ShelleyBasedEra era
11041106
-> WitnessNetworkIdOrByronAddress
11051107
-> Ledger.TxBody Ledger.TopTx (ShelleyLedgerEra era)
@@ -1183,6 +1185,7 @@ makeShelleyBasedBootstrapWitness sbe nwOrAddr txbody (ByronSigningKey sk) =
11831185
makeShelleyKeyWitness
11841186
:: forall era
11851187
. ()
1188+
=> HasCallStack
11861189
=> ShelleyBasedEra era
11871190
-> TxBody era
11881191
-> ShelleyWitnessSigningKey
@@ -1193,6 +1196,7 @@ makeShelleyKeyWitness sbe (ShelleyTxBody _ txBody _ _ _ _) =
11931196
makeShelleyKeyWitness'
11941197
:: forall era
11951198
. ()
1199+
=> HasCallStack
11961200
=> ShelleyBasedEra era
11971201
-> L.TxBody L.TopTx (ShelleyLedgerEra era)
11981202
-> ShelleyWitnessSigningKey

0 commit comments

Comments
 (0)