-
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
[program-test] adding method warp_to_epoch #34620
Conversation
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.
Thanks, this looks useful. One formatting nit.
@joncinque , can you take a look and see if you have any concerns?
program-test/src/lib.rs
Outdated
@@ -65,6 +65,7 @@ use { | |||
tokio::task::JoinHandle, | |||
}; | |||
// Export types so test clients can limit their solana crate dependencies | |||
use solana_sdk::clock::Epoch; |
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.
Please add this to the common use statement above (L33)
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.
Fixed. Hopefully in the way you suggested.
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.
Fixed. Hopefully in the way you suggested.
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.
Looks great to me! Thanks for the contribution, R+ with the nit addressed
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #34620 +/- ##
=======================================
Coverage 81.8% 81.8%
=======================================
Files 824 824
Lines 222260 222264 +4
=======================================
+ Hits 181885 181951 +66
+ Misses 40375 40313 -62 |
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.
Looks great, thanks!
Problem
The program test contains only method to warping to a particular slot. It would be nice to have a way to easily warp per epoch. The method https://github.com/solana-labs/solana/blob/v1.17.7/ledger-tool/src/main.rs#L3447 provides the calculation of the number of slots per epoch.
It could be then mapped to e.g.,
bankrun
to profit from kevinheavey/solana-bankrun#13Summary of Changes
New method
warp_to_epoch
for the tests.