rust format
This commit is contained in:
parent
ccb478c1f6
commit
cb362e9052
@ -160,7 +160,7 @@ impl Accountant {
|
|||||||
return match result {
|
return match result {
|
||||||
Ok(_) => Ok(()),
|
Ok(_) => Ok(()),
|
||||||
Err(_) => Err(AccountingError::BalanceUpdatedBeforeTransactionCompleted),
|
Err(_) => Err(AccountingError::BalanceUpdatedBeforeTransactionCompleted),
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn process_verified_transaction_credits(&self, tr: &Transaction) {
|
pub fn process_verified_transaction_credits(&self, tr: &Transaction) {
|
||||||
@ -181,10 +181,8 @@ impl Accountant {
|
|||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
self.process_verified_transaction_credits(tr);
|
self.process_verified_transaction_credits(tr);
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
|
||||||
Err(err) => {
|
|
||||||
Err(err)
|
|
||||||
}
|
}
|
||||||
|
Err(err) => Err(err),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,8 +777,8 @@ mod bench {
|
|||||||
let tr = Transaction::new(&mint.keypair(), rando0.pubkey(), 1_000, last_id);
|
let tr = Transaction::new(&mint.keypair(), rando0.pubkey(), 1_000, last_id);
|
||||||
// some of these will fail because balance updates before transaction completes
|
// some of these will fail because balance updates before transaction completes
|
||||||
match acc.process_verified_transaction(&tr) {
|
match acc.process_verified_transaction(&tr) {
|
||||||
Ok(_) => (),
|
Ok(_) => (),
|
||||||
Err(_) => *errors.lock().unwrap() += 1,
|
Err(_) => *errors.lock().unwrap() += 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
let rando1 = KeyPair::new();
|
let rando1 = KeyPair::new();
|
||||||
@ -810,7 +810,10 @@ mod bench {
|
|||||||
drop(skel.historian.sender);
|
drop(skel.historian.sender);
|
||||||
let entries: Vec<Entry> = skel.historian.receiver.iter().collect();
|
let entries: Vec<Entry> = skel.historian.receiver.iter().collect();
|
||||||
assert_eq!(entries.len(), 1);
|
assert_eq!(entries.len(), 1);
|
||||||
assert_eq!(entries[0].events.len() + *errors.lock().unwrap(), txs as usize);
|
assert_eq!(
|
||||||
|
entries[0].events.len() + *errors.lock().unwrap(),
|
||||||
|
txs as usize
|
||||||
|
);
|
||||||
|
|
||||||
println!("{} tps", tps);
|
println!("{} tps", tps);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user