Add __del__ to BlockchainPower

pull/327/head
tuxxy 2018-06-23 16:03:02 -06:00
parent 91314b4524
commit c2408eddce
1 changed files with 7 additions and 1 deletions

View File

@ -93,9 +93,15 @@ class BlockchainPower(CryptoPowerUp):
if not self.is_unlocked:
raise PowerUpError("Account is not unlocked.")
signature = Eth.sign(self.account, data=message)
signature = self.blockchain.interface.call_backend_sign(self.account, message)
return signature
def __del__(self):
"""
Deletes the blockchain power and locks the account.
"""
self.blockchain.interface.w3.personal.lockAccount(self.account)
class KeyPairBasedPower(CryptoPowerUp):
confers_public_key = True