()
| 3 | use core::transaction::Transaction; |
| 4 | |
| 5 | fn main() { |
| 6 | let mut user1 = Account::new("0xabcd".to_string(), "Kim".to_string()); |
| 7 | let mut user2 = Account::new("0xabce".to_string(), "Tom".to_string()); |
| 8 | let mut user3 = Account::new("0xabcf".to_string(), "Jim".to_string()); |
| 9 | |
| 10 | println!("-------------------------Mine Info----------------------------"); |
| 11 | let mut bc = BC::new(); |
| 12 | |
| 13 | let mut txs: Vec<Transaction> = Vec::new(); |
| 14 | let res = user1.transfer_to(&mut user2, 9, 1); |
| 15 | match res { |
| 16 | Ok(tx) => txs.push(tx), |
| 17 | Err(e) => panic!("{}", e), |
| 18 | } |
| 19 | let res = user1.transfer_to(&mut user2, 5, 1); |
| 20 | match res { |
| 21 | Ok(tx) => txs.push(tx), |
| 22 | Err(e) => panic!("{}", e), |
| 23 | } |
| 24 | bc.add_block(txs); |
| 25 | |
| 26 | let mut txs: Vec<Transaction> = Vec::new(); |
| 27 | let res = user2.transfer_to(&mut user3, 6, 1); |
| 28 | match res { |
| 29 | Ok(tx) => txs.push(tx), |
| 30 | Err(e) => panic!("{}", e), |
| 31 | } |
| 32 | let res = user2.transfer_to(&mut user3, 3, 1); |
| 33 | match res { |
| 34 | Ok(tx) => txs.push(tx), |
| 35 | Err(e) => panic!("{}", e), |
| 36 | } |
| 37 | bc.add_block(txs); |
| 38 | |
| 39 | println!("-------------------------Account Info----------------------------"); |
| 40 | let users = vec![&user1, &user2, &user3]; |
| 41 | for u in users { |
| 42 | u.account_info(); |
| 43 | } |
| 44 | |
| 45 | println!("-------------------------Block Info------------------------------"); |
| 46 | bc.block_info(); |
| 47 | } |
nothing calls this directly
no test coverage detected