Commit Graph

2472 Commits (4057608e6817c450e3eaa5f2545a9c729dcb3ba1)

Author SHA1 Message Date
jMyles 21ed54097c We need to fetch the actual Ursula from the cache to get the bytestring; this will be a sprout nowadays. 2020-08-10 12:49:53 -07:00
jMyles 9f117ebc6a A Character created from blank config will try to connect to seednodes without lonely. 2020-08-10 12:49:26 -07:00
jMyles a3a21ff49e The number of known nodes might be a bit variable at this point; we're really concerned that he has only connected to 2. 2020-08-10 12:49:26 -07:00
jMyles a69705475a Fixing up fixtures to fail fast and delete Ursulas when done. 2020-08-10 12:49:26 -07:00
jMyles 4ffecd85fd Going back to defined ports in the hopes of working out #1546 / #1689. 2020-08-10 12:49:26 -07:00
jMyles 3db10ae5ff We're not connecting to seednodes at this stage anymore. 2020-08-10 12:49:26 -07:00
jMyles 98c63a2b54 Moving seednode loading logic inward. 2020-08-10 12:49:26 -07:00
jMyles e85acfccaa Moving hardcoded seednodes to middleware. 2020-08-10 12:49:26 -07:00
jMyles 858345a58f Getting --lonely through each Character where it's used. 2020-08-10 12:49:26 -07:00
jMyles c6e004b870 Allow other Characters to be --lonely. 2020-08-10 12:49:26 -07:00
jMyles 1101dd3bde The first node in the fixture might not always be among the matching nodes. 2020-08-10 12:49:26 -07:00
jMyles 645533421e If the port is too high, try again. Attempting to deal with #1546. 2020-08-10 12:49:26 -07:00
jMyles 76649704ae Clarifying failure message; this makes it easier to understand why this test occasionally fails. 2020-08-10 12:49:26 -07:00
jMyles 86b24373ac Setting checksum_address to staker address, and looking up TransactingPower in the usual (albeit private) way. 2020-08-10 12:49:26 -07:00
jMyles b199830947 This will be the basis of a merge commit in the rebase of these tests. One of them reactivates Vladimir; the other fixes the method for testing the presence of Treasure Maps. 2020-08-10 12:49:25 -07:00
jMyles babcd9174e No need to reset checksum_address in Worker - let's try to set it in as few places as possible. #1547. 2020-08-10 12:49:23 -07:00
jMyles 14165eb4db Instead of the first Ursula, choose the first Ursula who is supposed to have the map. 2020-08-10 12:48:31 -07:00
jMyles fdc69cd0ec Changing references to acumen materials. 2020-08-10 12:47:33 -07:00
jMyles 18993022ea Stop Alice's publication threadpool at the end of fixtures; otherwise tests hang. 2020-08-10 12:47:33 -07:00
jMyles 295518033e Refining both test and threadpooling. Looking pretty good now. 2020-08-10 12:45:22 -07:00
jMyles 230bcdc26d Honing in on the most important concurrent test assertions. This passes, but we can do even better. 2020-08-10 12:45:22 -07:00
jMyles 359980288d Cleaning up here results in faster test run exit. 2020-08-10 12:45:22 -07:00
jMyles f2b8daa1ff Putting the fake latency on either side of the endpoint gives slightly more realistic conditions. 2020-08-10 12:45:22 -07:00
jMyles c1cc0395e5 This zany test actually passes - now to get that 30 second limit down. 2020-08-10 12:45:22 -07:00
jMyles 05b589121b It's slow, but it's a start. This test passes in about 9 seconds right now; subsequent commits will tune it. 2020-08-10 12:45:22 -07:00
jMyles 60b9ad9c2b Test using the sluggish middleware; this is the one that will require the concurrency from the last commit. 2020-08-10 12:45:21 -07:00
jMyles 1923568166 What happens if we add a little slowness like network latency? (And here's where we'll have to add concurrency). 2020-08-10 12:42:17 -07:00
jMyles fc3e105e54 Decentralized Alice controller test needs, you guessed it, DecentralizedTreasureMap. 2020-08-10 12:42:17 -07:00
jMyles 8f248100ff Amonia needs to remember not to publish TreasureMaps, lest her gig being discovered too soon. 2020-08-10 12:42:17 -07:00
jMyles 1a20bbb151 Including a fake signature for the test. 2020-08-10 12:42:17 -07:00
jMyles 7a599d2c5c Evolving the test to show how Bob can find a map much more quickly. 2020-08-10 12:42:17 -07:00
jMyles 6d60c66ec2 Alice now proposes Arrangements; Ursula considers them. Fixes #1924. 2020-08-10 12:42:17 -07:00
jMyles 106b60f3f7 Mocking one layer out (setting policy) for these tests. 2020-08-10 12:42:15 -07:00
jMyles 3e9cf80386 Splitting test logic to show when the problem is with Bob or with Alice. 2020-08-10 12:39:59 -07:00
jMyles 5e494a9101 Vlad's APIs are consistent with the real deal again. 2020-08-10 12:39:59 -07:00
jMyles 45b9062257 Test showing that Vladimir's efforts at posting a nonsense TreasureMap will fail. 2020-08-10 12:39:59 -07:00
jMyles 358c219b3b Begining to test to show that blockchain signature prevents duplication. 2020-08-10 12:39:58 -07:00
tuxxy d033c0b318 Respond to review changes 2020-08-10 15:38:59 +02:00
tuxxy c6d229c2bf Fix typo in comment (thanks @fjarri) 2020-08-10 15:38:59 +02:00
tuxxy 530dc3439a Respond to change requests 2020-08-10 15:38:59 +02:00
tuxxy 71f8b914e0 Instead of mocking a LMDB env, we just manage them appropriately 2020-08-10 15:38:59 +02:00
tuxxy f5a7577290 Fix tests with new datastore changes
Use a unique temp directory for each blockchain_ursula and fix the flunky test query

