@@ -172,14 +172,12 @@ const waitForTransactionConfirm = (web3, txHash) => {
172172 }, RETRY_OPTIONS);
173173};
174174
175−const sendAndAwaitAll = async (web3, stxs, doubtNonceError) => {
176− await Promise.all(
177− stxs.map(tx => {
178− return new Promise(async (resolve, reject) => {
179− const txHash = await sendSignedTransaction(web3, tx, doubtNonceError);
180− await waitForTransactionConfirm(web3, txHash);
181− resolve();
182− });
175+// returns a Promise that resolves when all stxs have been sent & confirmed
176+const sendAndAwaitAll = (web3, stxs, doubtNonceError) => {
177+ return Promise.all(
178+ stxs.map(async tx => {
179+ const txHash = await sendSignedTransaction(web3, tx, doubtNonceError);
180+ await waitForTransactionConfirm(web3, txHash);
183181 })
184182 );
185183};