Method
new
(from: String, to: String,
amount: u64, fee: u64,
nonce: u64, sign: String)
Source from the content-addressed store, hash-verified
| 15 | |
| 16 | impl Transaction { |
| 17 | pub fn new(from: String, to: String, |
| 18 | amount: u64, fee: u64, |
| 19 | nonce: u64, sign: String) -> Self |
| 20 | { |
| 21 | let mut tx = Transaction { |
| 22 | nonce, |
| 23 | amount, |
| 24 | fee, |
| 25 | from, |
| 26 | to, |
| 27 | sign, |
| 28 | hash:"".to_string(), |
| 29 | }; |
| 30 | tx.set_hash(); |
| 31 | |
| 32 | tx |
| 33 | } |
| 34 | |
| 35 | pub fn set_hash(&mut self) { |
| 36 | let txs_ser = serialize(&self); |
Callers
nothing calls this directly
Tested by
no test coverage detected