Fix test_decentralized_grant test

Catch RecordNotFound errors in test_freerider_attacks

Provide a db_filepath for the test_collect_rewards_integration Ursula

Add unique temp directory for Ursula in test_collect_rewards_integration
2020-08-10 15:38:58 +02:00
tuxxy cced32aa71 Store Workorders under a random ID, and catch DatastoreTransactionError in revoke
Fix typo in __prune_arrangements and catch RecordNotFound

Fix typo in docstring for build_docs

Remove reference to old datastore in test_freerider_attacks
2020-08-10 15:38:13 +02:00
tuxxy b1817cc9f2 Remove Ursula.work_orders and replace its use with queries to the datastore 2020-08-10 15:38:13 +02:00
tuxxy 52038e36dc Create a MockLMDBEnv w/ fixture and fix up some tests
Patch the PolicyArrangement model to fix discovery phase tests
2020-08-10 15:38:12 +02:00
tuxxy 846625d917 Replace as much old datastore logic as possible 2020-08-10 15:37:30 +02:00
tuxxy 17920cd4ca Add 'DatastoreRecord.delete' method w/ tests
Remove the unused '_fields' instance var on DatastoreRecord
2020-08-10 15:37:30 +02:00
tuxxy 662fddbeb7 Add basic skeleton for 'Datastore.query_by' method with tests
Ensure that queries only iterate over keys and not values

