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
feat(sandbox): fast forward timestamp and epoch height #6211
Changes from all commits
f9aa23f
232e901
c9f9492
85eb896
b70475a
9b0d8ed
f5b1eb1
691a2dc
f35d1a5
31a9397
0a4631b
d7370d0
671350d
a001fd2
6cb23f0
f6b18e6
df6fa4e
1eec9d2
f8cc241
cc3872c
61e168a
15836ad
864a20d
f9a507c
17a4518
b7d6fb4
5d2de98
b66850d
8adb77f
0158ad1
3e4f833
79e1a25
427652f
eab87db
07775d7
6a1903d
39f429b
7bc2983
bf98f33
832a604
7c53fdc
d6f3261
e3634c6
625e036
d9e674c
3e6aa18
7e0761d
98d1d50
2a1ca7f
8170d09
66adcad
83203a0
0d90208
c1a31d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,12 +278,15 @@ pub enum NetworkSandboxMessage { | |
SandboxPatchState(Vec<near_primitives::state_record::StateRecord>), | ||
SandboxPatchStateStatus, | ||
SandboxFastForward(near_primitives::types::BlockHeightDelta), | ||
SandboxFastForwardStatus, | ||
} | ||
|
||
#[cfg(feature = "sandbox")] | ||
#[derive(Eq, PartialEq, Debug)] | ||
pub enum SandboxResponse { | ||
SandboxPatchStateFinished(bool), | ||
SandboxFastForwardFinished(bool), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not important, but a better name here would be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went with what was already there for patching state. It's only being used internally right now, so not too important to change IMO |
||
SandboxFastForwardFailed(String), | ||
} | ||
|
||
#[derive(actix::Message, AsStaticStr)] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,7 @@ fn create_block() -> Block { | |
&signer, | ||
CryptoHash::default(), | ||
CryptoHash::default(), | ||
None, | ||
) | ||
} | ||
|
||
|
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.
Heh, if only we did the work for virtualizing time, than we'd be able to express this in a much cleaner way, by just making the time go forward faster.
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.
yeah, this was definitely a hack to circumvent that. Maybe we can revisit this in the future, but for now, this was pretty simple to do just for contract testing side of things