Skip to content

Commit

Permalink
fix: use the correct param for the service id and check None
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantios committed Nov 15, 2023
1 parent 53974d6 commit 73ec3ac
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions packages/valory/skills/staking_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,21 @@ def _check_service_staked(self) -> WaitableConditionType:
"""Check whether the service is staked."""
if self.synchronized_data.period_count != 0:
self.is_service_staked = self.synchronized_data.is_service_staked
status = True
else:
status = yield from self._staking_contract_interact(
contract_callable="is_service_staked",
placeholder=get_name(CallCheckpointBehaviour.is_service_staked),
service_id=self.params.service_id,
return True

service_id = self.params.on_chain_service_id
if service_id is None:
self.context.logger.warning(
"Cannot perform any staking-related operations without a configured on-chain service id. "
"Setting status to 'not staked'."
)
return True

status = yield from self._staking_contract_interact(
contract_callable="is_service_staked",
placeholder=get_name(CallCheckpointBehaviour.is_service_staked),
service_id=service_id,
)

return status

Expand Down

0 comments on commit 73ec3ac

Please sign in to comment.