Skip to content

Commit 6eabacf

Browse files
authored
Merge pull request #340 from lidofinance/feat/fix-negative-rebase-test
feat: time synced with the chain
2 parents c21d336 + 1c32fb7 commit 6eabacf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/acceptance/test_accounting_oracle_negative.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
NON_ZERO_HASH = ZERO_HASH[:-1] + b"\x01"
2323
FIELDS_WIDTH = ExtraDataLengths
2424

25+
def chain_time_with_offset(offset: int) -> int:
26+
return chain.time() + offset
2527

2628
def test_sender_not_allowed(accounting_oracle: Contract, oracle_version: int, stranger: Account) -> None:
2729
report = oracle_report(dry_run=True)
@@ -80,12 +82,12 @@ def test_submitConsensusReport(accounting_oracle: Contract, hash_consensus: Cont
8082
{"from": hash_consensus},
8183
)
8284

83-
8485
with reverts(encode_error("HashCannotBeZero()")):
8586
accounting_oracle.submitConsensusReport(
8687
ZERO_HASH,
8788
last_processing_ref_slot + 1,
88-
chain.time(),
89+
# Add a few seconds of offset to account for slow block mining.
90+
chain_time_with_offset(3),
8991
{"from": hash_consensus},
9092
)
9193

0 commit comments

Comments
 (0)