1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, asn1tools
5, coincurve
6, eth-hash
7, eth-typing
8, eth-utils
9, factory-boy
10, hypothesis
11, isPyPy
12, pyasn1
13, pytestCheckHook
14, pythonOlder
15}:
16
17buildPythonPackage rec {
18 pname = "eth-keys";
19 version = "0.4.0";
20 disabled = pythonOlder "3.6";
21
22 src = fetchFromGitHub {
23 owner = "ethereum";
24 repo = "eth-keys";
25 rev = "v${version}";
26 hash = "sha256-jG/jJPM4t3z6UQIdc8L6y0DxZiGx5pVuGL8XwbIt60o=";
27 };
28
29 propagatedBuildInputs = [
30 eth-typing
31 eth-utils
32 ];
33
34 nativeCheckInputs = [
35 asn1tools
36 factory-boy
37 hypothesis
38 pyasn1
39 pytestCheckHook
40 ] ++ passthru.optional-dependencies.coincurve
41 ++ lib.optional (!isPyPy) eth-hash.optional-dependencies.pysha3
42 ++ lib.optional isPyPy eth-hash.optional-dependencies.pycryptodome;
43
44 disabledTests = [
45 # tests are broken
46 "test_compress_decompress_inversion"
47 "test_public_key_generation_is_equal"
48 "test_signing_is_equal"
49 "test_native_to_coincurve_recover"
50 "test_public_key_compression_is_equal"
51 "test_public_key_decompression_is_equal"
52 "test_signatures_with_high_s"
53 # timing sensitive
54 "test_encode_decode_pairings"
55 ];
56
57 pythonImportsCheck = [ "eth_keys" ];
58
59 passthru.optional-dependencies = {
60 coincurve = [ coincurve ];
61 };
62
63 meta = with lib; {
64 description = "Common API for Ethereum key operations";
65 homepage = "https://github.com/ethereum/eth-keys";
66 license = licenses.mit;
67 maintainers = with maintainers; [ ];
68 };
69}