Test integration for geth client signing and nucypher.crypto verification

pull/1040/head
Kieran R. Prasch 2019-05-31 08:43:55 -07:00 committed by Kieran Prasch
parent e913677354
commit f9d9346c0f
No known key found for this signature in database
GPG Key ID: 199AB839D4125A62
2 changed files with 6 additions and 4 deletions

View File

@ -349,6 +349,7 @@ class NuCypherGethDevProcess(NuCypherGethProcess):
def start(self, timeout: int = 30, extra_delay: int = 1):
self.log.info("STARTING GETH DEV NOW")
BaseGethProcess.start(self) # <--- START GETH
self.wait_for_ipc(timeout=timeout)
time.sleep(extra_delay)

View File

@ -4,6 +4,7 @@ from nucypher.blockchain.eth.chains import Blockchain
from nucypher.blockchain.eth.clients import (
GethClient, ParityClient, GanacheClient, NuCypherGethDevProcess, PUBLIC_CHAINS)
from nucypher.blockchain.eth.interfaces import BlockchainInterface
from nucypher.crypto.api import verify_eip_191
class MockGethProvider:
@ -106,7 +107,7 @@ def test_ganache_web3_client():
assert interface.is_local
def test_EIP_191_client_signatures():
def test_geth_EIP_191_client_signature_integration():
# Start a geth process
geth = NuCypherGethDevProcess()
@ -116,7 +117,7 @@ def test_EIP_191_client_signatures():
etherbase = blockchain.interface.accounts[0]
stamp = b'STAMP-' + os.urandom(64)
signature = blockchain.interface.client.sign_message(account=etherbase, message=stamp)
is_valid = blockchain.interface.client.verify_signature(address=etherbase,
signature=signature,
message=stamp)
is_valid = verify_eip_191(address=etherbase,
signature=signature,
message=stamp)
assert is_valid