Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4422 from golemfactory/mwu/no-genesis
Browse files Browse the repository at this point in the history
Use last confirmed block instead of genesis with new eth account
  • Loading branch information
maaktweluit authored Jul 4, 2019
2 parents 69da3ce + 81cd523 commit 17ad819
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion golem/ethereum/transactionsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ def _subscribe_to_events(self) -> None:
self._sci: SmartContractsInterface
values = model.GenericKeyValue.select().where(
model.GenericKeyValue.key == self.BLOCK_NUMBER_DB_KEY)
from_block = int(values.get().value) if values.count() == 1 else 0
from_block = int(values.get().value) if values.count() == 1 else \
self._sci.get_latest_confirmed_block_number()

ik = self._incomes_keeper
self._sci.subscribe_to_batch_transfers(
Expand Down
2 changes: 1 addition & 1 deletion tests/golem/ethereum/test_transactionsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_subscriptions(self):
self.sci.subscribe_to_batch_transfers.assert_called_once_with(
None,
self.sci.get_eth_address(),
0,
self.sci.get_latest_confirmed_block_number(),
ANY,
)

Expand Down

0 comments on commit 17ad819

Please # to comment.