Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coffee #286

Merged
merged 239 commits into from Jul 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
6e751f6
Renames(mostly) NetworkyStuff to NetworkMiddleware.
KPrasch Jun 1, 2018
ff17d1f
Further integrate TokenActors and Characters with co-op scheme
KPrasch Jun 1, 2018
001cf45
Leave a future hook for custom solc compile error handling
KPrasch Jun 1, 2018
5859f0f
deprecate capabilities
KPrasch Jun 1, 2018
df6346c
Deprecates NuCypherDHT server, move to middleware module. Remove stal…
KPrasch Jun 1, 2018
32be47e
Use constant_sorrow conf singelton-style constants; eliminates consta…
KPrasch Jun 1, 2018
0f9ddb9
NucypherConfig actor entry point; Use remaining miner/token constants…
KPrasch Jun 1, 2018
7891588
Keep tests up-to-date; Create airdrop and deploy fixtures; Fix additi…
KPrasch Jun 1, 2018
8b59b9e
SolidityCompiler compile-time exception handling
KPrasch Jun 3, 2018
a41d6f4
Updates and document TokenActors
KPrasch Jun 4, 2018
d2f0b4a
Refreshes MinerEscrow's node datastore for use with dht_keys/ursula_id
KPrasch Jun 4, 2018
e87bbbf
Return blockchain interface and configuration values to Blockchain cl…
KPrasch Jun 4, 2018
1a56767
Renames ContractInterface to ControlCircumflex, as Blockchain Interfa…
KPrasch Jun 4, 2018
cc3aa2a
Pushes dht_server attachment down to Ursula, off others; Cleanup stal…
KPrasch Jun 4, 2018
10483cc
Refactor config classes for use alongside entities.
KPrasch Jun 4, 2018
550a8cc
Refactor Policy and Arrangement methods to play nice with the blockch…
KPrasch Jun 4, 2018
043e158
Start from_configuration classmethod strategy
KPrasch Jun 4, 2018
8a65ca1
Deprecated compadability fixtures, updates contract tests to testecha…
KPrasch Jun 4, 2018
078d39d
Update entity tests and utils to testerchain.interface api
KPrasch Jun 4, 2018
44952cd
Introduces blockchain network elemtns to higher-level character tests…
KPrasch Jun 4, 2018
e37de07
Begins deprecation of alice publishing Tmap to DHT; Post rebase cleanup.
KPrasch Jun 4, 2018
e57b65b
Moving Finnegan's Wake demo to make it more obvious.
jMyles Jun 4, 2018
8e86591
BlockchainArrangement inherits from Arrangement.
jMyles Jun 4, 2018
89c6ea5
Arrangement is now top-level. Removing deposit from most places.
jMyles Jun 4, 2018
a02a252
Style fixes.
jMyles Jun 4, 2018
196e2bc
ArrangementResponse never really made sense.
jMyles Jun 4, 2018
00d0e64
Goodbye nucypher_test_config.
jMyles Jun 4, 2018
8dc1a37
BlockchainPolicy now inherits from Policy.
jMyles Jun 4, 2018
8041527
Explicit inheritance to make sure Character gets its args and kwargs.…
jMyles Jun 5, 2018
9fdfec4
Ethereum address didn't work as a Kademlia Node ID without being dige…
jMyles Jun 5, 2018
7d8b07d
from_rest_url now needs Middleware. Sensible.
jMyles Jun 6, 2018
5328bda
Passing Alice's pubkey to verify CFrags in Finnegan's Wake demo.
jMyles Jun 6, 2018
8c360bb
Allowing explicit federated_only condition.
jMyles Jun 6, 2018
533874f
Freshening up SandboxNetworkMiddleware.
jMyles Jun 6, 2018
7ddb9f2
Some style and naming fixes.
jMyles Jun 6, 2018
37b32d5
Need to raise some kind of error if the response is a no-go.
jMyles Jun 6, 2018
8365719
Bob sets correctness keys right away in retrieve().
jMyles Jun 6, 2018
ea4c8e6
Logic for StrangerStamp scenario in keypair.
jMyles Jun 6, 2018
e6072e1
Some fixes pursuant to a recent refactor.
jMyles Jun 6, 2018
2c0a844
Need to set aside the ProxyRESTServer cooperative inheritance for the…
jMyles Jun 6, 2018
94d94d3
Additional deprecation of alice DHT usage.
KPrasch Jun 4, 2018
e2eb556
Middleware -> RestMiddleware
KPrasch Jun 6, 2018
4af2037
Decouple blockchain operations, expand Policy and Arrangement types.
KPrasch Jun 6, 2018
a0681c7
Include miner datastore in Miner's init and cache it.
KPrasch Jun 7, 2018
820f41b
Blockchain make arrangement lock periods, and consideration
KPrasch Jun 7, 2018
31f07e9
Subclass UmbralPrivate key, Use Umbral keys to make test accounts.
KPrasch Jun 7, 2018
1fc9965
Locate selected ursulas from known nodes.
KPrasch Jun 7, 2018
db5856f
Lazify reading the miners contract datastore with a cached iterator.
KPrasch Jun 7, 2018
616a300
Update miner contract datastore tests with caching ability
KPrasch Jun 7, 2018
c185784
Update actor tests with testerchain renaming.
KPrasch Jun 8, 2018
7a35c4b
Hack together MockRestMiddleware, temp fix until implementing node le…
KPrasch Jun 10, 2018
8bc795e
Agent validation and self-awareness, and documentation.
KPrasch Jun 10, 2018
3045f1f
Thins PolicyAuthor, recruit mutates itself, for uptake by node learni…
KPrasch Jun 10, 2018
4016a8c
known node_id routing, for dual-dict node storage, will populate with…
KPrasch Jun 10, 2018
0b41efc
Attach the dht_server for bobs, and miners.
KPrasch Jun 10, 2018
c442d1c
Make miner contract datastore methods private
KPrasch Jun 10, 2018
27ffc55
Updates tests and utilities with blockchain-representable characters
KPrasch Jun 10, 2018
a9031f6
Refactors cached node values into properties, and lazy evaluation.
KPrasch Jun 11, 2018
fd58fc2
Datetime to Periods utility methods
KPrasch Jun 11, 2018
52148cf
Use property interface to manage staking and stake state.
KPrasch Jun 11, 2018
7566fad
Make public staking method more dynamic, taking a MayaDT as an expira…
KPrasch Jun 11, 2018
1896da5
Thin TokenActors - use soley agents for contract method execution.
KPrasch Jun 11, 2018
0528d14
Relocates and adds miner contract API to ContractAgents, from whence …
KPrasch Jun 11, 2018
ba2089a
PolicyManager contract API methods on its agent. update on Blockchain…
KPrasch Jun 11, 2018
c4e52e3
Fix constants imports, rethink some private names.
KPrasch Jun 11, 2018
5666d54
Require a deployer address parameter for deployer objects; remove def…
KPrasch Jun 11, 2018
1133faa
Update node contract datastore tests
KPrasch Jun 11, 2018
c754256
Fixes miner entity test failure, multi-path fixture resolution issues
KPrasch Jun 11, 2018
57975f7
Keep tests up-to-date; Create convention for test accounts, adds mine…
KPrasch Jun 11, 2018
9981847
draft miner divide stake public method
KPrasch Jun 11, 2018
8595355
Using index of stake in the divideStake method in the contract
Jun 13, 2018
9e7eb8a
Fixed calculation of delta periods
Jun 13, 2018
eccef48
Fixes stake division for the actors and agents
Jun 14, 2018
b02fd02
Update Travis config to use Pipfile.lock
KPrasch Jun 13, 2018
e5517fe
Draft of make_arrangements, with consideration to node learning
KPrasch Jun 13, 2018
132f45a
Split make arrangements into three methods; Refactor selection.
KPrasch Jun 13, 2018
769b82f
Make second attempt at consideration.
KPrasch Jun 13, 2018
e388a61
Remove old test script
KPrasch Jun 14, 2018
b3e6ca2
Deprecate stale switchLock method
KPrasch Jun 14, 2018
9a42ba8
Decorator for enforcing actor ownership.
KPrasch Jun 14, 2018
bdbef9b
Deprecate node contract datastore client methods
KPrasch Jun 15, 2018
9c0244c
Some style fixes.
jMyles Jun 14, 2018
eae14ed
Allowing known_nodes to be passed into Character to reflect "initiall…
jMyles Jun 14, 2018
8dca6d2
Unifying known_node interfaces.
jMyles Jun 14, 2018
8c9bb38
The learning loop.
jMyles Jun 14, 2018
0c7646f
Working known_nodes into fixtures and tests.
jMyles Jun 14, 2018
36b86eb
Implementing InterfaceInfo.
jMyles Jun 14, 2018
e4253b6
Including Ursula ether address as part of public information.
jMyles Jun 14, 2018
2999110
Removes minerIds and datastore
Jun 14, 2018
f1b5f70
Fixed script to estimate gas usage
Jun 15, 2018
e013989
Improved the sample method in MinersEscrow and in agent. Some refacto…
Jun 16, 2018
f6736da
Reduces size of variables in contracts
Jun 17, 2018
944a9db
Added constant for policy id length, fixed descriptions of some methods
Jun 20, 2018
f785394
Remove stale dht publication method.
KPrasch Jun 20, 2018
23dd5fe
Calculating duration (in periods) from expiration (MayaDT). Also, se…
jMyles Jun 17, 2018
5b74e7e
These Arrangements are already in their respective bucket; no need to…
jMyles Jun 17, 2018
d1b90f2
_known_nodes are by public address now.
jMyles Jun 17, 2018
a338d52
Property / setter logic for public_address.
jMyles Jun 17, 2018
4a1c208
Don't need ot pass db name again; it's already defined on the Policy.
jMyles Jun 17, 2018
e867f49
New splitting logic for Arrangement; including ether address.
jMyles Jun 17, 2018
6b0e3cf
We don't even use MockTokenAgent anymore.
jMyles Jun 17, 2018
6e3814c
token_airdrop as a utility function.
jMyles Jun 17, 2018
b2e5d99
Evolved tests and fixtures. Mocking some blockchain logic and discov…
jMyles Jun 17, 2018
126adcc
Using public address as bytes (instead of strictly casting ether addr…
jMyles Jun 20, 2018
d739bc6
Shipping splitter for public information with ProxyRestServer.
jMyles Jun 20, 2018
1bbaf2c
Proper error for scenario where, in the middle of a run, we can't fin…
jMyles Jun 21, 2018
bc1c89c
Logic for getting periods from expiration is now Blockchain-only.
jMyles Jun 23, 2018
97d1abc
Now composing Arrangement class object on Policy subclass in order to…
jMyles Jun 23, 2018
f5f6ef0
Moving _consider_arrangements up to Policy.
jMyles Jun 23, 2018
1d42a79
publish() for Federated logic.
jMyles Jun 23, 2018
fb1bc83
public_address logic for either federated or decentralized mode.
jMyles Jun 23, 2018
e7375e0
Removing is_federated and using federated_only instead.
jMyles Jun 23, 2018
323c8c2
Moving node shuffling logic up to its own method.
jMyles Jun 23, 2018
a3fa74e
Using known_nodes for FederatedPolicy.
jMyles Jun 23, 2018
d932c18
Taking ursulas in grant to pass to make_arrangements.
jMyles Jun 23, 2018
6fc2777
We don't need to separately publish the TreasureMap; that happens in …
jMyles Jun 23, 2018
766acca
known_nodes is now private _known_nodes.
jMyles Jun 23, 2018
73702e9
Passing value into Arrangement. Turning buckets into sets.
jMyles Jun 23, 2018
a2bf097
Adding Alice's signature to ID for TreasureMap. A tiny morsel of #172.
jMyles Jun 23, 2018
5941808
Fixing KFrag attachment loop.
jMyles Jun 23, 2018
03acf82
Passing middleware into Policy.publish()
jMyles Jun 23, 2018
2d9d25a
Using token airdrop and dropping MockTokenAgent.
jMyles Jun 23, 2018
742a00e
Deprecating testerchain in favor of three_agents. Using three_agents…
jMyles Jun 23, 2018
fb87472
Totally new logic for test_grant for federated case.
jMyles Jun 23, 2018
cced065
Catching tests up with federated logic.
jMyles Jun 23, 2018
edba3a3
Using to_canonical_address instead of unhexlify.
jMyles Jun 23, 2018
5985e72
A couple of cleanups pursuant to comments on the PR.
jMyles Jun 23, 2018
fc5d3d2
Merge pull request #318 from jMyles/learning-loop
KPrasch Jun 25, 2018
923efde
Split-up coverage reporting, add new pipenv support
KPrasch Jun 25, 2018
df9953e
add coveragrc
KPrasch Jun 25, 2018
8328d91
Remove coverage reporting for solidity code
KPrasch Jun 25, 2018
0a1a89f
Correct Pipfile inline table usage
KPrasch Jun 26, 2018
c185f66
Merge pull request #330 from KPrasch/builds
tuxxy Jun 26, 2018
b7215a6
Build out BlockchainPower with unlock_account method
tuxxy Jun 21, 2018
5ca7bb8
Add sign_message method
tuxxy Jun 21, 2018
91314b4
Add sign and verify methods to the ControlCircumflex
tuxxy Jun 26, 2018
c2408ed
Add __del__ to BlockchainPower
tuxxy Jun 23, 2018
3a9d362
Make call_backend_verify use eth_keys objects
tuxxy Jun 24, 2018
93303b9
Add verify_message to BlockchainPower
tuxxy Jun 24, 2018
9696821
Add test for BlockchainPower
tuxxy Jun 24, 2018
8a3b22e
Merge pull request #327 from tuxxy/lindas-in-custody
KPrasch Jun 26, 2018
a76dfa0
Add enroll_dispatcher method in the registrar
tuxxy Jun 15, 2018
7f79a4a
Make contract_name and target_addr optional arguments for dispatcher …
tuxxy Jun 15, 2018
41a533c
Have lookup_contract search better
tuxxy Jun 16, 2018
477d161
Build new Registry and refactor registrar -> registry
tuxxy Jun 16, 2018
eb9e841
Enable search method to return contracts with same name
tuxxy Jun 16, 2018
fd86579
Fix registry syntax and import errors.
KPrasch Jun 20, 2018
d56611f
Deployment sanity check for inter-contract deps.
KPrasch Jun 20, 2018
c2be534
Refactor registry usage, erorr handling, first pass.
KPrasch Jun 20, 2018
f3d6c40
Refactor registry tests for proxy contracts.
KPrasch Jun 20, 2018
4107b7b
Modify agents to use proxy contracts.
KPrasch Jun 20, 2018
6807ac0
Reorganize blockchain tests, remove stale test modules.
KPrasch Jun 23, 2018
cf5bef9
Dehydrate contract names; code style fixes.
KPrasch Jun 23, 2018
eb55117
Prepares flattened contract registry for integration with circumflex.
KPrasch Jun 23, 2018
c3970eb
Read live dispatcher target values from blockchain with registrar
KPrasch Jun 23, 2018
4c69809
Keep fixtures up to date with registry changes; Deprecate or relocate…
KPrasch Jun 23, 2018
8204351
Integrate three agents with existing fixtures, restore token airdrop …
KPrasch Jun 23, 2018
54d939c
Allow creation of 'bare' ursula in utils.
KPrasch Jun 25, 2018
6b003cd
Update contract test build configuration with more containers; update…
KPrasch Jun 23, 2018
e96e5fc
Respond to request for changes.
KPrasch Jun 25, 2018
2887726
Update gas estimation script to agent API
KPrasch Jun 23, 2018
e8ecfad
Merge pull request #328 from KPrasch/registrar-dev
KPrasch Jun 27, 2018
883555b
Remove version specifications from Pipfile
KPrasch Jun 27, 2018
e49c594
Remove travis yml
KPrasch Jun 27, 2018
ef69c62
Remove geth fixtures... for now.
KPrasch Jun 27, 2018
8b1897b
Include solc install script in pipenv run commands; Remove geth deps
KPrasch Jun 27, 2018
e532c57
circleci: use custom solc binary install command
KPrasch Jun 27, 2018
99b47a5
Consolidate scripts, insert pre-commit hook installation command
KPrasch Jun 27, 2018
141fef4
Simplify repeated config logic; rename / reorg jobs.
KPrasch Jun 27, 2018
4bccd65
remove pipenv hook installation
KPrasch Jun 27, 2018
ba631e6
Add mypy build to circleci; Use workflow ID number as dep cache key
KPrasch Jun 27, 2018
df6edd4
Add output to precommit hook + better name
KPrasch Jun 28, 2018
ec9704a
Add mypy.ini configuration
KPrasch Jun 28, 2018
d4a9779
Merge pull request #336 from KPrasch/coffee
KPrasch Jun 29, 2018
e665345
Store test Results; Upgrade Web3
KPrasch Jun 30, 2018
5a1cb8e
ether_address is now private _ether_address. canonical_public_addres…
jMyles Jun 25, 2018
bffba51
Reordering init elements so that learning works.
jMyles Jun 27, 2018
577c7d6
Adding listeners interface and blocking mode to wait until nodes are …
jMyles Jun 27, 2018
6cbcaf2
New Learning Loop features in Character.__init__: K:V storage are dic…
jMyles Jun 30, 2018
59bb6d5
Characters from_public_keys are now allowed to be federated_only
jMyles Jun 30, 2018
36d85d5
Marking other areas where #340 is important.
jMyles Jun 30, 2018
df9f7b7
Errors in the learning loop are now raised on the main thread in tests.
jMyles Jun 30, 2018
590c4db
Learning Loop eagerness now defaults to False, with a sanity check. …
jMyles Jun 30, 2018
16309ee
Shifted splitting logic down to Ursula. See #172.
jMyles Jun 30, 2018
d819c9f
Some ground rules for decentralized mode and public address.
jMyles Jun 30, 2018
90c0044
There's really no point to specifying REST details - if you want to l…
jMyles Jun 30, 2018
aab0e40
Cleaning up some uses of deprecated fixtures.
jMyles Jun 30, 2018
d49de7a
Lower-level TreasureMap interaction: Bob just takes a quick peek.
jMyles Jun 30, 2018
5b094c5
All new TreasureMap logic.
jMyles Jun 30, 2018
364d39d
All serialization, splitting, and verification for nodes now lives on…
jMyles Jun 30, 2018
cc38161
No more need to determine legality here in protocol - the objects can…
jMyles Jun 30, 2018
00286e0
No more node storage for DHT. Fixes #227.
jMyles Jun 30, 2018
4c0f200
Final compartmentalization of serialization logic. Fixes #172.
jMyles Jun 30, 2018
a761c3f
Logic for storing Ursulas and TreasureMaps. See #331 and #340.
jMyles Jun 30, 2018
1c33532
Receiving / Providing TreasureMap endpoints now use internal verifica…
jMyles Jun 30, 2018
22065fd
Some cleanup on models following the big TreasureMap changes.
jMyles Jun 30, 2018
2776928
Fixing Bob up!
jMyles Jun 30, 2018
303b4df
More test touchups and fixture organization, in anticipation of #338.
jMyles Jun 30, 2018
cc5d6ef
Beginnings of Character serialization tests.
jMyles Jun 30, 2018
b60b078
Merge pull request #344 from KPrasch/ci-dev
tuxxy Jul 3, 2018
88d1f37
Merge pull request #329 from jMyles/learning-loop3
jMyles Jul 5, 2018
005ed4e
Map lookups are now by map ID instead of hrac. Also, fixing a typo a…
jMyles Jul 2, 2018
70b7443
Breaking treasure map lookup logic up into smaller methods.
jMyles Jul 2, 2018
023598c
Some reasonable renaming, but we'll get maps by ID soon and not use h…
jMyles Jul 2, 2018
5f94bc4
Let's compare TreasureMaps by bytes from now on.
jMyles Jul 2, 2018
bd215d9
Using three_agents for miner fixture.
jMyles Jul 2, 2018
bcc1593
Fixing up tests.
jMyles Jul 2, 2018
7cf5bbf
Fixed up args and kwargs for Character (although needs some organizat…
jMyles Jul 3, 2018
162c542
Combine and reorganize fixture modules
KPrasch Jun 29, 2018
a7cfaec
Passing checksum_address into NucypherTokenActor.
jMyles Jul 4, 2018
f2cfa5a
We really only need to fail when settin checksum_address on a federat…
jMyles Jul 4, 2018
40ff5e8
If a node is federated_only, then they can rightly regard other nodes…
jMyles Jul 4, 2018
2e96c16
Passing checksum_address where it's needed.
jMyles Jul 4, 2018
8f8b28f
Test fixups.
jMyles Jul 4, 2018
93039f9
Merge pull request #345 from jMyles/restoration
jMyles Jul 5, 2018
9f7c662
Draft of an upgradeable user escrow
Jun 24, 2018
ff71b58
Finished the upgradeable UserEscrow contract, contracts mocks are com…
Jun 26, 2018
5d7894e
Merge pull request #333 from szotov/user-escrow
jMyles Jul 10, 2018
8ef6cb8
Adding pytest-twisted to dev reqs.
jMyles Jul 4, 2018
52721c7
Character tests generate coverage for entire package.
jMyles Jul 4, 2018
72d0c8e
Commenting out MyPy check for the moment. See #350.
jMyles Jul 5, 2018
3d412cd
Quieter mypy options. See #350.
jMyles Jul 5, 2018
695e6dc
unlock_account on blockchain, to account for the apparent reality tha…
jMyles Jul 5, 2018
a1ca7d4
Using plain signature (instead of hex-casted) in BlockchainPower.
jMyles Jul 5, 2018
d7c7e06
Ursula now substantiates her stamp. This is the first half of #294.
jMyles Jul 5, 2018
eddcf0f
Test for stamp evidence.
jMyles Jul 5, 2018
9044ad8
Making build_dependencies use verbose output for pipenv.
jMyles Jul 5, 2018
7c46c69
Ticking cache version for CircleCI.
jMyles Jul 5, 2018
b479103
Smoothing out init args for Actors. Style fixes.
jMyles Jul 9, 2018
87a14b8
Moving SuspiciousActivity up to protocols so that it can be shared wi…
jMyles Jul 9, 2018
6625731
Going back to simply returning sampled miners.
jMyles Jul 10, 2018
f59d2ff
Adding federated flag to both Arrangements.
jMyles Jul 10, 2018
13e8c45
Moved node verification logic to a separate class.
jMyles Jul 10, 2018
d8a5a4a
Verification logic by public address. Fixes #353.
jMyles Jul 10, 2018
a88052c
Separating blockchain Alice from regular ole' Alice. Style touch-ups.
jMyles Jul 10, 2018
8045bc6
No reason to always_be_learning any more as a default. Some actors d…
jMyles Jul 10, 2018
39e6433
Passing bytes-in / bytes-out instead of eth_keys Signature object.
jMyles Jul 10, 2018
f781c37
Merge pull request #348 from jMyles/code-organization
jMyles Jul 10, 2018
53d2104
Merge pull request #351 from jMyles/matcha
KPrasch Jul 10, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
165 changes: 83 additions & 82 deletions .circleci/config.yml
Expand Up @@ -5,12 +5,12 @@ workflows:
test:
jobs:
- bundle_dependencies-36
- contract_unit:
# - mypy_type_check:
# requires:
# - bundle_dependencies-36
- eth_contract_unit:
requires:
- bundle_dependencies-36
- intercontract_integration:
requires:
- contract_unit
- crypto_unit:
requires:
- bundle_dependencies-36
Expand All @@ -20,140 +20,141 @@ workflows:
- keystore_unit:
requires:
- bundle_dependencies-36
- blockchain_client_unit:
- blockchain_interface_unit:
requires:
- bundle_dependencies-36
- character:
requires:
- crypto_unit
- network_unit
- keystore_unit
- intercontract_integration:
requires:
- eth_contract_unit

bundle_dependencies: &bundle_dependencies
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}
- run:
name: Install Pipenv itself
command: pip install pipenv --upgrade
- run:
name: Install Python dependencies with Pipenv
command: |
pipenv install --three --dev --skip-lock
- run:
name: Install Solidity compiler
command: |
wget "https://github.com/ethereum/solidity/releases/download/${SOLC_VER}/solc-static-linux" -O "$(pipenv --venv)/bin/solc"
chmod +x "$(pipenv --venv)/bin/solc"
environment:
SOLC_VER: "v0.4.24"
- save_cache:
paths:
- "~/.local/share/virtualenvs/"
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}

