-
Notifications
You must be signed in to change notification settings - Fork 1
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: bond escalation tests #67
Changes from 1 commit
8a6a8fa
60abd12
9bf093e
a91f86d
608e5c9
f28aa07
039896b
c04cc71
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 |
---|---|---|
|
@@ -71,6 +71,9 @@ contract Integration_EscalateDispute is IntegrationBase { | |
_disputeId = oracle.disputeResponse(mockRequest, mockResponse, mockDispute); | ||
vm.stopPrank(); | ||
|
||
// Simulate the time passing | ||
vm.roll(1 days); | ||
|
||
_disputeCreatedAt = oracle.disputeCreatedAt(_disputeId); | ||
} | ||
|
||
|
@@ -123,7 +126,7 @@ contract Integration_EscalateDispute is IntegrationBase { | |
vm.expectRevert(IBondEscalationModule.BondEscalationModule_BondEscalationOver.selector); | ||
_bondEscalationModule.pledgeForDispute(mockRequest, mockDispute); | ||
|
||
// Roll back the blocks because we need to simulate the custom error "break tie during tying buffer" and "bond escalation over" | ||
// Roll back the timestamp because we need to simulate the custom error "break tie during tying buffer" and "bond escalation over" | ||
vm.warp(block.timestamp - _tyingBuffer - 1); | ||
|
||
// Pledge second time for dispute | ||
|
@@ -306,7 +309,7 @@ contract Integration_EscalateDispute is IntegrationBase { | |
vm.expectRevert(IBondEscalationModule.BondEscalationModule_NotEscalatable.selector); | ||
oracle.escalateDispute(mockRequest, mockResponse, mockDispute); | ||
|
||
// Roll back the blocks because we need to simulate the custom error "not escalatable" | ||
// Roll back the timestamp because we need to simulate the custom error "not escalatable" | ||
vm.warp(block.timestamp - (_disputeCreatedAt + _blocksDeadline + 1)); | ||
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. instead you could rollback the timestamp doing 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. Its true, however as I know that this logic is more complex I decided to do like this in order to clarify that we are doing something "triky" and is not the natural flow |
||
|
||
// Pledge against dispute | ||
|
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.
Just noticed this one. It's confusing to use
vm.roll
with a time constant