Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
F4ever committed Jun 6, 2024
1 parent 20baf8d commit 9ebd3b2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/modules/accounting/accounting.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def process_extra_data(self, blockstamp: ReferenceBlockStamp):
def _submit_extra_data(self, blockstamp: ReferenceBlockStamp) -> None:
extra_data = self.get_extra_data(blockstamp)

if extra_data.format == FormatList.EXTRA_DATA_FORMAT_LIST_EMPTY:
if extra_data.format == FormatList.EXTRA_DATA_FORMAT_LIST_EMPTY.value:
tx = self.report_contract.submit_report_extra_data_empty()
self.w3.transaction.check_and_send_transaction(tx, variables.ACCOUNT)
else:
Expand Down
2 changes: 1 addition & 1 deletion src/modules/accounting/third_phase/extra_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def collect(
return ExtraData(
extra_data_list=extra_data_list,
data_hash=data_hash,
format=data_format,
format=data_format.value,
items_count=len(extra_data),
)

Expand Down
2 changes: 1 addition & 1 deletion src/modules/accounting/third_phase/extra_data_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def collect(
items_count=items_count,
extra_data_list=hashed_txs,
data_hash=first_hash,
format=extra_data_format,
format=extra_data_format.value,
)

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion src/modules/accounting/third_phase/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FormatList(Enum):
class ExtraData:
extra_data_list: list[bytes]
data_hash: bytes
format: FormatList
format: int
items_count: int


Expand Down
5 changes: 3 additions & 2 deletions src/modules/accounting/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ReportData:
withdrawal_finalization_batches: list[int]
finalization_share_rate: int
is_bunker: bool
extra_data_format: FormatList
extra_data_format: int
extra_data_hash: bytes
extra_data_items_count: int

Expand Down Expand Up @@ -76,7 +76,8 @@ class OracleReportLimits:

@classmethod
def from_response(cls, **kwargs) -> Self:
# churn_validators_per_day_limit was renamed in new version
# Compatability breaking rename
# churn_validators_per_day_limit -> exited_validators_per_day_limit
# Unpack structure by order
return cls(*kwargs.values()) # pylint: disable=no-value-for-parameter

Expand Down
2 changes: 1 addition & 1 deletion src/modules/submodules/oracle_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self, w3: Web3):
def run_as_daemon(self):
logger.info({'msg': 'Run module as daemon.'})
while True:
logger.info({'msg': 'Startup new cycle.'})
logger.debug({'msg': 'Startup new cycle.'})
self.cycle_handler()

@timeout(variables.MAX_CYCLE_LIFETIME_IN_SECONDS)
Expand Down

0 comments on commit 9ebd3b2

Please sign in to comment.