コード例 #1
0
ファイル: test_backends.py プロジェクト: rehive/aion-keys
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):
コード例 #2
0
def coincurve_key_api():
    return KeyAPI(backend=CoinCurveECCBackend())
コード例 #3
0
def coincurve_backend():
    return CoinCurveECCBackend()