Implement a basic Proof-of-Work mechanism to simulate mining. Each block must compute a valid hash with a certain number of leading zeros. ### Tasks - [ ] Add a `Nonce` field to the `Block` struct. - [ ] Implement a `MineBlock(difficulty int)` function that updates the hash until the difficulty is satisfied. - [ ] Integrate mining into the `NewBlock` function. - [ ] Make difficulty configurable via a global constant or config. - [ ] Write unit tests to validate mining output. ### Reference - https://en.bitcoin.it/wiki/Proof_of_work
Implement a basic Proof-of-Work mechanism to simulate mining. Each block must compute a valid hash with a certain number of leading zeros.
Tasks
Noncefield to theBlockstruct.MineBlock(difficulty int)function that updates the hash until the difficulty is satisfied.NewBlockfunction.Reference