85 Commits

Author SHA1 Message Date
Jackson Sandland
ef169a6652 94: source doc review 2018-03-30 10:43:38 -07:00
Greg Fitzgerald
b8cf5f9427 Fix transaction logging 2018-03-29 13:50:32 -06:00
Greg Fitzgerald
22f5985f1b Do request verification in parallel, and then process the verified requests 2018-03-29 13:18:08 -06:00
Greg Fitzgerald
55179101cd Add more documentation 2018-03-29 12:20:54 -06:00
Greg Fitzgerald
ddb21d151d Nightly rustfmt
Format code with the nightly version of rustfmt, which sorts imports.
2018-03-26 22:03:28 -06:00
Greg Fitzgerald
117ab0c141 Clippy review 2018-03-22 14:50:24 -06:00
Greg Fitzgerald
60524ad5f2 Clippy review 2018-03-22 14:38:06 -06:00
Greg Fitzgerald
383d445ba1 Clippy review 2018-03-22 14:15:29 -06:00
Greg Fitzgerald
8295cc11c0 Move JSON printing up the stack 2018-03-20 23:15:44 -06:00
Greg Fitzgerald
9a7cac1e07 Use the Entry API to remove the double lookup 2018-03-20 18:07:54 -06:00
Greg Fitzgerald
c584a25ec9 Move complete_transaction from method to function
So that we can hold separate mutable references to the pending queue
and the map of balances.
2018-03-20 17:47:57 -06:00
Greg Fitzgerald
4da89ac8a9 Cleanup naming 2018-03-20 16:53:41 -06:00
Greg Fitzgerald
f7032f7d9a Cleanup: replace bool retval with is_complete() method 2018-03-20 16:52:47 -06:00
Greg Fitzgerald
6be3d62d89 Remove Action from spending plans 2018-03-20 15:43:07 -06:00
Greg Fitzgerald
4379fabf16 PlanEvent -> Witness
The term used by the Simplicity smart contract language
2018-03-20 15:25:50 -06:00
Greg Fitzgerald
64af37e0cd logger -> recorder
Free up namespace for a traditional runtime logger.
2018-03-19 10:16:21 -06:00
Greg Fitzgerald
265f41887f asset -> tokens 2018-03-19 10:03:41 -06:00
Greg Fitzgerald
f4e0d1be58 Make conditions explicit in races
And boot recursive spending plans. That path required heap allocations.
Since we don't have a need for this generality right now, reduce the
language to the smallest one that can pass our test suite.
2018-03-17 20:43:05 -06:00
Greg Fitzgerald
e5bae0604b Specialize transaction assets to i64
Proof-of-history is generic, but now that we're using it entirely
for tokens, we can specialize the type and start doing more interesting
things than just Eq and Serialize operations.
2018-03-17 19:56:15 -06:00
Greg Fitzgerald
e7da083c31 Move spending plans to their own crate 2018-03-17 19:56:15 -06:00
Greg Fitzgerald
45765b625a Don't let users accidentally burn their funds either 2018-03-11 12:04:49 -06:00
Greg Fitzgerald
aa0a184ebe Ensure the server isn't passed a Plan that spends more than is bonded 2018-03-11 11:53:45 -06:00
Greg Fitzgerald
0eb3669fbf cleanup timestamp processing 2018-03-11 00:30:01 -07:00
Greg Fitzgerald
30449b6054 cleanup sig processing 2018-03-11 00:11:08 -07:00
Greg Fitzgerald
f5f71a19b8 First go at smart contracts
Needs lots of cleanup.
2018-03-10 22:00:48 -07:00
Greg Fitzgerald
9d77fd7eec Store only spending plans, not full transactions 2018-03-10 18:35:10 -07:00
Greg Fitzgerald
8c40d1bd72 Move spending endpoints into expressions 2018-03-10 17:41:18 -07:00
Greg Fitzgerald
7a0bc7d888 Move smart contract fields into their own struct 2018-03-10 16:55:39 -07:00
Greg Fitzgerald
49281b24e5 Move Tick out of Event
Every Entry is now a Tick and the entries contain events.
2018-03-09 17:22:17 -07:00
Greg Fitzgerald
cc9f0788aa Batch events
It's now a Tick that locks down event order. Before this change, the
event order would be locked down in the order the server sees it.

Fixes #59
Fixes #61
2018-03-09 16:16:33 -07:00
Greg Fitzgerald
8d17aed785 Process timestamps as they are added 2018-03-08 15:39:03 -07:00
Greg Fitzgerald
ad6665c8b6 Complete timestamp and signature transactions 2018-03-08 11:06:52 -07:00
Greg Fitzgerald
923162ae9d WIP: process timestamps 2018-03-08 10:19:54 -07:00
Greg Fitzgerald
dd2bd67049 Add a barebones test for transaction conditions 2018-03-08 08:58:34 -07:00
Greg Fitzgerald
e759bd1a99 Add conditions to the signature to reject duplicates 2018-03-08 08:18:34 -07:00
Greg Fitzgerald
94daf4cea4 Add Cancel and Timestamp events
Fixes #31, #34, #39
2018-03-08 08:17:34 -07:00
Greg Fitzgerald
2379792e0a Add DateTime and Cancel conditions
Fixes #32, #33
2018-03-08 08:17:08 -07:00
Greg Fitzgerald
5dd567deef Rename Genesis to Mint
Genesis is a story of creation. We should only use that term to
for the event log that bootstraps the system.
2018-03-07 17:08:15 -07:00
Greg Fitzgerald
491ba9da84 Add accessors to keypairs and signatures 2018-03-07 15:32:22 -07:00
Greg Fitzgerald
9834c251d0 Boot genesis block helper
Before this change, if you wanted to use a new Transaction
feature in the genesis block, you'd need to extend its
Creator object and associated methods.  With yesterday's
addtions to Transcation, it's now so easy to work with
Transactions directly that we can get rid of the middleman.

Also added a KeyPair type alias, so that ring could be easily swapped
out with a competing library, if needed.
2018-03-07 11:10:15 -07:00
Greg Fitzgerald
d1b6206858 Monomorphisize Entry and Event
Transaction turned out to be the only struct worth making generic.
2018-03-06 20:29:18 -07:00
Greg Fitzgerald
b725fdb093 Sha256Hash -> Hash
Because in Loom, there's just the one. Hopefully no worries that it
shares a name with std::Hash.
2018-03-06 17:40:01 -07:00
Greg Fitzgerald
1436bb1ff2 Move entry into its own module
Hmm, Logger doesn't depend on log.
2018-03-06 17:40:01 -07:00
Greg Fitzgerald
5a44c36b1f Move hash into its own module 2018-03-06 17:40:01 -07:00
Greg Fitzgerald
f09952f3d7 DRY up transaction signing
Cleanup the big mess I copy-pasted myself into.
2018-03-06 16:34:25 -07:00
Greg Fitzgerald
4376032e3a data -> asset
'data' is too vague.
2018-03-06 14:50:32 -07:00
Greg Fitzgerald
624c151ca2 Add signature module
Because things other than transactions can be signed.
2018-03-06 12:48:28 -07:00
Greg Fitzgerald
b019416518 Move verify into methods
A little overly-coupled to Serialize, but makes the code a lot tighter
2018-03-06 12:27:08 -07:00
Greg Fitzgerald
4fcd9e3bd6 Give Transaction its own module 2018-03-06 12:18:17 -07:00
Greg Fitzgerald
66bf889c39 Rename Transfer to Transaction
struct names should be nouns
2018-03-06 11:54:47 -07:00