From 84114f399359727db95edece8793a360f560f3fb Mon Sep 17 00:00:00 2001 From: Jonas Daniels Date: Sun, 28 Jan 2024 04:58:56 -0800 Subject: [PATCH] remove unnecessary if statement --- .../src/transaction/actions/wait-for-tx-receipt.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/thirdweb/src/transaction/actions/wait-for-tx-receipt.ts b/packages/thirdweb/src/transaction/actions/wait-for-tx-receipt.ts index 9fef1179070..f4f0b6f41b8 100644 --- a/packages/thirdweb/src/transaction/actions/wait-for-tx-receipt.ts +++ b/packages/thirdweb/src/transaction/actions/wait-for-tx-receipt.ts @@ -51,10 +51,11 @@ export function waitForReceipt({ const receipt = eth_getTransactionReceipt(request, { hash: transactionHash as Hex, }); - if (receipt) { - unwatch(); - return resolve(receipt); - } + + // stop the polling + unwatch(); + // resolve the top level promise with the receipt + resolve(receipt); } catch { // noop, we'll try again on the next blocks }