Detect and throw Trezor signing errors
commit61924602e3b39d47924f25d6cec13ba5b39ad151
authorFang <git@fang.io>
dateThu 22 Aug 2019, 23:11 (7 years ago)
parent5ca110d
src/lib/trezor.js+4
@@ -21,6 +21,10 @@ const trezorSignTransaction = async (txn, hdpath) => {
2121 transaction: trezorFormattedTxn,
2222 });
2323
24+ if (!sig.success) {
25+ throw new Error(sig.payload.error);
26+ }
27+
2428 const payload = sig.payload;
2529
2630 txn.v = Buffer.from(payload.v.slice(2), 'hex');