jobs:
bundle_dependencies-36:
<<: *bundle_dependencies
python_36_base: &python_36_base
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6

contract_unit:
parallelism: 3
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6
jobs:
bundle_dependencies-36:
<<: *python_36_base
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}
- run:
name: Ethereum Contract Unit Tests
name: Install Python Dependencies with Pipenv
command: |
pipenv run pytest --junitxml=./reports/pytest/eth-contract-unit-report.xml --cov=nucypher -v --runslow $(circleci tests glob tests/blockchain/eth/contracts/unit/test_*.py | circleci tests split --split-by=timings)
pipenv install --three --dev --pre --skip-lock --verbose
pipenv graph
- run:
name: Install Solidity Compiler
command: pipenv run install_solc
- save_cache:
paths:
- "~/.local/share/virtualenvs/"
key: v4-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}

blockchain_interface_unit:
<<: *python_36_base
steps:
- checkout
- restore_cache:
key: v4-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}
- run:
name: Blockchain Interface Tests
command: pipenv run pytest --cov=nucypher/blockchain/eth -v --runslow tests/blockchain/eth/interfaces tests/blockchain/eth/entities --junitxml=./reports/pytest/results.xml
- store_test_results:
path: ./reports/pytest/


intercontract_integration:
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6
eth_contract_unit:
<<: *python_36_base
parallelism: 4
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}
key: v4-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}
- run:
name: Ethereum Inter-Contract Integration Test
name: Ethereum Contract Unit Tests
command: |
pipenv run pytest --cov=nucypher -v --runslow tests/blockchain/eth/contracts/integration
pipenv run pytest --junitxml=./reports/pytest/eth-contract-unit-report.xml -v --runslow $(circleci tests glob tests/blockchain/eth/contracts/unit/test_*.py | circleci tests split --split-by=timings)
- store_test_results:
path: ~/nucypher-depends/timing-results/

