-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
fix: remove async for createProgramAddress and findProgramAddress (#2… #23185
Conversation
Codecov Report
@@ Coverage Diff @@
## master #23185 +/- ##
===========================================
- Coverage 81.3% 69.7% -11.6%
===========================================
Files 567 36 -531
Lines 154480 2217 -152263
Branches 0 314 +314
===========================================
- Hits 125608 1546 -124062
+ Misses 28872 559 -28313
- Partials 0 112 +112 |
Was the sha256 library changed to be sync at some point? That used to be what forced this family of methods to be async. You can't break the API like this. Please add a sync variant instead. |
Thanks for the feedback, I forgot it will break people using promises. Updated to allow for a sync version. I've also updated the tests to ensure backwards compatibility |
How breaking is this though? Code can await a non |
it would be breaking if the developer has wrote their code as such
I dont like the async versions but yes it would cause some issues. Probably be good make it completely sync in a major upgrade. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
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.
This looks good to me pending one tiny nit, and would be a useful addition. @t-nelson do you have any issues with this?
@@ -143,10 +143,10 @@ export class PublicKey extends Struct { | |||
* Derive a program address from seeds and a program ID. | |||
*/ | |||
/* eslint-disable require-await */ |
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.
nit: Probably don't need this comment, right? Makes me wonder if this needed to be async for some reason
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.
@t-nelson do you have any issues with this?
Nope! I'm happy once you're happy
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
solana-labs#23185) * fix: remove async for createProgramAddress and findProgramAddress (solana-labs#23184) make sync * test: add test to ensure backwards compatibility
Fixes #23184