from eth_keys.backends import CoinCurveECCBackend from eth_keys.backends import NativeECCBackend from eth_utils import ( keccak, ) MSG = b'message' MSGHASH = keccak(MSG) backends = [ NativeECCBackend(), ] try: import coincurve backends.append(CoinCurveECCBackend()) except ImportError: if 'REQUIRE_COINCURVE' in os.environ: raise def backend_id_fn(backend): return type(backend).__name__ @pytest.fixture(params=backends, ids=backend_id_fn) def key_api(request): return KeyAPI(backend=request.param) def test_ecdsa_sign(key_api, key_fixture):
def coincurve_key_api(): return KeyAPI(backend=CoinCurveECCBackend())
def coincurve_backend(): return CoinCurveECCBackend()