path: ./reports/pytest/

crypto_unit:
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6
<<: *python_36_base
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}
key: v4-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}
- run:
name: Crypto Character Tests
command: |
pipenv run pytest --cov=nucypher -v --runslow tests/crypto
command: pipenv run pytest --cov=nucypher/crypto -v --runslow tests/crypto --junitxml=./reports/pytest/results.xml
- store_test_results:
path: ./reports/pytest/

network_unit:
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6
<<: *python_36_base
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}
key: v4-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}
- run:
name: Network Tests
command: |
pipenv run pytest --cov=nucypher -v --runslow tests/network
command: pipenv run pytest --cov=nucypher/network -v --runslow tests/network --junitxml=./reports/pytest/results.xml
- store_test_results:
path: ./reports/pytest/

keystore_unit:
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6
<<: *python_36_base
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}
key: v4-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}
- run:
name: Keystore Tests
command: |
pipenv run pytest --cov=nucypher -v --runslow tests/keystore
command: pipenv run pytest --cov=nucypher/keystore -v --runslow tests/keystore --junitxml=./reports/pytest/results.xml
- store_test_results:
path: ./reports/pytest/

character:
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6
<<: *python_36_base
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}
key: v4-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}
- run:
name: Character Tests
command: |
pipenv run pytest --cov=nucypher -v --runslow tests/characters
command: pipenv run pytest --cov=nucypher -v --runslow tests/characters --junitxml=./reports/pytest/results.xml
- store_test_results:
path: ./reports/pytest/

