mirror of https://github.com/nucypher/nucypher.git
Small fixes for web3==5.0.0a8
parent
fbb04559f5
commit
2fbda80d38
|
@ -72,14 +72,14 @@ class Vladimir(Ursula):
|
||||||
@classmethod
|
@classmethod
|
||||||
def attach_transacting_key(cls, blockchain):
|
def attach_transacting_key(cls, blockchain):
|
||||||
"""
|
"""
|
||||||
Upload Vladimir's ETH keys to the keychain via web3 / RPC.
|
Upload Vladimir's ETH keys to the keychain via web3.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
password = INSECURE_DEVELOPMENT_PASSWORD
|
password = INSECURE_DEVELOPMENT_PASSWORD
|
||||||
blockchain.interface.w3.personal.importRawKey(private_key=cls.fraud_key, passphrase=password)
|
blockchain.interface.w3.provider.ethereum_tester.add_account(cls.fraud_key, password=password)
|
||||||
except (ValidationError, ):
|
except (ValidationError, ):
|
||||||
# check if Vlad's key is already on the keyring...
|
# check if Vlad's key is already on the keyring...
|
||||||
if cls.fraud_address in blockchain.interface.w3.personal.listAccounts:
|
if cls.fraud_address in blockchain.interface.w3.eth.accounts:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -141,7 +141,7 @@ class BlockchainPower(CryptoPowerUp):
|
||||||
"""
|
"""
|
||||||
Deletes the blockchain power and locks the account.
|
Deletes the blockchain power and locks the account.
|
||||||
"""
|
"""
|
||||||
self.blockchain.interface.w3.personal.lockAccount(self.account)
|
# self.blockchain.interface.w3.personal.lockAccount(self.account) # TODO: Implement client support
|
||||||
|
|
||||||
|
|
||||||
class KeyPairBasedPower(CryptoPowerUp):
|
class KeyPairBasedPower(CryptoPowerUp):
|
||||||
|
|
|
@ -193,7 +193,7 @@ def make_rest_app(
|
||||||
# TODO: Include data about caller?
|
# TODO: Include data about caller?
|
||||||
# TODO: Account for possibility that stamp, rather than interface, was bad.
|
# TODO: Account for possibility that stamp, rather than interface, was bad.
|
||||||
# TODO: Maybe also record the bytes representation separately to disk?
|
# TODO: Maybe also record the bytes representation separately to disk?
|
||||||
message = "Suspicious Activity: Discovered node with bad signature: {}. Announced via REST."
|
message = f"Suspicious Activity: Discovered node with bad signature: {node}. Announced via REST."
|
||||||
log.warn(message)
|
log.warn(message)
|
||||||
suspicious_activity_tracker['vladimirs'].append(node)
|
suspicious_activity_tracker['vladimirs'].append(node)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue