@@ -55,11 +55,11 @@ export async function verifyTransaction<TNumber extends bigint | number>(
5555 } ;
5656
5757 if ( ! _ . isUndefined ( verification . disableNetworking ) && ! _ . isBoolean ( verification . disableNetworking ) ) {
58- throwTxMismatch ( 'verification.disableNetworking must be a boolean' ) ;
58+ throw new TypeError ( 'verification.disableNetworking must be a boolean' ) ;
5959 }
6060 const isPsbt = txPrebuild . txHex && utxolib . bitgo . isPsbt ( txPrebuild . txHex ) ;
6161 if ( isPsbt && txPrebuild . txInfo ?. unspents ) {
62- throwTxMismatch ( 'should not have unspents in txInfo for psbt' ) ;
62+ throw new Error ( 'should not have unspents in txInfo for psbt' ) ;
6363 }
6464 const disableNetworking = ! ! verification . disableNetworking ;
6565 const parsedTransaction : ParsedTransaction < TNumber > = await coin . parseTransaction < TNumber > ( {
@@ -97,7 +97,7 @@ export async function verifyTransaction<TNumber extends bigint | number>(
9797 const isBackupKeySignatureValid = verify ( keychains . backup , keySignatures . backupPub ) ;
9898 const isBitgoKeySignatureValid = verify ( keychains . bitgo , keySignatures . bitgoPub ) ;
9999 if ( ! isBackupKeySignatureValid || ! isBitgoKeySignatureValid ) {
100- throwTxMismatch ( 'secondary public key signatures invalid' ) ;
100+ throw new Error ( 'secondary public key signatures invalid' ) ;
101101 }
102102 debug ( 'successfully verified backup and bitgo key signatures' ) ;
103103 } else if ( ! disableNetworking ) {
@@ -108,11 +108,11 @@ export async function verifyTransaction<TNumber extends bigint | number>(
108108
109109 if ( parsedTransaction . needsCustomChangeKeySignatureVerification ) {
110110 if ( ! keychains . user || ! userPublicKeyVerified ) {
111- throwTxMismatch ( 'transaction requires verification of user public key, but it was unable to be verified' ) ;
111+ throw new Error ( 'transaction requires verification of user public key, but it was unable to be verified' ) ;
112112 }
113113 const customChangeKeySignaturesVerified = verifyCustomChangeKeySignatures ( parsedTransaction , keychains . user ) ;
114114 if ( ! customChangeKeySignaturesVerified ) {
115- throwTxMismatch (
115+ throw new Error (
116116 'transaction requires verification of custom change key signatures, but they were unable to be verified'
117117 ) ;
118118 }
@@ -168,7 +168,7 @@ export async function verifyTransaction<TNumber extends bigint | number>(
168168
169169 const allOutputs = parsedTransaction . outputs ;
170170 if ( ! txPrebuild . txHex ) {
171- throw new TxIntentMismatchError ( `txPrebuild.txHex not set` , reqId , [ txParams ] , undefined ) ;
171+ throw new Error ( `txPrebuild.txHex not set` ) ;
172172 }
173173 const inputs = isPsbt
174174 ? getPsbtTxInputs ( txPrebuild . txHex , coin . network ) . map ( ( v ) => ( {
@@ -185,7 +185,7 @@ export async function verifyTransaction<TNumber extends bigint | number>(
185185 const fee = inputAmount - outputAmount ;
186186
187187 if ( fee < 0 ) {
188- throwTxMismatch (
188+ throw new Error (
189189 `attempting to spend ${ outputAmount } satoshis, which exceeds the input amount (${ inputAmount } satoshis) by ${ - fee } `
190190 ) ;
191191 }
0 commit comments