on master help sign in
Detect and throw Trezor signing errors
6192460Fang
src/lib/trezor.js+4
@@ -21,6 +21,10 @@ const trezorSignTransaction = async (txn, hdpath) => {
21 transaction: trezorFormattedTxn,
21 transaction: trezorFormattedTxn,
22 });
22 });
23
23
24+ if (!sig.success) {
25+ throw new Error(sig.payload.error);
26+ }
27+
24 const payload = sig.payload;
28 const payload = sig.payload;
25
29
26 txn.v = Buffer.from(payload.v.slice(2), 'hex');
30 txn.v = Buffer.from(payload.v.slice(2), 'hex');