Skip to content

Commit

Permalink
fix: actually fix ts
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Aug 1, 2024
1 parent c29c8b5 commit 1d069de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ape_test/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ def restore(self, snapshot_id: SnapshotID):
raise UnknownSnapshotError(snapshot_id)

def set_timestamp(self, new_timestamp: int):
current_timestamp = self.tester.ethereum_tester.get_block_by_number("pending")["timestamp"]
if new_timestamp == current_timestamp:
# no change, return immediately
return

try:
self.tester.ethereum_tester.time_travel(new_timestamp)
except ValidationError as err:
Expand Down

0 comments on commit 1d069de

Please sign in to comment.