-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
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": |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
Had to merge this to test on CLI |