Last active
March 4, 2021 15:25
-
-
Save harshvishu/737a500e03d48dab0a9d03025f7b26f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Creates a new transaction to go into the next mined Block | |
- Parameter sender: Address of the Sender | |
- Parameter recipient: Address of the Recipient | |
- Parameter amount: Amount | |
- returns: The index of the Block that will hold this transaction | |
*/ | |
pub fn new_transaction(&mut self, sender: String, recipient: String, amount: u64) -> u64 { | |
self.current_transactions | |
.push(Transaction::new(sender, recipient, amount)); | |
(self.current_transactions.len() - 1) as u64 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment