Skip to content

Commit

Permalink
Merge pull request #32 from valory-xyz/fix/ledger_timestamp
Browse files Browse the repository at this point in the history
fixed local timestamp issue
  • Loading branch information
OjusWiZard authored Feb 4, 2025
2 parents afd2d30 + 3a5a1a1 commit d86915c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/predict_trader/migrate_legacy_quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ def migrate_to_master_safe(operate: OperateApp, trader_data: TraderData, service
ledger_api=staking_manager.ledger_api,
contract_address=staking_contract,
).get("data")
staked_duration = time() - ts_start

current_block = staking_manager.ledger_api.api.eth.get_block("latest")
current_timestamp = current_block.timestamp
staked_duration = current_timestamp - ts_start

if staked_duration < minimum_staking_duration:
print(
f"Cannot unstake service {chain_config.chain_data.token}."
Expand Down

0 comments on commit d86915c

Please sign in to comment.