From adfa29609ee89ec4069de94927c1a08c905fc405 Mon Sep 17 00:00:00 2001 From: Kieran Prasch <kieranprasch@gmail.com> Date: Tue, 10 Apr 2018 17:03:21 -0700 Subject: [PATCH] Manually merges inter-codebase tests, setup, pipfile, config classes, and sol source, respectively updates imports. --- .gitignore | 4 + Pipfile | 1 + .../blockchain/{eth/nkms_eth => }/__init__.py | 0 nkms/blockchain/eth/.gitignore | 15 - nkms/blockchain/eth/Pipfile | 16 - nkms/blockchain/eth/Pipfile.lock | 623 ------------------ nkms/blockchain/eth/README.md | 15 +- nkms/blockchain/eth/{tests => }/__init__.py | 0 nkms/blockchain/eth/{nkms_eth => }/actors.py | 2 +- nkms/blockchain/eth/{nkms_eth => }/agents.py | 2 +- .../eth/{nkms_eth => }/blockchain.py | 2 +- .../eth/{nkms_eth/config.py => constants.py} | 35 - .../eth/{nkms_eth => }/deployers.py | 3 +- .../blockchain/eth/{nkms_eth => }/policies.py | 2 +- .../eth/scripts/estimate_gas_tester.py | 2 +- nkms/blockchain/eth/scripts/pip_setup.sh | 8 - nkms/blockchain/eth/scripts/ursula_flow.py | 2 +- .../contracts/Issuer.sol | 0 .../contracts/MinersEscrow.sol | 0 .../contracts/NuCypherKMSToken.sol | 0 .../contracts/PolicyManager.sol | 0 .../contracts/UserEscrow.sol | 0 .../contracts/lib/AdditionalMath.sol | 0 .../contracts/lib/LinkedList.sol | 0 .../contracts/proxy/Dispatcher.sol | 0 .../contracts/proxy/Government.sol | 0 .../contracts/proxy/README.MD | 0 .../contracts/proxy/UPDATE.MD | 0 .../contracts/proxy/Upgradeable.sol | 0 .../contracts/proxy/pics/Dispatcher.png | Bin .../contracts/proxy/pics/Dispatcher2.png | Bin .../contracts/proxy/pics/Dispatcher3.png | Bin .../contracts/proxy/pics/Hard-fork.png | Bin .../contracts/proxy/pics/Hard-fork2.png | Bin .../contracts/proxy/pics/Hard-fork3.png | Bin .../contracts/zeppelin/math/Math.sol | 0 .../contracts/zeppelin/math/SafeMath.sol | 0 .../contracts/zeppelin/ownership/Ownable.sol | 0 .../zeppelin/token/ERC20/BasicToken.sol | 0 .../zeppelin/token/ERC20/BurnableToken.sol | 0 .../zeppelin/token/ERC20/DetailedERC20.sol | 0 .../contracts/zeppelin/token/ERC20/ERC20.sol | 0 .../zeppelin/token/ERC20/ERC20Basic.sol | 0 .../zeppelin/token/ERC20/SafeERC20.sol | 0 .../zeppelin/token/ERC20/StandardToken.sol | 0 .../project => sol_source}/project.json | 2 +- .../eth/{nkms_eth => }/utilities.py | 10 +- nkms/blockchain/setup.py | 17 - nkms/characters.py | 2 +- nkms/config/configs.py | 66 +- nkms/config/keys.py | 2 +- nkms/config/utils.py | 5 +- nkms/policy/models.py | 2 +- setup.py | 16 +- .../blockchain}/__init__.py | 0 .../blockchain/eth}/__init__.py | 0 .../blockchain/eth}/conftest.py | 12 +- .../blockchain/eth/contracts/__init__.py | 0 .../eth}/contracts/contracts/IssuerBad.sol | 0 .../eth}/contracts/contracts/IssuerMock.sol | 0 .../eth}/contracts/contracts/IssuerV2Mock.sol | 0 .../contracts/contracts/MinersEscrowBad.sol | 0 .../contracts/MinersEscrowForPolicyMock.sol | 0 .../MinersEscrowForUserEscrowMock.sol | 0 .../contracts/MinersEscrowV2Mock.sol | 0 .../contracts/contracts/PolicyManagerBad.sol | 0 .../PolicyManagerForMinersEscrowMock.sol | 0 .../PolicyManagerForUserEscrowMock.sol | 0 .../contracts/PolicyMangerV2Mock.sol | 0 .../contracts/lib/LinkedListMock.sol | 0 .../contracts/proxy/ContracV2Bad.sol | 0 .../contracts/proxy/ContractInterface.sol | 0 .../contracts/contracts/proxy/ContractV1.sol | 0 .../contracts/contracts/proxy/ContractV2.sol | 0 .../contracts/contracts/proxy/ContractV3.sol | 0 .../contracts/proxy/GovernmentBad.sol | 0 .../contracts/proxy/GovernmentV2Mock.sol | 0 .../contracts/proxy/MinersEscrowV1Mock.sol | 0 .../contracts/proxy/PolicyManagerV1Mock.sol | 0 .../eth}/contracts/test_dispatcher.py | 0 .../eth}/contracts/test_government.py | 0 .../eth}/contracts/test_integration.py | 0 .../blockchain/eth}/contracts/test_issuer.py | 0 .../eth}/contracts/test_linked_list.py | 0 .../eth}/contracts/test_miners_escrow.py | 0 .../eth}/contracts/test_policy_manager.py | 0 .../blockchain/eth}/contracts/test_token.py | 0 .../eth}/contracts/test_user_escrow.py | 0 tests/blockchain/eth/entities/__init__.py | 0 .../blockchain/eth}/entities/test_actors.py | 4 +- .../blockchain/eth}/entities/test_agents.py | 2 +- .../blockchain/eth/entities/test_deployers.py | 0 .../blockchain/eth}/test_api.py | 5 +- .../blockchain/eth}/test_setup.py | 6 +- tests/eth_fixtures.py | 6 +- tests/network/test_network_actors.py | 2 +- 96 files changed, 118 insertions(+), 773 deletions(-) rename nkms/blockchain/{eth/nkms_eth => }/__init__.py (100%) delete mode 100644 nkms/blockchain/eth/.gitignore delete mode 100644 nkms/blockchain/eth/Pipfile delete mode 100644 nkms/blockchain/eth/Pipfile.lock rename nkms/blockchain/eth/{tests => }/__init__.py (100%) rename nkms/blockchain/eth/{nkms_eth => }/actors.py (99%) rename nkms/blockchain/eth/{nkms_eth => }/agents.py (98%) rename nkms/blockchain/eth/{nkms_eth => }/blockchain.py (98%) rename nkms/blockchain/eth/{nkms_eth/config.py => constants.py} (50%) rename nkms/blockchain/eth/{nkms_eth => }/deployers.py (99%) rename nkms/blockchain/eth/{nkms_eth => }/policies.py (98%) delete mode 100755 nkms/blockchain/eth/scripts/pip_setup.sh rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/Issuer.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/MinersEscrow.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/NuCypherKMSToken.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/PolicyManager.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/UserEscrow.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/lib/AdditionalMath.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/lib/LinkedList.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/Dispatcher.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/Government.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/README.MD (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/UPDATE.MD (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/Upgradeable.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/pics/Dispatcher.png (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/pics/Dispatcher2.png (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/pics/Dispatcher3.png (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/pics/Hard-fork.png (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/pics/Hard-fork2.png (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/proxy/pics/Hard-fork3.png (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/math/Math.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/math/SafeMath.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/ownership/Ownable.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/token/ERC20/BasicToken.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/token/ERC20/BurnableToken.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/token/ERC20/DetailedERC20.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/token/ERC20/ERC20.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/token/ERC20/ERC20Basic.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/token/ERC20/SafeERC20.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/contracts/zeppelin/token/ERC20/StandardToken.sol (100%) rename nkms/blockchain/eth/{nkms_eth/project => sol_source}/project.json (98%) rename nkms/blockchain/eth/{nkms_eth => }/utilities.py (88%) delete mode 100644 nkms/blockchain/setup.py rename {nkms/blockchain/eth/tests/contracts => tests/blockchain}/__init__.py (100%) rename {nkms/blockchain/eth/tests/entities => tests/blockchain/eth}/__init__.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/conftest.py (82%) rename nkms/blockchain/eth/tests/entities/test_deployers.py => tests/blockchain/eth/contracts/__init__.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/IssuerBad.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/IssuerMock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/IssuerV2Mock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/MinersEscrowBad.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/MinersEscrowForPolicyMock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/MinersEscrowForUserEscrowMock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/MinersEscrowV2Mock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/PolicyManagerBad.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/PolicyManagerForMinersEscrowMock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/PolicyManagerForUserEscrowMock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/PolicyMangerV2Mock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/lib/LinkedListMock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/ContracV2Bad.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/ContractInterface.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/ContractV1.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/ContractV2.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/ContractV3.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/GovernmentBad.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/GovernmentV2Mock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/MinersEscrowV1Mock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/contracts/proxy/PolicyManagerV1Mock.sol (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_dispatcher.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_government.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_integration.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_issuer.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_linked_list.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_miners_escrow.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_policy_manager.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_token.py (100%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/contracts/test_user_escrow.py (100%) create mode 100644 tests/blockchain/eth/entities/__init__.py rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/entities/test_actors.py (98%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/entities/test_agents.py (92%) create mode 100644 tests/blockchain/eth/entities/test_deployers.py rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/test_api.py (90%) rename {nkms/blockchain/eth/tests => tests/blockchain/eth}/test_setup.py (83%) diff --git a/.gitignore b/.gitignore index efece097a..8bacdb57b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ __pycache__ _temp_test_datastore .mypy_cache .pytest_cache/ +/logs +/registrar.json +/dist +chains diff --git a/Pipfile b/Pipfile index 4147abc58..54f18a362 100644 --- a/Pipfile +++ b/Pipfile @@ -25,6 +25,7 @@ eth-account = "*" "web3" = "*" appdirs = "*" populus = {git = "https://github.com/nucypher/Bropulus.git"} +eth-tester = "*" [dev-packages] pytest = "*" diff --git a/nkms/blockchain/eth/nkms_eth/__init__.py b/nkms/blockchain/__init__.py similarity index 100% rename from nkms/blockchain/eth/nkms_eth/__init__.py rename to nkms/blockchain/__init__.py diff --git a/nkms/blockchain/eth/.gitignore b/nkms/blockchain/eth/.gitignore deleted file mode 100644 index 8e7b3a08c..000000000 --- a/nkms/blockchain/eth/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -__pycache__ -*.pyc -/.venv -/*.egg-info -/build -/.cache -*.so -/MANIFEST -/.tox -.idea -/logs -/registrar.json -/dist -chains -.pytest_cache \ No newline at end of file diff --git a/nkms/blockchain/eth/Pipfile b/nkms/blockchain/eth/Pipfile deleted file mode 100644 index e8f11e118..000000000 --- a/nkms/blockchain/eth/Pipfile +++ /dev/null @@ -1,16 +0,0 @@ -[[source]] -url = "https://pypi.python.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -pdbpp = "*" -ipython = "*" -populus = "*" -cytoolz = "*" -appdirs = "*" -eth-tester = "*" - -[dev-packages] -pytest = "*" -pdbpp = "*" diff --git a/nkms/blockchain/eth/Pipfile.lock b/nkms/blockchain/eth/Pipfile.lock deleted file mode 100644 index bc22426fe..000000000 --- a/nkms/blockchain/eth/Pipfile.lock +++ /dev/null @@ -1,623 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "49f8e3c689e21af3ce393f45d06634faf8a91f0c3dcbfdd215d8869f78f39c64" - }, - "host-environment-markers": { - "implementation_name": "cpython", - "implementation_version": "3.6.3", - "os_name": "posix", - "platform_machine": "x86_64", - "platform_python_implementation": "CPython", - "platform_release": "4.13.0-31-generic", - "platform_system": "Linux", - "platform_version": "#34-Ubuntu SMP Fri Jan 19 16:34:46 UTC 2018", - "python_full_version": "3.6.3", - "python_version": "3.6", - "sys_platform": "linux" - }, - "pipfile-spec": 6, - "requires": {}, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.python.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "anyconfig": { - "hashes": [ - "sha256:d96ef87d545c112eb6794b85419948b71cd17bf85b95a26e825182d010494198" - ], - "version": "==0.9.3" - }, - "appdirs": { - "hashes": [ - "sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e", - "sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92" - ], - "version": "==1.4.3" - }, - "argh": { - "hashes": [ - "sha256:a9b3aaa1904eeb78e32394cd46c6f37ac0fb4af6dc488daa58971bdc7d7fcaf3", - "sha256:e9535b8c84dc9571a48999094fda7f33e63c3f1b74f3e5f3ac0105a58405bb65" - ], - "version": "==0.26.2" - }, - "attrs": { - "hashes": [ - "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450", - "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9" - ], - "version": "==17.4.0" - }, - "bitcoin": { - "hashes": [ - "sha256:11ba70bd9e1c764f6bb2c4bd4c7fbebd5c9053c73f4d4325b00a98869a8b7236" - ], - "version": "==1.1.42" - }, - "certifi": { - "hashes": [ - "sha256:14131608ad2fd56836d33a71ee60fa1c82bc9d2c8d98b7bdbc631fe1b3cd1296", - "sha256:edbc3f203427eef571f79a7692bb160a2b0f7ccaa31953e99bd17e307cf63f7d" - ], - "version": "==2018.1.18" - }, - "cffi": { - "hashes": [ - "sha256:5d0d7023b72794ea847725680e2156d1d01bc698a9007fccce46d03c904fe093", - "sha256:86903c0afab4a3390170aca61f753f5adad8ffff947030719ee44dedc5b68403", - "sha256:7d35678a54da0d3f1bc30e3a58a232043753d57c691875b5a75e4e062793bc9a", - "sha256:824cac33906be5c8e976f0d950924d88ec058989ef9cd2f77f5cd53cec417635", - "sha256:6ca52651f6bd4b8647cb7dee15c82619de3e13490f8e0bc0620830a2245b51d1", - "sha256:a183959a4b1e01d6172aeed356e2523ec8682596075aa6cf0003fe08da959a49", - "sha256:9532c5bc0108bd0fe43c0eb3faa2ef98a2db60fc0d4019f106b88d46803dd663", - "sha256:96652215ef328262b5f1d5647632bd342ac6b31dfbc495b21f1ab27cb06d621d", - "sha256:6c99d19225e3135f6190a3bfce2a614cae8eaa5dcaf9e0705d4ccb79a3959a3f", - "sha256:12cbf4c04c1ad07124bfc9e928c01e282feac9ec7dd72a18042d4fc56456289a", - "sha256:69c37089ccf10692361c8d14dbf4138b00b46741ffe9628755054499f06ed548", - "sha256:b8d1454ef627098dc76ccfd6211a08065e6f84efe3754d8d112049fec3768e71", - "sha256:cd13f347235410c592f6e36395ee1c136a64b66534f10173bfa4df1dc88f47d0", - "sha256:0640f12f04f257c4467075a804a4920a5d07ef91e11c525fc65d715c08231c81", - "sha256:89a8d05b96bdeca8fdc89c5fa9469a357d30f6c066262e92c0c8d2e4d3c53cae", - "sha256:a67c430a9bde73ae85b0c885fcf41b556760e42ea74c16dc70431a349989b448", - "sha256:7a831170b621e98f45ed1d5758325be19619a593924127a0a47af9a72a117319", - "sha256:796d0379102e6da5215acfcd20e8e69cca9d97309215b4ce088fe175b1c2f586", - "sha256:0fe3b3d571543a4065059d1d3d6d39f4ca6da0f2207ad13547094522e32ead46", - "sha256:678135090c311780382b1dd3f828f715583ea8a69687ed053c047d3cec6625d6", - "sha256:f4992cd7b4c867f453d44c213ee29e8fd484cf81cfece4b6e836d0982b6fa1cf", - "sha256:6d191fb20138fe1948727b20e7b96582b7b7e676135eabf72d910e10bf7bfa65", - "sha256:ec208ca16e57904dd7f4c7568665f80b1f7eb7e3214be014560c28def219060d", - "sha256:b3653644d6411bf4bd64c1f2ca3cb1b093f98c68439ade5cef328609bbfabf8c", - "sha256:f4719d0bafc5f0a67b2ec432086d40f653840698d41fa6e9afa679403dea9d78", - "sha256:87f837459c3c78d75cb4f5aadf08a7104db15e8c7618a5c732e60f252279c7a6", - "sha256:df9083a992b17a28cd4251a3f5c879e0198bb26c9e808c4647e0a18739f1d11d" - ], - "version": "==1.11.4" - }, - "chardet": { - "hashes": [ - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691", - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" - ], - "version": "==3.0.4" - }, - "click": { - "hashes": [ - "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d", - "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b" - ], - "version": "==6.7" - }, - "contextlib2": { - "hashes": [ - "sha256:f5260a6e679d2ff42ec91ec5252f4eeffdcf21053db9113bd0a8e4d953769c00", - "sha256:509f9419ee91cdd00ba34443217d5ca51f5a364a404e1dce9e8979cea969ca48" - ], - "version": "==0.5.5" - }, - "cytoolz": { - "hashes": [ - "sha256:5ebb55855a8bb7800afa58e52408763935527e0305f35600c71b43c86013dec2" - ], - "version": "==0.9.0" - }, - "decorator": { - "hashes": [ - "sha256:94d1d8905f5010d74bbbd86c30471255661a14187c45f8d7f3e5aa8540fdb2e5", - "sha256:7d46dd9f3ea1cf5f06ee0e4e1277ae618cf48dfb10ada7c8427cd46c42702a0e" - ], - "version": "==4.2.1" - }, - "eth-abi": { - "hashes": [ - "sha256:e6a50d3e0a1de26e55f8ec88e1854560191d2d27ac64c12363141b40065a9d38", - "sha256:ce1d514390b331d7dd63e6f0d9d8fdb289e2f5974e5346dfa91e42aefe452e8e" - ], - "version": "==0.5.0" - }, - "eth-keyfile": { - "hashes": [ - "sha256:585d326ea6fe20afa6c8ec232613a285de7e3d722643107a85a13963b15a1fc6", - "sha256:512b331ca97a4fb0a252a320b85c97c1b675c25026be4e9bc287ca9839828cf8" - ], - "version": "==0.4.1" - }, - "eth-keys": { - "hashes": [ - "sha256:0055ad91bfeee4d0a43e9be76ba7b5038eb3cba7c3e0bece8b140045d493c37a", - "sha256:5f1fc4830ce0da32e2c7bb5a593c429cc4a257996d3a0db0131894918c88b3dc" - ], - "version": "==0.1.0b4" - }, - "eth-tester": { - "hashes": [ - "sha256:0a04d8c0d57e62f2aaf51676db191aa5a89921a2e1db192ca6498f9afadc21f6", - "sha256:c6b653f34f305aea02f778269f381fbda9150105702e4dd89414114dd2730775" - ], - "version": "==0.1.0b15" - }, - "eth-testrpc": { - "hashes": [ - "sha256:1e07d4a9524b4fa25c26575bba221a9b5949ab743aade5726fe418be3e66c172", - "sha256:64ca820db8ae840bedcb6657a1f235f5a28f68784b345f6b47db9886dc558b89" - ], - "version": "==1.3.3" - }, - "eth-utils": { - "hashes": [ - "sha256:202a813b5ef0812d5f0d050cb725b1f4a6212a08d0631099cbee6fd9df1bfa4f", - "sha256:fea1953c6ae90a4f5e97745a50c1e1f5ce43d63f28c9fe1659725177c28275a1" - ], - "version": "==0.7.4" - }, - "ethereum": { - "hashes": [ - "sha256:2c3baa6ff41398088c9d35541c551f194eadc57dc70d56068af3381780fe234d" - ], - "version": "==1.6.1" - }, - "fancycompleter": { - "hashes": [ - "sha256:d2522f1f3512371f295379c4c0d1962de06762eb586c199620a2a5d423539b12" - ], - "version": "==0.8" - }, - "idna": { - "hashes": [ - "sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4", - "sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f" - ], - "version": "==2.6" - }, - "ipython": { - "hashes": [ - "sha256:fcc6d46f08c3c4de7b15ae1c426e15be1b7932bcda9d83ce1a4304e8c1129df3", - "sha256:51c158a6c8b899898d1c91c6b51a34110196815cc905f9be0fa5878e19355608" - ], - "version": "==6.2.1" - }, - "ipython-genutils": { - "hashes": [ - "sha256:72dd37233799e619666c9f639a9da83c34013a73e8bbc79a7a6348d93c61fab8", - "sha256:eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8" - ], - "version": "==0.2.0" - }, - "jedi": { - "hashes": [ - "sha256:d795f2c2e659f5ea39a839e5230d70a0b045d0daee7ca2403568d8f348d0ad89", - "sha256:d6e799d04d1ade9459ed0f20de47c32f2285438956a677d083d3c98def59fa97" - ], - "version": "==0.11.1" - }, - "json-rpc": { - "hashes": [ - "sha256:bb62b2fefd8dd9c639e743c5556b8fa882b38145c0e871a731aa42e0b83754ab", - "sha256:21f04a98d312eaec1b200ea91c147ef6e3b9fc0219aff5bd940e50b6c446d3b5" - ], - "version": "==1.10.8" - }, - "jsonschema": { - "hashes": [ - "sha256:000e68abd33c972a5248544925a0cae7d1125f9bf6c58280d37546b946769a08", - "sha256:6ff5f3180870836cae40f06fa10419f557208175f13ad7bc26caa77beb1f6e02" - ], - "version": "==2.6.0" - }, - "parso": { - "hashes": [ - "sha256:a7bb86fe0844304869d1c08e8bd0e52be931228483025c422917411ab82d628a", - "sha256:5815f3fe254e5665f3c5d6f54f086c2502035cb631a91341591b5a564203cffb" - ], - "version": "==0.1.1" - }, - "pathtools": { - "hashes": [ - "sha256:7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0" - ], - "version": "==0.1.2" - }, - "pbkdf2": { - "hashes": [ - "sha256:ac6397369f128212c43064a2b4878038dab78dab41875364554aaf2a684e6979" - ], - "version": "==1.3" - }, - "pdbpp": { - "hashes": [ - "sha256:dde77326e4ea41439c243ed065826d53539530eeabd1b6615aae15cfbb9fda05" - ], - "version": "==0.9.2" - }, - "pexpect": { - "hashes": [ - "sha256:144939a072a46d32f6e5ecc866509e1d613276781f7182148a08df52eaa7b022", - "sha256:8e287b171dbaf249d0b06b5f2e88cb7e694651d2d0b8c15bccb83170d3c55575" - ], - "markers": "sys_platform != 'win32'", - "version": "==4.3.1" - }, - "pickleshare": { - "hashes": [ - "sha256:c9a2541f25aeabc070f12f452e1f2a8eae2abd51e1cd19e8430402bdf4c1d8b5", - "sha256:84a9257227dfdd6fe1b4be1319096c20eb85ff1e82c7932f36efccfe1b09737b" - ], - "version": "==0.7.4" - }, - "pluggy": { - "hashes": [ - "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff" - ], - "version": "==0.6.0" - }, - "populus": { - "hashes": [ - "sha256:47415587f6ae5112c07959618ac03f7ff51c552bccf485c0d42652b62e7a8605", - "sha256:06d01f1e37407f6273a2abb074916351e567e7bab906fdb2996207a840123c13", - "sha256:2999a0078bd140e84b2008f491e6fa703c63845ddb626e67b8698abab7d2ba8f" - ], - "version": "==2.2.0" - }, - "prompt-toolkit": { - "hashes": [ - "sha256:3f473ae040ddaa52b52f97f6b4a493cfa9f5920c255a12dc56a7d34397a398a4", - "sha256:1df952620eccb399c53ebb359cc7d9a8d3a9538cb34c5a1344bdbeb29fbcc381", - "sha256:858588f1983ca497f1cf4ffde01d978a3ea02b01c8a26a8bbc5cd2e66d816917" - ], - "version": "==1.0.15" - }, - "ptyprocess": { - "hashes": [ - "sha256:e8c43b5eee76b2083a9badde89fd1bbce6c8942d1045146e100b7b5e014f4f1a", - "sha256:e64193f0047ad603b71f202332ab5527c5e52aa7c8b609704fc28c0dc20c4365" - ], - "version": "==0.5.2" - }, - "py": { - "hashes": [ - "sha256:8cca5c229d225f8c1e3085be4fcf306090b00850fefad892f9d96c7b6e2f310f", - "sha256:ca18943e28235417756316bfada6cd96b23ce60dd532642690dcfdaba988a76d" - ], - "version": "==1.5.2" - }, - "py-geth": { - "hashes": [ - "sha256:bc31bd18ad752cfe48f7e13ab90b0fb4eb323a2afa7c5e6ec9e5eeb5612e1ae9", - "sha256:5f8fdcdd32cd7730e33f94a81cda8e80acb93acb03f1b3184256f46d382b54e7", - "sha256:55bc267bbcb0279550779544ce95ebc1d86d97458710d835966d13e78ac8da3e" - ], - "version": "==2.0.0" - }, - "py-solc": { - "hashes": [ - "sha256:90b7308abe35825979a1a03294bc383b5282bebdf9db1dda58223142dc7e9955", - "sha256:0e657cc639b91649084901c00f0b14b921d40ab1b2faed0fb1216e80999bda72" - ], - "version": "==2.1.0" - }, - "pycparser": { - "hashes": [ - "sha256:99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226" - ], - "version": "==2.18" - }, - "pycryptodome": { - "hashes": [ - "sha256:ece04e5f9db1346e09bb16939d94297cd7b82922660715d8e695ef49be954ead", - "sha256:663e2c4bb55aa1ce4d9da947047a858201b48b867ecf68b0d4b6df4a7ca395d1", - "sha256:9fbca70f31da80834435da3383ab3655c410a582eaea372a90bd001a077d08a9", - "sha256:e089d8619a46212cc191258292a3ffbe0d44b9e5ca21f036a4ca8f2db6b0860a", - "sha256:24153e840ccaf9810804b657cf16b85e388520a1204d5efa55f1cc9c2c2601b9", - "sha256:1c89fa30b343a0e93b97db06b23e1b21b3059b1d5b7d799ce22b70bc2feb1102", - "sha256:33ea6954a2fcb02e7a377e7e5a5a9fd0ecbe4e5ea7694bcc9288f4414470db69", - "sha256:66bc74812d825655c330a9d0c564493a9c001c30e8e1cef9037ec925f03d6e9e", - "sha256:b3867e75287e2e76fa982a32e15d1342367217093b4048c155761be2715ec817", - "sha256:18ce54f358e0405e963544585bc7ba5d8ce414212410c15a95a470aee8c38d4d", - "sha256:61f983f10d2e21e3f5e424fac5aab4ef5e6b68f759bd3b83fe8c839c7d1a9d09", - "sha256:ddd21b4dcd6b2102ee0c1edf7840b0d0914a7fbe827cc5bca2e82ed77a1430e6", - "sha256:f0c59f974fbc9e97c7412a6acb652214a1d8ff19b5fa5c1ba4df4e889c0a8a92", - "sha256:163ab58febfa9570082106153c48d8fdc58d3249efdcbec0e04140448528bed7", - "sha256:c48734d77c95439ded9ebb96d05b7b1a829af8905dc58e60b5da059e9cbb338b", - "sha256:60de23a82b49fd1fcff57cab04b205e31efe8c1efaa505a05120e86edec2a9ee", - "sha256:08397452b817621f8e1740f08c7b13685226da0085267772547b4ac5f53c9bc2", - "sha256:ba2e51987e71edd52f1e3afc82569544e1d9c885a18a1f35ca1b000aa2951ed8", - "sha256:fd4f82f4fbbaf401ca1080b22eb2d1f3f77259b9da1d4e46d312c9e9cb18766c", - "sha256:2c1ca8e134dc812555400e0a993cd4b9c858c968e6819522ae69d7b0ad6437a7", - "sha256:fc1956aa27a14437bcd7f58a9c5ac6d8d5731f9d136312138b2f48ba8039ada1", - "sha256:d2e2ea8fc409656f945422b3b732ff12961308276d3773fe4d10d4c496a712d0", - "sha256:ede7f1f44b0895feb8ddbf882d1a7eb504deb3fa34fcc4860d6065c25cbdf175" - ], - "version": "==3.4.8" - }, - "pyethash": { - "hashes": [ - "sha256:ff66319ce26b9d77df1f610942634dac9742e216f2c27b051c0a2c2dec9c2818" - ], - "version": "==0.1.27" - }, - "pygments": { - "hashes": [ - "sha256:78f3f434bcc5d6ee09020f92ba487f95ba50f1e3ef83ae96b9d5ffa1bab25c5d", - "sha256:dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc" - ], - "version": "==2.2.0" - }, - "pylru": { - "hashes": [ - "sha256:71376192671f0ad1690b2a7427d39a29b1df994c8469a9b46b03ed7e28c0172c" - ], - "version": "==1.0.9" - }, - "pysha3": { - "hashes": [ - "sha256:6e6a84efb7856f5d760ee55cd2b446972cb7b835676065f6c4f694913ea8f8d9", - "sha256:f9046d59b3e72aa84f6dae83a040bd1184ebd7fef4e822d38186a8158c89e3cf", - "sha256:68c3a60a39f9179b263d29e221c1bd6e01353178b14323c39cc70593c30f21c5", - "sha256:59111c08b8f34495575d12e5f2ce3bafb98bea470bc81e70c8b6df99aef0dd2f", - "sha256:9fdd28884c5d0b4edfed269b12badfa07f1c89dbc5c9c66dd279833894a9896b", - "sha256:41be70b06c8775a9e4d4eeb52f2f6a3f356f17539a54eac61f43a29e42fd453d", - "sha256:571a246308a7b63f15f5aa9651f99cf30f2a6acba18eddf28f1510935968b603", - "sha256:93abd775dac570cb9951c4e423bcb2bc6303a9d1dc0dc2b7afa2dd401d195b24", - "sha256:11a2ba7a2e1d9669d0052fc8fb30f5661caed5512586ecbeeaf6bf9478ab5c48", - "sha256:5ec8da7c5c70a53b5fa99094af3ba8d343955b212bc346a0d25f6ff75853999f", - "sha256:9c778fa8b161dc9348dc5cc361e94d54aa5ff18413788f4641f6600d4893a608", - "sha256:fd7e66999060d079e9c0e8893e78d8017dad4f59721f6fe0be6307cd32127a07", - "sha256:827b308dc025efe9b6b7bae36c2e09ed0118a81f792d888548188e97b9bf9a3d", - "sha256:4416f16b0f1605c25f627966f76873e432971824778b369bd9ce1bb63d6566d9", - "sha256:c93a2676e6588abcfaecb73eb14485c81c63b94fca2000a811a7b4fb5937b8e8", - "sha256:684cb01d87ed6ff466c135f1c83e7e4042d0fc668fa20619f581e6add1d38d77", - "sha256:386998ee83e313b6911327174e088021f9f2061cbfa1651b97629b761e9ef5c4", - "sha256:c7c2adcc43836223680ebdf91f1d3373543dc32747c182c8ca2e02d1b69ce030", - "sha256:cd5c961b603bd2e6c2b5ef9976f3238a561c58569945d4165efb9b9383b050ef", - "sha256:0060a66be16665d90c432f55a0ba1f6480590cfb7d2ad389e688a399183474f0", - "sha256:fe988e73f2ce6d947220624f04d467faf05f1bbdbc64b0a201296bb3af92739e" - ], - "version": "==1.0.2" - }, - "pytest": { - "hashes": [ - "sha256:95fa025cd6deb5d937e04e368a00552332b58cae23f63b76c8c540ff1733ab6d", - "sha256:6074ea3b9c999bd6d0df5fa9d12dd95ccd23550df2a582f5f5b848331d2e82ca" - ], - "version": "==3.4.0" - }, - "pyyaml": { - "hashes": [ - "sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f", - "sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736", - "sha256:e863072cdf4c72eebf179342c94e6989c67185842d9997960b3e69290b2fa269", - "sha256:bc6bced57f826ca7cb5125a10b23fd0f2fff3b7c4701d64c439a300ce665fff8", - "sha256:c01b880ec30b5a6e6aa67b09a2fe3fb30473008c85cd6a67359a1b15ed6d83a4", - "sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf0d1", - "sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab", - "sha256:5f84523c076ad14ff5e6c037fe1c89a7f73a3e04cf0377cb4d017014976433f3", - "sha256:0c507b7f74b3d2dd4d1322ec8a94794927305ab4cebbe89cc47fe5e81541e6e8", - "sha256:b4c423ab23291d3945ac61346feeb9a0dc4184999ede5e7c43e1ffb975130ae6", - "sha256:ca233c64c6e40eaa6c66ef97058cdc80e8d0157a443655baa1b2966e812807ca", - "sha256:4474f8ea030b5127225b8894d626bb66c01cda098d47a2b0d3429b6700af9fd8", - "sha256:326420cbb492172dec84b0f65c80942de6cedb5233c413dd824483989c000608", - "sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7" - ], - "version": "==3.12" - }, - "repoze.lru": { - "hashes": [ - "sha256:f77bf0e1096ea445beadd35f3479c5cff2aa1efe604a133e67150bc8630a62ea", - "sha256:0429a75e19380e4ed50c0694e26ac8819b4ea7851ee1fc7583c8572db80aff77" - ], - "version": "==0.7" - }, - "requests": { - "hashes": [ - "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", - "sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" - ], - "version": "==2.18.4" - }, - "rlp": { - "hashes": [ - "sha256:87879a0ba1479b760cee98af165de2eee95258b261faa293199f60742be96f34" - ], - "version": "==0.6.0" - }, - "scrypt": { - "hashes": [ - "sha256:dc9abe69799ca423b938a06ddc33e5873e493ffcd68dbb9ba48396979b210d39", - "sha256:4e3cd639cc83e3f2c2241a01ebef9487c48b1ddf2d78f430d82d8f9ef60c6271", - "sha256:ae2fd88756fb4d98ccc5e2639af55eeb80863b3f9f6e0f539e5ce050964cdd5e", - "sha256:60e8c96a287ab892d9c7e1523d157ccfbdbe66da0c31738c8ed5732c2eea6a23", - "sha256:c0f90cabb8f6eaec05de5ce9aa9a9b67dc63d644e6b803beb1c43ae9b9452b65", - "sha256:c37a1f8440d7c621d9f23f3c1f2a28848bc50fefbca581fd7a1b01583a083c07", - "sha256:3422d11652cd12550540675e9fb54a1de6d60f3cbfedfb067284ef028589e2ee", - "sha256:d4a5a4f53450b8ef629bbf1ee4be6105c69936e49b3d8bc621ac2287f0c86020", - "sha256:6109a4df8c88f851df18a1a451e533dcc47e17cfe0e4561f4e08a82669ddc942", - "sha256:136f7d1caf596c5ee1fc7eab223605e956c3f61f77090fd9ea4e3e57a2040b78", - "sha256:c8909a2089fd1199781aa7ce2cb66b8866d40a9f9e1fba082e067ed9524d87e9", - "sha256:4333b67f190e5eaddc8800aefe33abd7e81b589bbe84a84be66872a4955dad6e", - "sha256:aeab005a8ae43a6e5d0165ce433a15955b151045d2bbfc52a8c96f100f825323", - "sha256:bb141584fa0ebdfb8a2a1fc7ddcf119ee18b1b9cd0fb3e4df9615760648b9d49" - ], - "version": "==0.8.0" - }, - "secp256k1": { - "hashes": [ - "sha256:a755c85947b70c69cf318412bfd12889863e70ddf76b588701835a4da5322d55", - "sha256:a598f2223ed3bf55bb7e317c5ebd1a316b3b4d65db26de32554bb84adf026eae", - "sha256:2ad20bb8553425be795ecaf6641a510470701fa6a7aa9c54395d3989c070ab4c", - "sha256:e9842fdc3b24c3174f49794d93b10b2013aa7b5d7029d12989458482c95ee56a", - "sha256:5cded8e5d241dd92f6e55fd7462ff74e4edcbe97850b7bf4378cc56e48e446d7", - "sha256:e86eab58d0c2e93c08483c8a8546fe54ade8150ff4a1f320417d647635cb133b", - "sha256:29521dda0f3ad51afc26141d9a564b40bb39e84d27046164c502774b22ea2f9c", - "sha256:df29091e6ac74bb0683a44d57411bd59c6c99d04d79ef4e396e4a67d91f6bd65", - "sha256:a3b43e02d321c09eafa769a6fc2c156f555cab3a7db62175ef2fd21e16cdf20c" - ], - "version": "==0.13.2" - }, - "semantic-version": { - "hashes": [ - "sha256:2d06ab7372034bcb8b54f2205370f4aa0643c133b7e6dbd129c5200b83ab394b", - "sha256:2a4328680073e9b243667b201119772aefc5fc63ae32398d6afafff07c4f54c0" - ], - "version": "==2.6.0" - }, - "simplegeneric": { - "hashes": [ - "sha256:dc972e06094b9af5b855b3df4a646395e43d1c9d0d39ed345b7393560d0b9173" - ], - "version": "==0.8.1" - }, - "six": { - "hashes": [ - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" - ], - "version": "==1.11.0" - }, - "toolz": { - "hashes": [ - "sha256:929f0a7ea7f61c178bd951bdae93920515d3fbdbafc8e6caf82d752b9b3b31c9" - ], - "version": "==0.9.0" - }, - "toposort": { - "hashes": [ - "sha256:d80128b83b411d503b0cdb4a8f172998bc1d3b434b6402a349b8ebd734d51a80", - "sha256:dba5ae845296e3bf37b042c640870ffebcdeb8cd4df45adaa01d8c5476c557dd" - ], - "version": "==1.5" - }, - "traitlets": { - "hashes": [ - "sha256:c6cb5e6f57c5a9bdaa40fa71ce7b4af30298fbab9ece9815b5d995ab6217c7d9", - "sha256:9c4bd2d267b7153df9152698efb1050a5d84982d3384a37b2c1f7723ba3e7835" - ], - "version": "==4.3.2" - }, - "urllib3": { - "hashes": [ - "sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b", - "sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f" - ], - "version": "==1.22" - }, - "watchdog": { - "hashes": [ - "sha256:7e65882adb7746039b6f3876ee174952f8eaaa34491ba34333ddf1fe35de4162" - ], - "version": "==0.8.3" - }, - "wcwidth": { - "hashes": [ - "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c", - "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e" - ], - "version": "==0.1.7" - }, - "web3": { - "hashes": [ - "sha256:d0ff8398c550618f34dd3cb2c5b6bcaf1b7e85ea0d7feb9c828556410fe25bfa", - "sha256:b2cff16b7f950acb3c982c0d96e590edb37cd82e2d01d3cb4bed9c0effb7a2e9" - ], - "version": "==3.16.4" - }, - "werkzeug": { - "hashes": [ - "sha256:d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b", - "sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c" - ], - "version": "==0.14.1" - }, - "wmctrl": { - "hashes": [ - "sha256:d806f65ac1554366b6e31d29d7be2e8893996c0acbb2824bbf2b1f49cf628a13" - ], - "version": "==0.3" - } - }, - "develop": { - "attrs": { - "hashes": [ - "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450", - "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9" - ], - "version": "==17.4.0" - }, - "fancycompleter": { - "hashes": [ - "sha256:d2522f1f3512371f295379c4c0d1962de06762eb586c199620a2a5d423539b12" - ], - "version": "==0.8" - }, - "pdbpp": { - "hashes": [ - "sha256:dde77326e4ea41439c243ed065826d53539530eeabd1b6615aae15cfbb9fda05" - ], - "version": "==0.9.2" - }, - "pluggy": { - "hashes": [ - "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff" - ], - "version": "==0.6.0" - }, - "py": { - "hashes": [ - "sha256:8cca5c229d225f8c1e3085be4fcf306090b00850fefad892f9d96c7b6e2f310f", - "sha256:ca18943e28235417756316bfada6cd96b23ce60dd532642690dcfdaba988a76d" - ], - "version": "==1.5.2" - }, - "pygments": { - "hashes": [ - "sha256:78f3f434bcc5d6ee09020f92ba487f95ba50f1e3ef83ae96b9d5ffa1bab25c5d", - "sha256:dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc" - ], - "version": "==2.2.0" - }, - "pytest": { - "hashes": [ - "sha256:95fa025cd6deb5d937e04e368a00552332b58cae23f63b76c8c540ff1733ab6d", - "sha256:6074ea3b9c999bd6d0df5fa9d12dd95ccd23550df2a582f5f5b848331d2e82ca" - ], - "version": "==3.4.0" - }, - "six": { - "hashes": [ - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" - ], - "version": "==1.11.0" - }, - "wmctrl": { - "hashes": [ - "sha256:d806f65ac1554366b6e31d29d7be2e8893996c0acbb2824bbf2b1f49cf628a13" - ], - "version": "==0.3" - } - } -} diff --git a/nkms/blockchain/eth/README.md b/nkms/blockchain/eth/README.md index 178089cf5..51437fd1a 100644 --- a/nkms/blockchain/eth/README.md +++ b/nkms/blockchain/eth/README.md @@ -1,17 +1,18 @@ # NuCypher KMS Ethereum + Ethereum (solidity) code for nucypher-kms, consists contracts and python classes for miners and clients. Part of contracts was copied from [OpenZeppelin](https://github.com/OpenZeppelin/zeppelin-solidity) repo. The basis is built on the [Populus](https://github.com/ethereum/populus) framework. -# Install -TBD # Periods structure -Most of the function in contracts works by periods. For example, stake in the contract `Escrow` is discretely unlocked by periods. + +Most of the function in contracts works by periods. For example, stake in the contract `Escrow` is discretely unlocked by periods. Period is calculating using block.timestamp in getCurrentPeriod() function (`Miner.sol`). Each period is 24 hours. So result of getting locked tokens in one day will be the same. # Main contracts -* Token contract + +* Token contract `NuCypherKMSToken` contract is ERC20 token with additional function - burn own tokens (only for owners) * Miner contract `MinersEscrow` contract holds stake from miners, store information about miners activity and assigns a reward for participating in NuCypher KMS network @@ -20,9 +21,7 @@ Period is calculating using block.timestamp in getCurrentPeriod() function (`Min * User escrow contract `UserEscrow` contract locks tokens for some time. In that period tokens are lineraly unlocked and all tokens can be used as stake in `MinersEscrow` contract -# Python client -TBD - # Solidity libraries + * `LinkedList` library is structure of linked list for address data type -* `Dispatcher` contract is proxy which used for updating versions of any contract. See [README.MD](nkms_eth/project/contracts/proxy/README.MD) +* `Dispatcher` contract is proxy which used for updating versions of any contract. See [README.MD](nkms.blockchain.eth/project/contracts/proxy/README.MD) diff --git a/nkms/blockchain/eth/tests/__init__.py b/nkms/blockchain/eth/__init__.py similarity index 100% rename from nkms/blockchain/eth/tests/__init__.py rename to nkms/blockchain/eth/__init__.py diff --git a/nkms/blockchain/eth/nkms_eth/actors.py b/nkms/blockchain/eth/actors.py similarity index 99% rename from nkms/blockchain/eth/nkms_eth/actors.py rename to nkms/blockchain/eth/actors.py index f841fe962..8c8540be7 100644 --- a/nkms/blockchain/eth/nkms_eth/actors.py +++ b/nkms/blockchain/eth/actors.py @@ -3,7 +3,7 @@ from collections import OrderedDict from datetime import datetime from typing import Tuple, List, Union -from nkms_eth.agents import NuCypherKMSTokenAgent +from nkms.blockchain.eth.agents import NuCypherKMSTokenAgent class TokenActor(ABC): diff --git a/nkms/blockchain/eth/nkms_eth/agents.py b/nkms/blockchain/eth/agents.py similarity index 98% rename from nkms/blockchain/eth/nkms_eth/agents.py rename to nkms/blockchain/eth/agents.py index d4d65b4c8..84687272d 100644 --- a/nkms/blockchain/eth/nkms_eth/agents.py +++ b/nkms/blockchain/eth/agents.py @@ -7,7 +7,7 @@ from typing import Set, Generator, List from web3.contract import Contract -from nkms_eth.deployers import MinerEscrowDeployer, NuCypherKMSTokenDeployer, PolicyManagerDeployer, ContractDeployer +from nkms.blockchain.eth.deployers import MinerEscrowDeployer, NuCypherKMSTokenDeployer, PolicyManagerDeployer, ContractDeployer class EthereumContractAgent(ABC): diff --git a/nkms/blockchain/eth/nkms_eth/blockchain.py b/nkms/blockchain/eth/blockchain.py similarity index 98% rename from nkms/blockchain/eth/nkms_eth/blockchain.py rename to nkms/blockchain/eth/blockchain.py index 89ef27d84..b5dd0e45e 100644 --- a/nkms/blockchain/eth/nkms_eth/blockchain.py +++ b/nkms/blockchain/eth/blockchain.py @@ -1,6 +1,6 @@ from abc import ABC -from nkms_eth.config import EthereumConfig +from nkms.config.configs import EthereumConfig class TheBlockchain(ABC): diff --git a/nkms/blockchain/eth/nkms_eth/config.py b/nkms/blockchain/eth/constants.py similarity index 50% rename from nkms/blockchain/eth/nkms_eth/config.py rename to nkms/blockchain/eth/constants.py index a8d39a130..cf3f9e021 100644 --- a/nkms/blockchain/eth/nkms_eth/config.py +++ b/nkms/blockchain/eth/constants.py @@ -1,15 +1,3 @@ -import os -from enum import Enum -from pathlib import Path - -from os.path import dirname, join, abspath - -import appdirs -import populus - -import nkms_eth - - class NuCypherTokenConfig: __subdigits = 18 _M = 10 ** __subdigits @@ -54,26 +42,3 @@ class NuCypherMinerConfig: @property def reward(self): return self.__reward - - -class EthereumConfig: - __python_project_name = 'nucypher-kms' - # __default_solidity_dir = os.path.join() # TODO: NKMSConfig Classes - - def __init__(self, provider, registrar_path=None): - - self.provider = provider - - # This config is persistent and is created in user's .local directory - if registrar_path is None: - registrar_path = join(appdirs.user_data_dir(self.__python_project_name), 'registrar.json') - self._registrar_path = registrar_path - - # Populus project config - self._project_dir = join(dirname(abspath(nkms_eth.__file__)), 'project') - self._populus_project = populus.Project(self._project_dir) - self.project.config['chains.mainnetrpc.contracts.backends.JSONFile.settings.file_path'] = self._registrar_path - - @property - def project(self): - return self._populus_project diff --git a/nkms/blockchain/eth/nkms_eth/deployers.py b/nkms/blockchain/eth/deployers.py similarity index 99% rename from nkms/blockchain/eth/nkms_eth/deployers.py rename to nkms/blockchain/eth/deployers.py index c2741ba42..4877ab494 100644 --- a/nkms/blockchain/eth/nkms_eth/deployers.py +++ b/nkms/blockchain/eth/deployers.py @@ -1,9 +1,8 @@ from typing import Tuple, Dict -from populus.contracts.contract import PopulusContract +from nkms.blockchain.eth.constants import NuCypherMinerConfig, NuCypherTokenConfig from web3.contract import Contract -from nkms_eth.config import NuCypherMinerConfig, NuCypherTokenConfig from .blockchain import TheBlockchain diff --git a/nkms/blockchain/eth/nkms_eth/policies.py b/nkms/blockchain/eth/policies.py similarity index 98% rename from nkms/blockchain/eth/nkms_eth/policies.py rename to nkms/blockchain/eth/policies.py index 0a1f2f07c..7896aef93 100644 --- a/nkms/blockchain/eth/nkms_eth/policies.py +++ b/nkms/blockchain/eth/policies.py @@ -1,4 +1,4 @@ -from nkms_eth.actors import Miner +from nkms.blockchain.eth.actors import Miner class BlockchainArrangement: diff --git a/nkms/blockchain/eth/scripts/estimate_gas_tester.py b/nkms/blockchain/eth/scripts/estimate_gas_tester.py index 3dfb10f49..42d7d29c9 100755 --- a/nkms/blockchain/eth/scripts/estimate_gas_tester.py +++ b/nkms/blockchain/eth/scripts/estimate_gas_tester.py @@ -6,7 +6,7 @@ A simple Python script to deploy contracts and then estimate gas for different m """ -from nkms_eth.agents import NuCypherKMSTokenAgent, MinerAgent +from nkms.blockchain.eth.agents import NuCypherKMSTokenAgent, MinerAgent import os from tests.utilities import TesterBlockchain diff --git a/nkms/blockchain/eth/scripts/pip_setup.sh b/nkms/blockchain/eth/scripts/pip_setup.sh deleted file mode 100755 index 0abb4995d..000000000 --- a/nkms/blockchain/eth/scripts/pip_setup.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -virtualenv -p python3 .venv -source .venv/bin/activate -pip3 install -r requirements.txt -wget https://github.com/ethereum/solidity/releases/download/v0.4.20/solc-static-linux -O .venv/bin/solc -chmod +x .venv/bin/solc -pip3 install -e . diff --git a/nkms/blockchain/eth/scripts/ursula_flow.py b/nkms/blockchain/eth/scripts/ursula_flow.py index 7885210ca..9658ba094 100755 --- a/nkms/blockchain/eth/scripts/ursula_flow.py +++ b/nkms/blockchain/eth/scripts/ursula_flow.py @@ -5,7 +5,7 @@ A simple Python script to deploy contracts and then estimate gas for different methods. """ import random -from nkms_eth.blockchain import project +from nkms.blockchain.eth.blockchain import project TIMEOUT = 10 MINING_COEFF = [10 ** 5, 10 ** 7] diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/Issuer.sol b/nkms/blockchain/eth/sol_source/contracts/Issuer.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/Issuer.sol rename to nkms/blockchain/eth/sol_source/contracts/Issuer.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/MinersEscrow.sol b/nkms/blockchain/eth/sol_source/contracts/MinersEscrow.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/MinersEscrow.sol rename to nkms/blockchain/eth/sol_source/contracts/MinersEscrow.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/NuCypherKMSToken.sol b/nkms/blockchain/eth/sol_source/contracts/NuCypherKMSToken.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/NuCypherKMSToken.sol rename to nkms/blockchain/eth/sol_source/contracts/NuCypherKMSToken.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/PolicyManager.sol b/nkms/blockchain/eth/sol_source/contracts/PolicyManager.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/PolicyManager.sol rename to nkms/blockchain/eth/sol_source/contracts/PolicyManager.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/UserEscrow.sol b/nkms/blockchain/eth/sol_source/contracts/UserEscrow.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/UserEscrow.sol rename to nkms/blockchain/eth/sol_source/contracts/UserEscrow.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/lib/AdditionalMath.sol b/nkms/blockchain/eth/sol_source/contracts/lib/AdditionalMath.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/lib/AdditionalMath.sol rename to nkms/blockchain/eth/sol_source/contracts/lib/AdditionalMath.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/lib/LinkedList.sol b/nkms/blockchain/eth/sol_source/contracts/lib/LinkedList.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/lib/LinkedList.sol rename to nkms/blockchain/eth/sol_source/contracts/lib/LinkedList.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/Dispatcher.sol b/nkms/blockchain/eth/sol_source/contracts/proxy/Dispatcher.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/Dispatcher.sol rename to nkms/blockchain/eth/sol_source/contracts/proxy/Dispatcher.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/Government.sol b/nkms/blockchain/eth/sol_source/contracts/proxy/Government.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/Government.sol rename to nkms/blockchain/eth/sol_source/contracts/proxy/Government.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/README.MD b/nkms/blockchain/eth/sol_source/contracts/proxy/README.MD similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/README.MD rename to nkms/blockchain/eth/sol_source/contracts/proxy/README.MD diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/UPDATE.MD b/nkms/blockchain/eth/sol_source/contracts/proxy/UPDATE.MD similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/UPDATE.MD rename to nkms/blockchain/eth/sol_source/contracts/proxy/UPDATE.MD diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/Upgradeable.sol b/nkms/blockchain/eth/sol_source/contracts/proxy/Upgradeable.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/Upgradeable.sol rename to nkms/blockchain/eth/sol_source/contracts/proxy/Upgradeable.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Dispatcher.png b/nkms/blockchain/eth/sol_source/contracts/proxy/pics/Dispatcher.png similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Dispatcher.png rename to nkms/blockchain/eth/sol_source/contracts/proxy/pics/Dispatcher.png diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Dispatcher2.png b/nkms/blockchain/eth/sol_source/contracts/proxy/pics/Dispatcher2.png similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Dispatcher2.png rename to nkms/blockchain/eth/sol_source/contracts/proxy/pics/Dispatcher2.png diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Dispatcher3.png b/nkms/blockchain/eth/sol_source/contracts/proxy/pics/Dispatcher3.png similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Dispatcher3.png rename to nkms/blockchain/eth/sol_source/contracts/proxy/pics/Dispatcher3.png diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Hard-fork.png b/nkms/blockchain/eth/sol_source/contracts/proxy/pics/Hard-fork.png similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Hard-fork.png rename to nkms/blockchain/eth/sol_source/contracts/proxy/pics/Hard-fork.png diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Hard-fork2.png b/nkms/blockchain/eth/sol_source/contracts/proxy/pics/Hard-fork2.png similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Hard-fork2.png rename to nkms/blockchain/eth/sol_source/contracts/proxy/pics/Hard-fork2.png diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Hard-fork3.png b/nkms/blockchain/eth/sol_source/contracts/proxy/pics/Hard-fork3.png similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/proxy/pics/Hard-fork3.png rename to nkms/blockchain/eth/sol_source/contracts/proxy/pics/Hard-fork3.png diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/math/Math.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/math/Math.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/math/Math.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/math/Math.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/math/SafeMath.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/math/SafeMath.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/math/SafeMath.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/math/SafeMath.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/ownership/Ownable.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/ownership/Ownable.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/ownership/Ownable.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/ownership/Ownable.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/BasicToken.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/BasicToken.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/BasicToken.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/BasicToken.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/BurnableToken.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/BurnableToken.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/BurnableToken.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/BurnableToken.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/DetailedERC20.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/DetailedERC20.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/DetailedERC20.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/DetailedERC20.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/ERC20.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/ERC20.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/ERC20.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/ERC20.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/ERC20Basic.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/ERC20Basic.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/ERC20Basic.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/ERC20Basic.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/SafeERC20.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/SafeERC20.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/SafeERC20.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/SafeERC20.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/StandardToken.sol b/nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/StandardToken.sol similarity index 100% rename from nkms/blockchain/eth/nkms_eth/project/contracts/zeppelin/token/ERC20/StandardToken.sol rename to nkms/blockchain/eth/sol_source/contracts/zeppelin/token/ERC20/StandardToken.sol diff --git a/nkms/blockchain/eth/nkms_eth/project/project.json b/nkms/blockchain/eth/sol_source/project.json similarity index 98% rename from nkms/blockchain/eth/nkms_eth/project/project.json rename to nkms/blockchain/eth/sol_source/project.json index 017f5f0f5..18a33c90f 100644 --- a/nkms/blockchain/eth/nkms_eth/project/project.json +++ b/nkms/blockchain/eth/sol_source/project.json @@ -126,7 +126,7 @@ "../../tests/contracts" ], "import_remappings": [ - "contracts=nkms_eth/project/contracts" + "contracts=nkms/blockchain/eth/sol_source/contracts" ], "backend": { "settings": { diff --git a/nkms/blockchain/eth/nkms_eth/utilities.py b/nkms/blockchain/eth/utilities.py similarity index 88% rename from nkms/blockchain/eth/nkms_eth/utilities.py rename to nkms/blockchain/eth/utilities.py index 8e2af31c5..bc5b60467 100644 --- a/nkms/blockchain/eth/nkms_eth/utilities.py +++ b/nkms/blockchain/eth/utilities.py @@ -1,11 +1,11 @@ import random from typing import List -from nkms_eth.actors import Miner -from nkms_eth.agents import MinerAgent, EthereumContractAgent -from nkms_eth.blockchain import TheBlockchain -from nkms_eth.config import NuCypherMinerConfig -from nkms_eth.deployers import MinerEscrowDeployer, NuCypherKMSTokenDeployer +from nkms.blockchain.eth.actors import Miner +from nkms.blockchain.eth.agents import MinerAgent +from nkms.blockchain.eth.blockchain import TheBlockchain +from nkms.blockchain.eth.constants import NuCypherMinerConfig +from nkms.blockchain.eth.deployers import MinerEscrowDeployer, NuCypherKMSTokenDeployer class TesterBlockchain(TheBlockchain): diff --git a/nkms/blockchain/setup.py b/nkms/blockchain/setup.py deleted file mode 100644 index ff3611ae4..000000000 --- a/nkms/blockchain/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -from setuptools import setup, find_packages - -version = '0.1' - - -setup( - name="nkms_eth", - version=version, - package_data={'nkms_eth': [ - 'project/*', 'project/contracts/*', - 'project/contracts/lib/*', - 'project/contracts/zepellin/math/*', - 'project/contracts/zepellin/ownership/*', - 'project/contracts/zepellin/token/*']}, - include_package_data=True, - zip_safe=False, -) diff --git a/nkms/characters.py b/nkms/characters.py index ab8710484..cd9cd57cc 100644 --- a/nkms/characters.py +++ b/nkms/characters.py @@ -22,7 +22,7 @@ from nkms.network import blockchain_client from nkms.network.protocols import dht_value_splitter from nkms.network.server import NuCypherDHTServer, NuCypherSeedOnlyDHTServer, ProxyRESTServer -from nkms_eth.actors import PolicyAuthor +from nkms.blockchain.eth.actors import PolicyAuthor from umbral import pre from umbral.keys import UmbralPublicKey diff --git a/nkms/config/configs.py b/nkms/config/configs.py index c93217555..77aaad78e 100644 --- a/nkms/config/configs.py +++ b/nkms/config/configs.py @@ -1,7 +1,13 @@ import json import os +from abc import ABC from pathlib import Path +import maya +from os.path import join, dirname, abspath + +from nkms.blockchain import eth + _DEFAULT_CONFIGURATION_DIR = os.path.join(str(Path.home()), '.nucypher') @@ -9,18 +15,66 @@ class KMSConfigurationError(RuntimeError): pass +class BlockchainConfig(ABC): + pass + + +class EthereumConfig(BlockchainConfig): + __solididty_source_dir = join(dirname(abspath(eth.__file__)), 'sol_source') + __default_registrar_path = join(_DEFAULT_CONFIGURATION_DIR, 'registrar.json') + + def __init__(self, provider, registrar_path=None): + + self.provider = provider + + if registrar_path is None: + registrar_path = self.__default_registrar_path + self._registrar_path = registrar_path + + # Populus project config + # self._populus_project = populus.Project(self._project_dir) + # self.project.config['chains.mainnetrpc.contracts.backends.JSONFile.settings.file_path'] = self._registrar_path + + # @property + # def project(self): + # return self._populus_project + + class StakeConfig: + __minimum_stake_amount = 0 # TODO!!! + __minimum_stake_duration = 0 + def __init__(self, amount: int, periods: int, start_datetime): + + assert StakeConfig.validate_stake(amount, periods, start_datetime) self.amount = amount - self.periods = periods self.start = start_datetime + self.periods = periods + + @classmethod + def validate_stake(cls, amount: int, periods: int, start_datetime) -> bool: + rules = ( + (amount > cls.__minimum_stake_amount, 'Staking aount must be at least {min_amount}'), + (start_datetime < maya.now(), 'Start date/time must not be in the past.'), + (periods > cls.__minimum_stake_duration, 'Staking duration must be at least {}'.format(cls.__minimum_stake_duration)) + ) + + for rule, failure_message in rules: + if rule is False: + raise KMSConfigurationError(failure_message) + else: + return True class PolicyConfig: + __default_m = 6 # TODO!!! + __default_n = 10 + __default_gas_limit = 500000 + def __init__(self, default_m: int, default_n: int, gas_limit: int): - self.prefered_m = default_m - self.prefered_n = default_n - self.transaction_gas_limit = gas_limit + self.prefered_m = default_m or self.__default_m + self.prefered_n = default_n or self.__default_n + self.transaction_gas_limit = gas_limit or self.__default_gas_limit class NetworkConfig: @@ -40,10 +94,6 @@ class NetworkConfig: class KMSConfig: - - class KMSConfigurationError(RuntimeError): - pass - __default_configuration_root = _DEFAULT_CONFIGURATION_DIR __default_json_config_filepath = os.path.join(__default_configuration_root, 'conf.json') diff --git a/nkms/config/keys.py b/nkms/config/keys.py index 3e885f2a0..d2e474a9e 100644 --- a/nkms/config/keys.py +++ b/nkms/config/keys.py @@ -14,7 +14,7 @@ from web3.auto import w3 from nkms.config import utils from nkms.config.configs import _DEFAULT_CONFIGURATION_DIR, KMSConfigurationError -from nkms.config.utils import _parse_keyfile, _save_private_keyfile +from nkms.config.utils import parse_keyfile, save_private_keyfile from nkms.crypto.powers import SigningPower, EncryptingPower, CryptoPower w3.eth.enable_unaudited_features() diff --git a/nkms/config/utils.py b/nkms/config/utils.py index d6cbfc5b0..72794439e 100644 --- a/nkms/config/utils.py +++ b/nkms/config/utils.py @@ -2,11 +2,10 @@ import json import os import stat -from nkms.config.keys import KMSKeyring from .configs import _DEFAULT_CONFIGURATION_DIR, KMSConfigurationError -def _save_private_keyfile(keypath: str, key_data: dict) -> str: +def save_private_keyfile(keypath: str, key_data: dict) -> str: """ Creates a permissioned keyfile and save it to the local filesystem. The file must be created in this call, and will fail if the path exists. @@ -42,7 +41,7 @@ def _save_private_keyfile(keypath: str, key_data: dict) -> str: return output_path -def _parse_keyfile(keypath: str): +def parse_keyfile(keypath: str): """Parses a keyfile and returns key metadata as a dict.""" with open(keypath, 'r') as keyfile: diff --git a/nkms/policy/models.py b/nkms/policy/models.py index af60f1afc..816fbe54c 100644 --- a/nkms/policy/models.py +++ b/nkms/policy/models.py @@ -15,7 +15,7 @@ from nkms.crypto.powers import SigningPower from nkms.crypto.signature import Signature from nkms.crypto.splitters import key_splitter from bytestring_splitter import BytestringSplitter -from nkms_eth.policies import BlockchainArrangement +from nkms.blockchain.eth.policies import BlockchainArrangement from umbral.pre import Capsule from constant_sorrow import constants diff --git a/setup.py b/setup.py index dbbfe1b88..25433c066 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,7 @@ from setuptools import setup, find_packages +VERSION = '0.1' + INSTALL_REQUIRES = [ 'kademlia>=1.0', 'rpcudp>=3.0', @@ -22,12 +24,20 @@ TESTS_REQUIRE = [ LINKS = [ 'https://github.com/nucypher/kademlia/archive/kms-dependency.tar.gz#egg=kademlia-1.0', 'https://github.com/bmuller/rpcudp/archive/python3.5.tar.gz#egg=rpcudp-3.0.0', - ] +] setup(name='nkms', - version='0.1', + version=VERSION, description='NuCypher decentralized KMS', install_requires=INSTALL_REQUIRES, dependency_links=LINKS, extras_require={'testing': TESTS_REQUIRE}, - packages=find_packages()) + packages=find_packages(), + package_data={'nkms': [ + 'blockchain/eth/*', 'project/contracts/*', + 'blockchain/eth/sol_source/contracts/lib/*', + 'blockchain/eth/sol_source/contracts/zepellin/math/*', + 'blockchain/eth/sol_source/contracts/zepellin/ownership/*', + 'blockchain/eth/sol_source/contracts/zepellin/token/*']}, + include_package_data=True, +) diff --git a/nkms/blockchain/eth/tests/contracts/__init__.py b/tests/blockchain/__init__.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/__init__.py rename to tests/blockchain/__init__.py diff --git a/nkms/blockchain/eth/tests/entities/__init__.py b/tests/blockchain/eth/__init__.py similarity index 100% rename from nkms/blockchain/eth/tests/entities/__init__.py rename to tests/blockchain/eth/__init__.py diff --git a/nkms/blockchain/eth/tests/conftest.py b/tests/blockchain/eth/conftest.py similarity index 82% rename from nkms/blockchain/eth/tests/conftest.py rename to tests/blockchain/eth/conftest.py index d0f424eb7..67f3cf6dd 100644 --- a/nkms/blockchain/eth/tests/conftest.py +++ b/tests/blockchain/eth/conftest.py @@ -1,13 +1,13 @@ import pytest +from eth_tester import EthereumTester from web3 import Web3 from web3.providers.eth_tester import EthereumTesterProvider -from nkms_eth.agents import NuCypherKMSTokenAgent, MinerAgent, PolicyAgent -from nkms_eth.blockchain import TheBlockchain -from nkms_eth.config import EthereumConfig -from nkms_eth.deployers import PolicyManagerDeployer -from nkms_eth.utilities import TesterBlockchain, MockNuCypherKMSTokenDeployer, MockMinerEscrowDeployer, MockMinerAgent -from eth_tester import EthereumTester +from nkms.blockchain.eth.agents import NuCypherKMSTokenAgent, MinerAgent, PolicyAgent +from nkms.blockchain.eth.blockchain import TheBlockchain +from nkms.blockchain.eth.deployers import PolicyManagerDeployer +from nkms.blockchain.eth.utilities import TesterBlockchain, MockNuCypherKMSTokenDeployer, MockMinerEscrowDeployer +from nkms.config.configs import EthereumConfig @pytest.fixture(scope='session') diff --git a/nkms/blockchain/eth/tests/entities/test_deployers.py b/tests/blockchain/eth/contracts/__init__.py similarity index 100% rename from nkms/blockchain/eth/tests/entities/test_deployers.py rename to tests/blockchain/eth/contracts/__init__.py diff --git a/nkms/blockchain/eth/tests/contracts/contracts/IssuerBad.sol b/tests/blockchain/eth/contracts/contracts/IssuerBad.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/IssuerBad.sol rename to tests/blockchain/eth/contracts/contracts/IssuerBad.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/IssuerMock.sol b/tests/blockchain/eth/contracts/contracts/IssuerMock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/IssuerMock.sol rename to tests/blockchain/eth/contracts/contracts/IssuerMock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/IssuerV2Mock.sol b/tests/blockchain/eth/contracts/contracts/IssuerV2Mock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/IssuerV2Mock.sol rename to tests/blockchain/eth/contracts/contracts/IssuerV2Mock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/MinersEscrowBad.sol b/tests/blockchain/eth/contracts/contracts/MinersEscrowBad.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/MinersEscrowBad.sol rename to tests/blockchain/eth/contracts/contracts/MinersEscrowBad.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/MinersEscrowForPolicyMock.sol b/tests/blockchain/eth/contracts/contracts/MinersEscrowForPolicyMock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/MinersEscrowForPolicyMock.sol rename to tests/blockchain/eth/contracts/contracts/MinersEscrowForPolicyMock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/MinersEscrowForUserEscrowMock.sol b/tests/blockchain/eth/contracts/contracts/MinersEscrowForUserEscrowMock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/MinersEscrowForUserEscrowMock.sol rename to tests/blockchain/eth/contracts/contracts/MinersEscrowForUserEscrowMock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/MinersEscrowV2Mock.sol b/tests/blockchain/eth/contracts/contracts/MinersEscrowV2Mock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/MinersEscrowV2Mock.sol rename to tests/blockchain/eth/contracts/contracts/MinersEscrowV2Mock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/PolicyManagerBad.sol b/tests/blockchain/eth/contracts/contracts/PolicyManagerBad.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/PolicyManagerBad.sol rename to tests/blockchain/eth/contracts/contracts/PolicyManagerBad.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/PolicyManagerForMinersEscrowMock.sol b/tests/blockchain/eth/contracts/contracts/PolicyManagerForMinersEscrowMock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/PolicyManagerForMinersEscrowMock.sol rename to tests/blockchain/eth/contracts/contracts/PolicyManagerForMinersEscrowMock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/PolicyManagerForUserEscrowMock.sol b/tests/blockchain/eth/contracts/contracts/PolicyManagerForUserEscrowMock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/PolicyManagerForUserEscrowMock.sol rename to tests/blockchain/eth/contracts/contracts/PolicyManagerForUserEscrowMock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/PolicyMangerV2Mock.sol b/tests/blockchain/eth/contracts/contracts/PolicyMangerV2Mock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/PolicyMangerV2Mock.sol rename to tests/blockchain/eth/contracts/contracts/PolicyMangerV2Mock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/lib/LinkedListMock.sol b/tests/blockchain/eth/contracts/contracts/lib/LinkedListMock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/lib/LinkedListMock.sol rename to tests/blockchain/eth/contracts/contracts/lib/LinkedListMock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/ContracV2Bad.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContracV2Bad.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/ContracV2Bad.sol rename to tests/blockchain/eth/contracts/contracts/proxy/ContracV2Bad.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/ContractInterface.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContractInterface.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/ContractInterface.sol rename to tests/blockchain/eth/contracts/contracts/proxy/ContractInterface.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/ContractV1.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContractV1.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/ContractV1.sol rename to tests/blockchain/eth/contracts/contracts/proxy/ContractV1.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/ContractV2.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContractV2.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/ContractV2.sol rename to tests/blockchain/eth/contracts/contracts/proxy/ContractV2.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/ContractV3.sol b/tests/blockchain/eth/contracts/contracts/proxy/ContractV3.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/ContractV3.sol rename to tests/blockchain/eth/contracts/contracts/proxy/ContractV3.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/GovernmentBad.sol b/tests/blockchain/eth/contracts/contracts/proxy/GovernmentBad.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/GovernmentBad.sol rename to tests/blockchain/eth/contracts/contracts/proxy/GovernmentBad.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/GovernmentV2Mock.sol b/tests/blockchain/eth/contracts/contracts/proxy/GovernmentV2Mock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/GovernmentV2Mock.sol rename to tests/blockchain/eth/contracts/contracts/proxy/GovernmentV2Mock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/MinersEscrowV1Mock.sol b/tests/blockchain/eth/contracts/contracts/proxy/MinersEscrowV1Mock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/MinersEscrowV1Mock.sol rename to tests/blockchain/eth/contracts/contracts/proxy/MinersEscrowV1Mock.sol diff --git a/nkms/blockchain/eth/tests/contracts/contracts/proxy/PolicyManagerV1Mock.sol b/tests/blockchain/eth/contracts/contracts/proxy/PolicyManagerV1Mock.sol similarity index 100% rename from nkms/blockchain/eth/tests/contracts/contracts/proxy/PolicyManagerV1Mock.sol rename to tests/blockchain/eth/contracts/contracts/proxy/PolicyManagerV1Mock.sol diff --git a/nkms/blockchain/eth/tests/contracts/test_dispatcher.py b/tests/blockchain/eth/contracts/test_dispatcher.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_dispatcher.py rename to tests/blockchain/eth/contracts/test_dispatcher.py diff --git a/nkms/blockchain/eth/tests/contracts/test_government.py b/tests/blockchain/eth/contracts/test_government.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_government.py rename to tests/blockchain/eth/contracts/test_government.py diff --git a/nkms/blockchain/eth/tests/contracts/test_integration.py b/tests/blockchain/eth/contracts/test_integration.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_integration.py rename to tests/blockchain/eth/contracts/test_integration.py diff --git a/nkms/blockchain/eth/tests/contracts/test_issuer.py b/tests/blockchain/eth/contracts/test_issuer.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_issuer.py rename to tests/blockchain/eth/contracts/test_issuer.py diff --git a/nkms/blockchain/eth/tests/contracts/test_linked_list.py b/tests/blockchain/eth/contracts/test_linked_list.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_linked_list.py rename to tests/blockchain/eth/contracts/test_linked_list.py diff --git a/nkms/blockchain/eth/tests/contracts/test_miners_escrow.py b/tests/blockchain/eth/contracts/test_miners_escrow.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_miners_escrow.py rename to tests/blockchain/eth/contracts/test_miners_escrow.py diff --git a/nkms/blockchain/eth/tests/contracts/test_policy_manager.py b/tests/blockchain/eth/contracts/test_policy_manager.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_policy_manager.py rename to tests/blockchain/eth/contracts/test_policy_manager.py diff --git a/nkms/blockchain/eth/tests/contracts/test_token.py b/tests/blockchain/eth/contracts/test_token.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_token.py rename to tests/blockchain/eth/contracts/test_token.py diff --git a/nkms/blockchain/eth/tests/contracts/test_user_escrow.py b/tests/blockchain/eth/contracts/test_user_escrow.py similarity index 100% rename from nkms/blockchain/eth/tests/contracts/test_user_escrow.py rename to tests/blockchain/eth/contracts/test_user_escrow.py diff --git a/tests/blockchain/eth/entities/__init__.py b/tests/blockchain/eth/entities/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/nkms/blockchain/eth/tests/entities/test_actors.py b/tests/blockchain/eth/entities/test_actors.py similarity index 98% rename from nkms/blockchain/eth/tests/entities/test_actors.py rename to tests/blockchain/eth/entities/test_actors.py index dfcad3afc..e9074bb3e 100644 --- a/nkms/blockchain/eth/tests/entities/test_actors.py +++ b/tests/blockchain/eth/entities/test_actors.py @@ -3,8 +3,8 @@ import random import pytest -from nkms_eth.actors import Miner -from nkms_eth.agents import MinerAgent +from nkms.blockchain.eth.actors import Miner +from nkms.blockchain.eth.agents import MinerAgent def test_miner_locking_tokens(testerchain, mock_token_deployer, mock_miner_agent): diff --git a/nkms/blockchain/eth/tests/entities/test_agents.py b/tests/blockchain/eth/entities/test_agents.py similarity index 92% rename from nkms/blockchain/eth/tests/entities/test_agents.py rename to tests/blockchain/eth/entities/test_agents.py index e0bfdb7f4..223b0f98a 100644 --- a/nkms/blockchain/eth/tests/entities/test_agents.py +++ b/tests/blockchain/eth/entities/test_agents.py @@ -1,6 +1,6 @@ import pytest -from nkms_eth.utilities import MockNuCypherMinerConfig +from nkms.blockchain.eth.utilities import MockNuCypherMinerConfig M = 10 ** 6 diff --git a/tests/blockchain/eth/entities/test_deployers.py b/tests/blockchain/eth/entities/test_deployers.py new file mode 100644 index 000000000..e69de29bb diff --git a/nkms/blockchain/eth/tests/test_api.py b/tests/blockchain/eth/test_api.py similarity index 90% rename from nkms/blockchain/eth/tests/test_api.py rename to tests/blockchain/eth/test_api.py index 46df2e5d8..052b97c4c 100644 --- a/nkms/blockchain/eth/tests/test_api.py +++ b/tests/blockchain/eth/test_api.py @@ -1,8 +1,7 @@ -from populus.contracts.exceptions import NoKnownAddress from pytest import raises -from nkms_eth.agents import NuCypherKMSTokenAgent, MinerAgent -from nkms_eth.deployers import NuCypherKMSTokenDeployer, MinerEscrowDeployer, PolicyManagerDeployer +from nkms.blockchain.eth.agents import NuCypherKMSTokenAgent, MinerAgent +from nkms.blockchain.eth.deployers import NuCypherKMSTokenDeployer, MinerEscrowDeployer, PolicyManagerDeployer def test_token_deployer_and_agent(testerchain): diff --git a/nkms/blockchain/eth/tests/test_setup.py b/tests/blockchain/eth/test_setup.py similarity index 83% rename from nkms/blockchain/eth/tests/test_setup.py rename to tests/blockchain/eth/test_setup.py index b2ca0ac98..64b400e8e 100644 --- a/nkms/blockchain/eth/tests/test_setup.py +++ b/tests/blockchain/eth/test_setup.py @@ -1,7 +1,5 @@ from os.path import join, dirname, abspath - -import nkms_eth -from nkms_eth.deployers import NuCypherKMSTokenDeployer +from nkms.blockchain.eth.deployers import NuCypherKMSTokenDeployer def test_testerchain_creation(testerchain): @@ -14,7 +12,7 @@ def test_testerchain_creation(testerchain): def test_nucypher_populus_project(testerchain): - populus_project_dir = join(dirname(abspath(nkms_eth.__file__)), 'project') + populus_project_dir = join(dirname(abspath(nkms.blockchain.eth.__file__)), 'project') # Check that populus paths are set... diff --git a/tests/eth_fixtures.py b/tests/eth_fixtures.py index 3697226b2..d4e3a4014 100644 --- a/tests/eth_fixtures.py +++ b/tests/eth_fixtures.py @@ -1,8 +1,8 @@ import pytest -from nkms_eth import utilities as utils -from nkms_eth.blockchain import TheBlockchain -from nkms_eth.agents import NuCypherKMSTokenAgent, MinerAgent +from nkms.blockchain.eth import utilities as utils +from nkms.blockchain.eth.blockchain import TheBlockchain +from nkms.blockchain.eth.agents import NuCypherKMSTokenAgent, MinerAgent @pytest.fixture(scope='function') diff --git a/tests/network/test_network_actors.py b/tests/network/test_network_actors.py index cc26b328b..89f867d13 100644 --- a/tests/network/test_network_actors.py +++ b/tests/network/test_network_actors.py @@ -11,7 +11,7 @@ from nkms.network import blockchain_client from nkms.network.protocols import dht_value_splitter from tests.utilities import MockNetworkyStuff, EVENT_LOOP, URSULA_PORT, NUMBER_OF_URSULAS_IN_NETWORK -from nkms_eth.utilities import spawn_miners +from nkms.blockchain.eth.utilities import spawn_miners def test_all_ursulas_know_about_all_other_ursulas(ursulas):