2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, pytest
|
|
|
|
, pysha3
|
2021-04-26 19:14:03 +00:00
|
|
|
, pycryptodome
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "eth-hash";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.3.2";
|
2022-06-16 17:23:12 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ethereum";
|
|
|
|
repo = "eth-hash";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-LMDtFUrsPYgj/Fl9aBW1todlj1D3LlFxAkzNFAzCGLQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
] ++ passthru.optional-dependencies.pycryptodome
|
|
|
|
++ passthru.optional-dependencies.pysha3;
|
2021-04-26 19:14:03 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
|
|
|
pytest tests/backends/pycryptodome/
|
|
|
|
pytest tests/backends/pysha3/
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
pycryptodome = [ pycryptodome ];
|
|
|
|
pysha3 = [ pysha3 ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The Ethereum hashing function keccak256";
|
|
|
|
homepage = "https://github.com/ethereum/eth-hash";
|
2022-06-16 17:23:12 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|