
from tfs_crypto import BlockChain

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    blockchain = BlockChain()

    print("***Mining tfsCoin about to start***")
    print(blockchain.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="God",  # it implies that this node has created a new block
        recipient="Hitesh",  # let's send Quincy some coins!
        quantity= 100,  # 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)

    print("***Mining tfsCoin has been successful***")
    print(blockchain.chain)
