Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent false blockheight exceedence errors when transaction confirmations are aborted #3353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

steveluscher
Copy link
Collaborator

Summary

I noticed that my application was getting blockheight exceedence errors when there definitely was not one. Turns out the reason was because my application was aborting the confirmation, which would cause all of this code to fall through to the BLOCKHEIGHT_EXCEEDENCE exception.

This PR introduces a throw of the abort after every await. After this change, this existing text becomes consequential:

it('throws when the block height exceedence promise throws', async () => {
expect.assertions(1);
getNonceInvalidationPromise.mockRejectedValue(new Error('o no'));
const commitmentPromise = waitForDurableNonceTransactionConfirmation({
abortSignal: new AbortController().signal,
commitment: 'finalized',
getNonceInvalidationPromise,
getRecentSignatureConfirmationPromise,
transaction: MOCK_DURABLE_NONCE_TRANSACTION,
});
await expect(commitmentPromise).rejects.toThrow('o no');
});

Copy link

changeset-bot bot commented Oct 7, 2024

🦋 Changeset detected

Latest commit: a1be6f7

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@steveluscher steveluscher changed the base branch from 10-07-remove_spurious_abort_calls_from_the_blockheight_exceedence_tests to graphite-base/3353 October 8, 2024 00:20
@steveluscher steveluscher force-pushed the 10-07-prevent_false_blockheight_exceedence_errors_when_transaction_confirmations_are_aborted branch from 3eaae5a to 9029373 Compare October 8, 2024 00:20
@steveluscher steveluscher changed the base branch from graphite-base/3353 to master October 8, 2024 00:21
@steveluscher steveluscher force-pushed the 10-07-prevent_false_blockheight_exceedence_errors_when_transaction_confirmations_are_aborted branch from 9029373 to 34a3d14 Compare October 8, 2024 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants