Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
garious committed Jun 29, 2018
1 parent 4a8d971 commit 33cf5b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,16 +434,16 @@ impl Bank {
self.transaction_count.load(Ordering::Relaxed)
}

pub fn check_signature(&self, signature: &Signature) -> bool {
pub fn has_signature(&self, signature: &Signature) -> bool {
let last_ids_sigs = self.last_ids_sigs
.read()
.expect("'last_ids_sigs' read lock");
for (_hash, signatures) in last_ids_sigs.iter() {
if let Some(_sig) = signatures.get(signature) {
if signatures.contains(signature) {
return true;
}
}
return false;
false
}
}

Expand Down Expand Up @@ -634,13 +634,13 @@ mod tests {
}

#[test]
fn test_check_signature() {
fn test_has_signature() {
let mint = Mint::new(1);
let bank = Bank::new(&mint);
let sig = Signature::default();
bank.reserve_signature_with_last_id(&sig, &mint.last_id())
.expect("reserve signature");
assert!(bank.check_signature(&sig));
assert!(bank.has_signature(&sig));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/bin/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn main() -> io::Result<()> {
let id = if matches.opt_present("m") {
read_mint(matches.opt_str("m").unwrap())
} else {
println!("No mint found!");
eprintln!("No mint found!");
exit(1);
};

Expand Down
2 changes: 1 addition & 1 deletion src/request_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl RequestProcessor {
Some(rsp)
}
Request::GetSignature { signature } => {
let signature_status = self.bank.check_signature(&signature);
let signature_status = self.bank.has_signature(&signature);
let rsp = (Response::SignatureStatus { signature_status }, rsp_addr);
info!("Response::Signature {:?}", rsp);
Some(rsp)
Expand Down

0 comments on commit 33cf5b4

Please sign in to comment.