Skip to content

Commit

Permalink
/
Browse files Browse the repository at this point in the history
  • Loading branch information
horacehoff committed Aug 31, 2024
1 parent 38c7daa commit 3130ea7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn _check_transaction_hash(username: &str, password: &str, uid: u128) -> boo
return true;
}
}
return false;
false
}

pub fn _get_user_balance(username: &str, password: &str, uid: u128) -> f64 {
Expand All @@ -26,19 +26,19 @@ pub fn _get_user_balance(username: &str, password: &str, uid: u128) -> f64 {
return user.balance;
}
}
return 0.0;
0.0
}

pub fn _check_transaction(username_sender: &str, password_sender: &str, uid_sender: u128, amount: f64) -> bool {
if _check_transaction_hash(username_sender, password_sender, uid_sender) {
// process transaction
if (_get_user_balance(username_sender, password_sender, uid_sender) - amount - TRANSACTION_FEE) >= 0.0 {
return true;
true
} else {
return false;
false
}
} else {
return false;
false
}
}

Expand Down

0 comments on commit 3130ea7

Please sign in to comment.