Commit Graph

719 Commits (5d70de739db55d5c8a0eff37c588d356cc4fca4a)

Author SHA1 Message Date
jMyles 5d70de739d More logic updates from Contract. 2017-12-14 20:34:30 -08:00
jMyles ef4cf13dc6 Special error for the scenario in which we have already contacted *too many* Ursulas. 2017-12-14 20:33:56 -08:00
jMyles 5ba1435c21 Moving TreasureMap to Policy (big one! :-) ) 2017-12-14 20:33:41 -08:00
jMyles 8be2c5cf4c Contract now gets updated wit REST payload instead of created anew (because Ursula has already saved it). 2017-12-14 20:33:12 -08:00
jMyles 775da4c670 Contract is identified by hrac. 2017-12-14 20:32:59 -08:00
jMyles 4927dec9e5 Ursula saves contract (although we'll want to do this in a datastore - see #127) 2017-12-14 20:32:22 -08:00
jMyles 567a9734fe Ursula saves KFrag from new Contract class. 2017-12-14 20:32:09 -08:00
jMyles 4e25a0ac04 Much better grant logic. 2017-12-14 20:31:54 -08:00
jMyles 791312c9d4 Method for finding Ursulas needs a rewrite (and, of course, later, to have the blockchain component plugged in). 2017-12-14 16:53:54 -08:00
jMyles 91d46aae6a TODOs around Ursula's Contract storage. 2017-12-14 16:53:44 -08:00
jMyles 2869e1e5e1 Contract takes an Alice directly now, rather than a Policy. 2017-12-14 16:53:20 -08:00
jMyles 2667d0c131 Rolling the remaining PolicyGroup / PolicyOffer details into Contract. 2017-12-14 16:52:58 -08:00
jMyles 0a9002893e For now, Ursula stores Contracts in a dict. 2017-12-14 16:52:36 -08:00
jMyles 0fd71bf07b Enact logic to reflect new Contract. 2017-12-14 12:50:12 -08:00
jMyles fdce4e089c HRAC logic moved to Policy. PolicyGroup is losing weight! :-) 2017-12-14 12:49:50 -08:00
jMyles 4bcec28347 Moving from_ursula (ie, "other end of the wire" logic) to Contract. 2017-12-14 12:49:14 -08:00
jMyles 346883524a Ursula reconstructs the Contract at the other end of the wire. 2017-12-14 12:46:36 -08:00
jMyles 1c677efb6a Moving the rest of the enact logic to Policy. 2017-12-14 12:15:36 -08:00
jMyles 54d593f536 Rethinking PolicyOffer more broadly - it's now a Contract, which is able to formulate its own payload. 2017-12-14 12:15:10 -08:00
jMyles 021f7a25d5 .enact() for Policy 2017-12-14 12:14:37 -08:00
jMyles f68bd91510 Policy ID is immaterial now. Closes #38 wontfix. 2017-12-14 11:40:46 -08:00
jMyles f5abf099af New find_n_ursulas method for Policy. 2017-12-14 11:40:23 -08:00
jMyles 56b2fab5bc Moving activate to PolicyOffer. 2017-12-14 11:40:09 -08:00
jMyles 5638af4e9e Eh, this exception has lived in the wrong place its whole life. 2017-12-14 11:39:38 -08:00
jMyles 1fb92890bb Making KFrag hashable; preparing to use it as a key in `_active_ursulas`. 2017-12-14 11:39:17 -08:00
jMyles c4135b520f Alice passes uri and kFrags to make a Policy. 2017-12-14 11:22:20 -08:00
jMyles 847a0e0e99 Policy now takes multiple kFrags and a URI as arguments. 2017-12-14 11:22:00 -08:00
jMyles f5a0db8603 Moving craft_offer to Policy. 2017-12-14 11:21:37 -08:00
jMyles 7f7139e24f Moving 'n' to Policy. 2017-12-14 11:21:16 -08:00
jMyles 8435ddccdf Alice now makes a Policy instead of a PolicyGroup. 2017-12-14 11:20:57 -08:00
jMyles 899049c3d7 Moved pFrag down to Policy; pFrag stand-in for PolicyGroup. 2017-12-14 10:49:15 -08:00
jMyles fcc3636934 Found a pFrag that escaped refactor. 2017-12-13 20:09:34 -08:00
jMyles ac10e6a3da Merge commit for various Policy and testing Work after PRs are merged. 2017-12-13 10:41:55 -08:00
jMyles 21c18ea5f8 Tests reflect publish_treasure_map living on PolicyGroup. 2017-12-13 10:33:34 -08:00
jMyles e891653fde With PolicyGroup logic simplified for Bob, we can reduce the scope of several fixtures. 2017-12-13 10:33:01 -08:00
jMyles 267647a07b Don't need TreasureMap setter anymore. 2017-12-13 10:32:44 -08:00
jMyles ff19d7f276 Payload has always incorrectly used the encrypted TreasureMap instead of ChallengePack - we didn't notice because we aren't doing challenges yet. 2017-12-13 10:32:10 -08:00
jMyles 38e692a526 Making it easier to get an hrac from outside PolicyGroup. 2017-12-13 10:31:31 -08:00
jMyles 6554df9c03 hash convenience method can just be static. 2017-12-13 10:31:15 -08:00
jMyles 9541aa8519 Bob can reconstitute a PolicyGroup before he has the PFrag; nothing wrong with that. 2017-12-13 10:30:47 -08:00
jMyles af969c3ff7 Bob now gets a TreasureMap from just an Alice and URI (not a PolicyGroup). 2017-12-13 10:30:08 -08:00
jMyles 44438e6a50 Moving publish_treasure_map down to PolicyGroup. 2017-12-13 10:29:21 -08:00
Justin Holmes aeed9e52f3
Merge pull request #144 from jMyles/policy
Bob no longer needs to store a PolicyGroup to generate WorkOrders.
2017-12-12 13:03:28 -08:00
Justin Holmes e7065eb88d
Merge pull request #143 from jMyles/character-crypto
grant - convenience method for creating and enacting a policy_group by Alice.
2017-12-12 10:39:45 -08:00
jMyles 3a1bab4b1d Fixed up tests to use hrac instead of PolicyGroup. 2017-12-11 17:03:47 -08:00
jMyles 451095326f Adding __len__ for TreausureMap (kinda surprised we got by without it until now). 2017-12-11 17:03:07 -08:00
jMyles df013d6a00 More replacements of PolicyGroup for the simple hrac. 2017-12-11 17:02:45 -08:00
jMyles cbae3d666e Lookup TreasureMap with provided hrac. It's a good idea to test this, but it's untested as yet. 2017-12-11 17:00:36 -08:00
jMyles 673620e721 Bob doesn't need a PolicyGroup to generate work orders; an hrac will do. 2017-12-11 16:58:40 -08:00
jMyles 588ee82d8e Store TreasureMap when finding from DHT. 2017-12-11 16:56:00 -08:00