Rename Transfer to Transaction

struct names should be nouns
This commit is contained in:
Greg Fitzgerald
2018-03-06 11:54:45 -07:00
parent a2811842c8
commit 66bf889c39
8 changed files with 34 additions and 47 deletions

View File

@@ -1,6 +1,6 @@
//! A library for generating the chain's genesis block.
use event::{generate_keypair, get_pubkey, sign_transaction_data, Event, PublicKey, Transfer};
use event::{generate_keypair, get_pubkey, sign_transaction_data, Event, PublicKey, Transaction};
use log::{create_entries, hash, Entry, Sha256Hash};
use ring::rand::SystemRandom;
use ring::signature::Ed25519KeyPair;
@@ -56,7 +56,7 @@ impl Genesis {
let last_id = self.get_seed();
let from = self.get_pubkey();
let sig = sign_transaction_data(&data, &self.get_keypair(), to, &last_id);
Event::Transaction(Transfer {
Event::Transaction(Transaction {
from,
to: *to,
data,
@@ -93,7 +93,7 @@ mod tests {
fn test_create_events() {
let mut events = Genesis::new(100, vec![]).create_events().into_iter();
assert_eq!(events.next().unwrap(), Event::Tick);
if let Event::Transaction(Transfer { from, to, .. }) = events.next().unwrap() {
if let Event::Transaction(Transaction { from, to, .. }) = events.next().unwrap() {
assert_eq!(from, to);
} else {
assert!(false);