Skip to content

Commit

Permalink
Merge pull request #94 from skalenetwork/enhancement/SKALE-3538-updat…
Browse files Browse the repository at this point in the history
…e-to-skale-manager-with-new-bounty-procedure

Enhancement/skale 3538 Update to skale manager with a new getBounty procedure
  • Loading branch information
alexgex authored Nov 13, 2020
2 parents d4bbc91 + e1795c6 commit d978282
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
DB_ROOT_PASSWORD: ${{ secrets.DB_ROOT_PASSWORD }}
DB_PORT: ${{ secrets.DB_PORT }}

MANAGER_TAG: "1.5.2-develop.16"
MANAGER_TAG: "1.5.2-develop.20"
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
Expand Down
8 changes: 4 additions & 4 deletions bounty_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def job(self) -> None:
last_block_number = self.skale.web3.eth.blockNumber
block_data = call_retry.call(self.skale.web3.eth.getBlock, last_block_number)
block_timestamp = datetime.utcfromtimestamp(block_data['timestamp'])
self.logger.info(f'Current reward time: {reward_date}')
self.logger.info(f'Block timestamp now: {block_timestamp}')
self.logger.info(f'Next reward date: {reward_date}')
self.logger.info(f'Block timestamp: {block_timestamp}')
if reward_date > block_timestamp:
self.logger.info('Current block timestamp is less than reward time. Will try in 1 min')
raise NotTimeForBountyException(Exception)
Expand All @@ -130,7 +130,7 @@ def job_listener(self, event):
else:
self.logger.debug('The job finished successfully)')
reward_date = self.get_reward_date()
self.logger.debug(f'Reward date after job: {reward_date}')
self.logger.info(f'Next reward date after job: {reward_date}')
utc_now = datetime.utcnow()
if utc_now > reward_date:
self.logger.debug('Changing reward time by current time')
Expand All @@ -141,7 +141,7 @@ def job_listener(self, event):
def run(self) -> None:
"""Starts agent."""
reward_date = self.get_reward_date()
self.logger.debug(f'Reward date on agent\'s start: {reward_date}')
self.logger.info(f'Next reward date on agent\'s start: {reward_date}')
utc_now = datetime.utcnow()
if utc_now > reward_date:
reward_date = utc_now
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
skale.py==4.1.dev11
skale.py==4.1.dev17
schedule==0.6.0
tenacity==6.2.0
apscheduler==3.6.3
Expand Down

0 comments on commit d978282

Please sign in to comment.