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

Optimise tx confirmation further #157

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

Yolley
Copy link
Collaborator

@Yolley Yolley commented Apr 2, 2024

  • solana: trigger one last status check manually in case blockheight has expired on tx confirmation

}
// exhaust enums to ensure full coverage
case "processed":
case "recent":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what behavior do you expect here? Just a fallthrough to the final return?
For me personally, this code style is harder to read, I'd suggest to be more specific here and put the return statement inside the switch

nit: btw, // exhaust enums to ensure full coverage
to achieve this you could use

    default: {
      const defaultValue: never = connection.commitment;
      return whatever;
    }

The gotcha here is never type, so if any meaningful value falls through to the default case, TS will catch it.

const confirmationStrategy: BlockheightBasedTransactionConfirmationStrategy = {
lastValidBlockHeight: hash.lastValidBlockHeight + 50,
signature: bs58.encode(signedTx.signature),
signature,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is anything from this article useful/applicable?
https://twitter.com/jordaaash/status/1774892864847368230

@LukaStreamflow
Copy link
Contributor

Had to merge this to test on CLI

@LukaStreamflow LukaStreamflow merged commit d8f882d into master Apr 2, 2024
2 checks passed
Copy link

github-actions bot commented Apr 2, 2024

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