Skip to content

Commit

Permalink
⬆️ 1.2.11
Browse files Browse the repository at this point in the history
- Fixes a bug in `get_time_since_last_published`
  • Loading branch information
EvolveArt committed Mar 13, 2024
1 parent 46c14eb commit 5955a04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pragma/core/mixins/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,16 @@ async def update_oracle(

async def get_time_since_last_published(self, pair_id, publisher) -> int:
all_entries = await self.get_spot_entries(pair_id)
if len(all_entries) == 0:
return 1000000000 # arbitrary large number

entries = [
entry
for entry in all_entries
if entry.base.publisher == str_to_felt(publisher)
]

if len(entries) == 0:
return 1000000000 # arbitrary large number

max_timestamp = max([entry.base.timestamp for entry in entries])

diff = int(time.time()) - max_timestamp
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pragma-sdk"
version = "1.2.10"
version = "1.2.11"
authors = ["0xevolve <[email protected]>"]
description = "Core package for rollup-native Pragma Oracle"
readme = "README.md"
Expand Down

0 comments on commit 5955a04

Please sign in to comment.