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
This commit is contained in:
Greg Fitzgerald
2018-03-09 16:16:29 -07:00
parent 209910299d
commit cc9f0788aa
8 changed files with 91 additions and 76 deletions

View File

@@ -61,10 +61,12 @@ impl Accountant {
// fields are the same. That entry should be treated as a deposit, not a
// transfer to oneself.
let entry1 = entries.next().unwrap();
acc.process_verified_event(&entry1.event, true).unwrap();
acc.process_verified_event(&entry1.events[0], true).unwrap();
for entry in entries {
acc.process_verified_event(&entry.event, false).unwrap();
for event in entry.events {
acc.process_verified_event(&event, false).unwrap();
}
}
acc
}