nucypher/tests/blockchain/eth/clients/test_geth_integration.py

28 lines
815 B
Python
Raw Normal View History

import os
import pytest
2019-06-18 05:38:01 +00:00
from nucypher.blockchain.eth.interfaces import BlockchainInterface
from nucypher.crypto.api import verify_eip_191
#
# NOTE: This module is skipped on CI
#
def test_geth_EIP_191_client_signature_integration(geth_dev_node):
if 'CIRCLECI' in os.environ:
pytest.skip("Do not run Geth nodes in CI")
# Start a geth process
2019-06-18 05:38:01 +00:00
blockchain = BlockchainInterface(provider_process=geth_dev_node, sync_now=False)
# Sign a message (RPC) and verify it.
etherbase = blockchain.accounts[0]
stamp = b'STAMP-' + os.urandom(64)
signature = blockchain.client.sign_message(account=etherbase, message=stamp)
is_valid = verify_eip_191(address=etherbase,
signature=signature,
message=stamp)
assert is_valid