Pipe all Claim constructors through a function

This commit is contained in:
Greg Fitzgerald
2018-03-02 10:58:43 -07:00
parent 8fe464cfa3
commit a0410c4677
5 changed files with 20 additions and 35 deletions

View File

@@ -11,11 +11,7 @@ fn create_log(hist: &Historian<Sha256Hash>) -> Result<(), SendError<Event<Sha256
sleep(Duration::from_millis(15));
let data = Sha256Hash::default();
let keypair = generate_keypair();
let event0 = Event::Claim {
to: get_pubkey(&keypair),
data,
sig: sign_serialized(&data, &keypair),
};
let event0 = Event::new_claim(get_pubkey(&keypair), data, sign_serialized(&data, &keypair));
hist.sender.send(event0)?;
sleep(Duration::from_millis(10));
Ok(())