Query will now only process keys for unique records
2020-08-10 15:37:30 +02:00
tuxxy cc0ca2ef91 Add a basic first implementation of the datastore with tests
Add tests for the datastore models, and change 'NotFound' to 'RecordNotFound'
2020-08-10 15:37:30 +02:00
tuxxy 184b3bf563 Create a base 'DatastoreRecord' class and models with tests
Move the base models to base.py and add more datastore tests
Change key structure to 'RecordType:RecordField:RecordID'
Eliminate the db module
2020-08-10 15:37:30 +02:00
David Núñez 7a043cb80a Unit tests for new Logger 2020-08-08 04:11:32 +02:00
David Núñez e438f2f944 Use our new Logger replacement everywhere 2020-08-08 03:14:45 +02:00
vzotova 1819d5a552 Solidity -> 0.7.0 2020-08-06 13:39:17 +03:00
David Núñez 3595f3dae6 Make restoration of default values conditional 2020-08-04 19:01:54 +02:00
David Núñez 460ce4cb08 Restore default return values in mock agents
Mock.reset_mock() doesn't do that by default so return values remained between test modules
2020-08-04 18:37:30 +02:00
Victoria 43718a49d5 Apply suggestions from code review #2142
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
Co-authored-by: David Núñez <david@nucypher.com>
2020-07-30 23:50:14 +03:00
vzotova f2acc2adda New command in CLI to increase value of specified sub-stake 2020-07-30 22:45:58 +03:00
vzotova 883f5350e4 Makes `Stake` validation stateless, new methods in `StakingEscrowAgent`, methods for increasing stake in `Staker` 2020-07-30 22:45:58 +03:00
vzotova 53674d7828 Changes `Stake` class to read-only representation of sub-stake 2020-07-30 22:45:57 +03:00
vzotova 091ca97e7d Fix bug in `StakingEscrow.mergeStake()` when using same index twice 2020-07-30 12:55:37 +03:00
David Núñez dadf3c81f6 Fix missing kwarg rename for NuCypherTokenAgent.approve_transfer() 2020-07-30 01:13:51 +02:00
jMyles 39f0dc4d6b Some more debug-level logs instead of prints. 2020-07-26 19:20:47 -07:00
Kieran R. Prasch be71b934d9 master -> main 2020-07-26 18:27:26 -07:00
jMyles 029da78b04 Much more leeway in the number of nodes that have the map when we unblock (as this varies widely just on my laptop, depending on what else I'm running in the background. 2020-07-26 17:59:16 -07:00
jMyles 50ddae77a1 Lots of Character stoppages; these continually running loops went unnoticed before. 2020-07-26 17:58:39 -07:00
jMyles d18b2e0834 Big fixup for the remaining errors blocking integration.learning. 2020-07-24 19:29:38 -07:00
jMyles 7bea1de3cf Tests were hanging. 2020-07-24 16:00:35 -07:00
jMyles ff044297b5 make_federated_ursulas gets called from a few places of varying depths in the stack - accounting for that. 2020-07-24 16:00:19 -07:00
jMyles ad05f4a09a This makes more sense, because you might block the main thread in a test, and then the Ursula can't process the request. 2020-07-22 16:18:29 -07:00
jMyles 9c577a5b96 Loading seednodes here is enough. 2020-07-22 16:17:49 -07:00
jMyles d06deba742 Some debugging breadcrumbs for Ursula. 2020-07-22 16:16:30 -07:00
jMyles 695c1c4bd8 Struggling with some ALreadyCalled issues - turning debugging on for the defer module gives some useful insight. 2020-07-22 16:15:48 -07:00
jMyles 1534bc07a9 Stopping Bob and Ursula at appropriate times. 2020-07-22 15:55:31 -07:00
jMyles 4a616d143d Flagging test bob's origins for inspection on other threads. 2020-07-22 15:55:31 -07:00
jMyles 4261743594 Adding cancellation to keep_learning logic. 2020-07-22 15:55:27 -07:00
David Núñez 001df65b3f Use the YES_ENTER constant in test_deploy 2020-07-21 22:26:00 +02:00
David Núñez b667a808b0 Test Issuer initialization with an owner different than the creator 2020-07-21 22:15:43 +02:00
David Núñez 76f0147602 Change approve token allowance flag from --approve to --allowance
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
2020-07-21 22:15:43 +02:00
David Núñez bd8692d6a4 Approve token allowances with `nucypher-deploy transfer-tokens --approve` 2020-07-21 22:15:43 +02:00
David Núñez e83a815e47 Improve TokenAgent's API and usage of approve_transfer and increase_allowance 2020-07-21 22:15:43 +02:00
David Núñez d1acf35002 Allow StakingEscrow initialization from a separate funding source
This is necessary to allow the DAO agent to activate the contract without necessarily giving tokens to the agent
2020-07-21 22:15:43 +02:00
David Núñez 56fd7394db Test that stakers can have positive balance before StakingEscrow initialization 2020-07-21 22:15:43 +02:00
Kieran R. Prasch 388ea2fc55 master -> main 2020-07-21 08:48:52 -07:00
jMyles 78abb8f6ed Yanking some autouses in favor of usefixtures. [skip ci] 2020-07-18 13:09:08 -07:00
jMyles 7e964fe4ec Stop Alice's publication threadpool in disenchant(). 2020-07-17 19:36:57 -07:00
Kieran R. Prasch 85806613f1 Allow worker to attempt period commitment as part of it's initialization. 2020-07-17 12:30:11 -07:00
jMyles 52a7bf3a8a Lookup transacting_power in the typical public way. 2020-07-16 19:56:39 -07:00
jMyles eaa6b94a49 Starting Bob's learning loop here (which is in keeping with reality) is needed now that we don't hardcode Bob's fixture nodes. 2020-07-16 19:56:39 -07:00
David Núñez f5bee795d8
Merge pull request #2121 from mswilkison/worklock-terminology
Update WorkLock terminology
2020-07-15 17:46:44 +02:00
Victoria e717b6d030 Apply suggestions from code review #2117
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>
Co-authored-by: K Prasch <kieran@nucypher.com>
Co-authored-by: David Núñez <david@nucypher.com>
2020-07-14 12:04:35 +03:00
jMyles 9ba8e1dd35 Lifecycle logic - shared in federated and blockchain modules. 2020-07-09 22:29:45 -07:00
jMyles 679022c42a Another test that was passing for the wrong reason. It now works regardless of whether the future Ursula is a hardcoded seednode or a user-specified one. 2020-07-09 22:26:10 -07:00
jMyles fe908a1e83 Add a measure of maturation time; if this increases dramatically, that will represent a breakage. 2020-07-09 22:25:23 -07:00
jMyles 86398eb43a Don't ship blockchain_bob with known_nodes; he can use his domain hardcoded nodes. Also, don't start his learning loop after the fact. This caused this test to pass even when he was unable to actually find the nodes in join_policy. 2020-07-09 20:42:27 -07:00
jMyles a7303702ab Skipping this test until we get the DB (#2099) worked out. 2020-07-09 20:40:41 -07:00
jMyles e20a7a3a7b Felix doesn't use a network domain. 2020-07-09 20:40:17 -07:00
jMyles fb119720b5 Divide cli lifecycle tests into federated and decentralized in order to keep Ursula cache separated. 2020-07-09 20:39:57 -07:00
vzotova 073cbf345e Refactor sub-stake status and selecting sub-stake 2020-07-09 16:33:25 +03:00
jMyles 8cf42aab03 Separating lifecycle tests for fixture hygiene. 2020-07-08 12:03:19 -07:00
David Núñez 10ef0a1d62 Rename WorkLock commands and options 2020-07-08 17:13:05 +02:00