MCPcopy Create free account
hub / github.com/PacktPublishing/Rust-for-Blockchain-Application-Development / Block

Class Block

chapter 2/code.rs:3–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1// represent a block from a blockchain, using Rust structs
2
3pub struct Block {
4 pub id: u64,
5 pub hash: String,
6 pub previous_hash: String,
7 pub timestamp: i64,
8 pub txn_data: String,
9 pub nonce: u64,
10}
11
12
13// blockchain can be represented

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected