MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / main

Function main

code/chapter09/blockchain/blockchain2/main/src/main.rs:3–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1use core::blockchain::BlockChain as BC;
2
3fn main() {
4 println!("-------------------------Mine Info----------------------------");
5 let mut bc = BC::new();
6
7 let tx = "0xabcd -> 0xabce: 5 btc".to_string();
8 bc.add_block(tx);
9
10 let tx = "0xabcd -> 0xabcf: 2.5 btc".to_string();
11 bc.add_block(tx);
12
13 println!("-------------------------Block Info------------------------------");
14 bc.block_info();
15}

Callers

nothing calls this directly

Calls 3

to_stringMethod · 0.45
add_blockMethod · 0.45
block_infoMethod · 0.45

Tested by

no test coverage detected