blockchain_client_unit:
working_directory: ~/nucypher-depends
docker:
- image: circleci/python:3.6
intercontract_integration:
<<: *python_36_base
steps:
- checkout
- restore_cache:
key: deps-{{ .Branch }}-{{ checksum "Pipfile" }}
key: v4-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}
- run:
name: Blockchain Client Tests
name: Ethereum Inter-Contract Integration Test
command: |
pipenv run pytest --cov=nucypher -v --runslow tests/blockchain/eth/client
pipenv run pytest -v --runslow tests/blockchain/eth/contracts/integration --junitxml=./reports/pytest/results.xml
- store_test_results:
path: ./reports/pytest/
#
# mypy_type_check:
# <<: *python_36_base
# steps:
# - checkout
# - restore_cache:
# key: v3-deps-{{ .Environment.CIRCLE_WORKFLOW_ID }}-{{ checksum "Pipfile" }}
# - run:
# name: Run Mypy Static Type Checks
# command: |
# mkdir ./mypy_reports ./mypy_results
# export MYPYPATH=./nucypher
# pipenv run mypy ./nucypher --config-file=mypy.ini --xslt-html-report ./mypy_reports/html/ --linecount-report ./mypy_reports/linecount --junit-xml ./mypy_results/results.xml
# - store_artifacts:
# path: ./mypy_reports
# - store_test_results:
# path: ./mypy_results
4 changes: 4 additions & 0 deletions .coveragerc
@@ -0,0 +1,4 @@
[run]
omit =
setup.py,
*__init__.py
38 changes: 19 additions & 19 deletions Pipfile
Expand Up @@ -3,42 +3,42 @@ url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]
# Wheels for cryptography until the next release.
cryptography35_linux = { file='./wheelhouse/cryptography-2.3.dev1-cp35-cp35m-linux_x86_64.whl', markers="python_version >= '3.5' and python_version < '3.6' and platform_system == 'Linux'"}
cryptography36_linux = { file='./wheelhouse/cryptography-2.3.dev1-cp36-cp36m-linux_x86_64.whl', markers="python_version >= '3.6' and python_version < '3.7' and platform_system == 'Linux'"}
cryptography36_darwin = { file='./wheelhouse/cryptography-2.3.dev1-cp36-cp36m-macosx_10_13_x86_64.whl', markers="python_version >= '3.6' and python_version < '3.7' and platform_system == 'Darwin'"}

