Skip to content

Commit

Permalink
chore: can unstake method
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoreira-valory committed Aug 13, 2024
1 parent f78a343 commit 11b8dac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions operate/services/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,21 @@ def staking_status(self, service_id: int, staking_contract: str) -> StakingState
staking_contract=staking_contract,
)

def can_unstake(self, service_id: int, staking_contract: str) -> bool:
"""Can unstake the service?"""
try:
StakingManager(
key=self.wallet.key_path,
password=self.wallet.password,
chain_type=self.chain_type,
).check_if_unstaking_possible(
service_id=service_id,
staking_contract=staking_contract,
)
return True
except ValueError:
return False

def get_swap_data(self, service_id: int, multisig: str, owner_key: str) -> t.Dict:
"""Swap safe owner."""
# TODO: Discuss implementation
Expand Down

0 comments on commit 11b8dac

Please sign in to comment.