CSSG-Labs / CSSG-Labs/python-blockchain

Write new_block method for Blockchain class

未關閉
#2 0 則留言 0 個 reaction 已指派 1 人 已被 @PatrickBruso 認領 在 GitHub 檢視
enhancement good first issue
主要語言
Python
星號
0
分支
0
PR 合併指標
30 天內沒有已合併 PR

描述

We need to code the new_block method for our Blockchain class. This method should create a new block in the blockchain. The parameters will be 'proof' and 'previous_hash', which should be set to a default value of 'None'.

This method should also create a 'block' dictionary that contains the following keys:
'index' which should be the next item on the chain list
'timestamp' which should be the time (you will need to import and use the time library)
'transactions' which should be the current_transactions list
'proof' which will be the parameter proof
'previous_hash' which will be the parameter 'previous_hash'

The method should then reset the list of transactions to an empty list, and append the block to the list 'chain' before returning the block.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。