# Wheels for cryptography until the next release
cryptography35_linux = { path='./wheelhouse/cryptography-2.3.dev1-cp35-cp35m-linux_x86_64.whl', markers="python_version >= '3.5' and python_version < '3.6' and platform_system == 'Linux'"}
cryptography36_linux = { path='./wheelhouse/cryptography-2.3.dev1-cp36-cp36m-linux_x86_64.whl', markers="python_version >= '3.6' and python_version < '3.7' and platform_system == 'Linux'"}
cryptography36_darwin = { path='./wheelhouse/cryptography-2.3.dev1-cp36-cp36m-macosx_10_13_x86_64.whl', markers="python_version >= '3.6' and python_version < '3.7' and platform_system == 'Darwin'"}

rpcudp = {git = "https://github.com/nucypher/rpcudp", ref = "nucypher-depend"}
kademlia = {git = "https://github.com/nucypher/kademlia", ref = "nucypher-depend"}
PyNaCl = "*"
"pysha3" = "*"
bidict = "*"
py_ecc = "*"
SQLAlchemy = "*"
apistar = "*"
maya = "*"
pyumbral = {git = "https://github.com/nucypher/pyumbral.git", ref = "nucypher-depend"}
requests = "*"
maya = "*"
hendrix = "==3.0.0"
constantSorrow = {git = "https://github.com/nucypher/constantSorrow.git", ref = "nucypher-depend"}
bytestringSplitter = {git = "https://github.com/nucypher/byteStringSplitter.git", ref = "nucypher-depend"}
appdirs = "*"
web3 = "==4.3.0"
sqlalchemy = "*"
apistar = "*"
rpcudp = {git = "https://github.com/nucypher/rpcudp", ref = "nucypher-depend"}
kademlia = {git = "https://github.com/nucypher/kademlia", ref = "nucypher-depend"}
pynacl = "*"
pysha3 = "*"
py_ecc = "*"
pyumbral = {git = "https://github.com/nucypher/pyumbral.git", ref = "nucypher-depend"}
web3 = "==4.4.1"

