added verbosity for missing wallet keystores

This commit is contained in:
Alexander 2024-07-23 19:39:41 -04:00
parent 127097a1a4
commit 371a4547e2

View file

@ -554,7 +554,7 @@ def load_contract_abi(address):
def load_wallet(address, secret): def load_wallet(address, secret):
file_path = "./data/wallets/{}/keystore".format(address) file_path = "./data/wallets/{}/keystore".format(address)
if not os.path.exists(file_path): if not os.path.exists(file_path):
raise FileNotFoundError raise FileNotFoundError("Can't find your wallet keystore for address: {}".format(address))
keystore = "\n".join([line.strip() for line in open(file_path, 'r+')]) keystore = "\n".join([line.strip() for line in open(file_path, 'r+')])
private_key = web3.eth.account.decrypt(keystore, secret) private_key = web3.eth.account.decrypt(keystore, secret)
return web3.eth.account.from_key(private_key) return web3.eth.account.from_key(private_key)