@@ -129,13 +129,19 @@ const sendSignedTransaction = (web3, stx, doubtNonceError) => {
129129 });
130130};
131131
132−// returns a Promise<bool>, where the bool indicates tx success/failure
132+// returns a Promise<void>, throwing on tx failure
133133const waitForTransactionConfirm = (web3, txHash) => {
134134 return retry(async (bail, n) => {
135135 const receipt = await web3.eth.getTransactionReceipt(txHash);
136136 const confirmed = receipt !== null;
137− if (confirmed) return receipt.status === true;
138− else throw new Error('retrying');
137+ if (!confirmed) {
138+ throw new Error('Transaction not confirmed.');
139+ }
140+
141+ const success = receipt.status === true;
142+ if (!success) {
143+ return bail(new Error('Transaction failed.'));
144+ }
139145 }, RETRY_OPTIONS);
140146};
141147