[dev-packages]
pytest = "*"
mypy = "*"
pytest-mypy = "*"
pytest-twisted = "*"
codecov = "*"
coverage = "*"
pytest-cov = "*"
py-solc = "*"
py-evm = "==0.2.0a18"
eth-tester = "==0.1.0b26"
py-geth = "*"
eth-tester = "==0.1.0b28"

[pipenv]
allow_prereleases = true

[scripts]
install_solc = "scripts/install_solc.sh"
Expand Up @@ -6,22 +6,27 @@
import datetime
import sys

from examples.sandbox_resources import SandboxNetworkyStuff
from sandbox_resources import SandboxRestMiddleware
from nucypher.characters import Alice, Bob, Ursula
from nucypher.data_sources import DataSource
from nucypher.network.node import NetworkyStuff
import maya

# This is already running in another process.
URSULA = Ursula.from_rest_url(NetworkyStuff(), address="localhost", port=3601)
network_middleware = SandboxNetworkyStuff([URSULA])
from nucypher.network.middleware import RestMiddleware
from umbral.keys import UmbralPublicKey

URSULA = Ursula.from_rest_url(network_middleware=RestMiddleware(),
host="localhost",
port=3601)

network_middleware = SandboxRestMiddleware([URSULA])


#########
# Alice #
#########

