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

Class Block

code/chapter09/blockchain/blockchain5/core/src/block.rs:17–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16#[derive(Serialize, Debug)]
17pub struct Block {
18 pub header: BlockHeader,
19 pub tranxs: Vec<Transaction>,
20 pub hash: String,
21}
22
23impl Block {
24 pub fn new(txs: Vec<Transaction>, pre_hash: String, bits: u32) -> Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected