First go at smart contracts

Needs lots of cleanup.
This commit is contained in:
Greg Fitzgerald
2018-03-10 22:00:27 -07:00
parent 8579795c40
commit f5f71a19b8
3 changed files with 76 additions and 99 deletions

View File

@@ -58,12 +58,15 @@ impl Mint {
mod tests {
use super::*;
use log::verify_slice;
use transaction::{Action, Plan};
#[test]
fn test_create_events() {
let mut events = Mint::new(100).create_events().into_iter();
if let Event::Transaction(tr) = events.next().unwrap() {
assert_eq!(tr.from, tr.plan.to());
if let Plan::Action(Action::Pay(payment)) = tr.plan {
assert_eq!(tr.from, payment.to);
}
}
assert_eq!(events.next(), None);
}