ALICE = Alice(network_middleware=network_middleware)
ALICE = Alice(network_middleware=network_middleware, federated_only=True) # TODO: 289

# Here are our Policy details.
policy_end_datetime = maya.now() + datetime.timedelta(days=5)
Expand All @@ -40,7 +45,7 @@
expiration=policy_end_datetime)

# Alice puts her public key somewhere for Bob to find later...
alices_pubkey_saved_for_posterity = bytes(ALICE.stamp)
alices_pubkey_bytes_saved_for_posterity = bytes(ALICE.stamp)

# ...and then disappears from the internet.
del ALICE
Expand All @@ -57,7 +62,7 @@
# data shared on it.
# He needs a few piece of knowledge to do that.
BOB.join_policy(label, # The label - he needs to know what data he's after.
alices_pubkey_saved_for_posterity, # To verify the signature, he'll need Alice's public key.
alices_pubkey_bytes_saved_for_posterity, # To verify the signature, he'll need Alice's public key.
verify_sig=True, # And yes, he usually wants to verify that signature.
# He can also bootstrap himself onto the network more quickly
# by providing a list of known nodes at this time.
Expand Down Expand Up @@ -133,9 +138,10 @@

# Now Bob can retrieve the original message. He just needs the MessageKit
# and the DataSource which produced it.
alice_pubkey_restored_from_ancient_scroll = UmbralPublicKey.from_bytes(alices_pubkey_bytes_saved_for_posterity)
delivered_cleartext = BOB.retrieve(message_kit=message_kit,
data_source=datasource_as_understood_by_bob,
alice_pubkey_sig=alices_pubkey_saved_for_posterity)
alice_pubkey_sig=alice_pubkey_restored_from_ancient_scroll)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice


# We show that indeed this is the passage originally encrypted by the DataSource.
assert plaintext == delivered_cleartext
Expand Down
2 changes: 1 addition & 1 deletion examples/run_ursula_with_rest_and_dht_but_no_mining.py
Expand Up @@ -19,7 +19,7 @@

DB_NAME = "non-mining-proxy-node"

_URSULA = Ursula(dht_port=3501, rest_port=3601, ip_address="localhost", db_name=DB_NAME)
_URSULA = Ursula(dht_port=3501, rest_port=3601, ip_address="localhost", db_name=DB_NAME, federated_only=True)
_URSULA.dht_listen()

CURVE = ec.SECP256R1
Expand Down