Skip to content

Commit

Permalink
remove unnecessary if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls committed Jan 28, 2024
1 parent 6178656 commit 84114f3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ export function waitForReceipt<abi extends Abi>({
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
}
Expand Down

0 comments on commit 84114f3

Please sign in to comment.