Fix crash on unknown account sign

This commit is contained in:
nolash
2020-12-25 09:21:09 +01:00
parent ba5bc5f985
commit 5810ce25a3
6 changed files with 20 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ import sha3
from .interface import Keystore
from crypto_dev_signer.common import strip_hex_prefix
from . import keyapi
from crypto_dev_signer.error import UnknownAccountError
logging.basicConfig(level=logging.DEBUG)
logg = logging.getLogger(__file__)
@@ -59,7 +60,10 @@ class ReferenceKeystore(Keystore):
'a': safe_address,
},
)
k = r.first()[0]
try:
k = r.first()[0]
except TypeError:
raise UnknownAccountError(address)
return self._decrypt(k, password)