-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ExitSignatureUpdateCache * Move OraclesCache to AppState * Move OraclesCache to app_state.py
- Loading branch information
1 parent
939ab7d
commit f4a9013
Showing
7 changed files
with
135 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from dataclasses import dataclass | ||
|
||
from eth_typing import BlockNumber | ||
|
||
from src.common.typings import Singleton | ||
|
||
|
||
@dataclass | ||
class OraclesCache: | ||
checkpoint_block: BlockNumber | ||
config: dict | ||
validators_threshold: int | ||
rewards_threshold: int | ||
|
||
|
||
@dataclass | ||
class ExitSignatureUpdateCache: | ||
checkpoint_block: BlockNumber | None = None | ||
last_event_block: BlockNumber | None = None | ||
|
||
|
||
# pylint: disable-next=too-few-public-methods | ||
class AppState(metaclass=Singleton): | ||
def __init__(self): | ||
self.exit_signature_update_cache = ExitSignatureUpdateCache() | ||
self.oracles_cache: OraclesCache | None = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters