from blockchain import BlockChain

blockchain = BlockChain()
print("\n\t***Mining TestCoin about to start***\n")
"Printing before the new block is added to the chain."
print(blockchain.chain)

"Now adding the newly created block onto the chain."
last_block = blockchain.latest_block()
last_proof_no = last_block.proof_no
proof_no = blockchain.proof_of_work(last_proof_no)
blockchain.new_data(
    sender="0",  # Implies that this node has created a new block
    recipient="Tony Moe",  # Let's send Tony some coins!
    quantity=1  # Creating a new block ( or identifying the proof number ) is awarded with 1.
)
last_hash = last_block.calculate_hash
block = blockchain.construct_block(proof_no, last_hash)

"Printing the newly created block that was added to the blockchain."
print("\n\t***Mining TestCoin successful***\n")
print(blockchain.chain)