-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
21 lines (13 loc) · 740 Bytes
/
test.py
File metadata and controls
21 lines (13 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from blockchain import Blockchain
block_one_transactions = {"sender":"Alice", "receiver": "Bob", "amount":"50"}
block_two_transactions = {"sender": "Bob", "receiver":"Cole", "amount":"25"}
block_three_transactions = {"sender":"Alice", "receiver":"Cole", "amount":"35"}
fake_transactions = {"sender": "Bob", "receiver":"Cole, Alice", "amount":"25"}
local_blockchain = Blockchain()
local_blockchain.add_block(block_one_transactions)
local_blockchain.add_block(block_two_transactions)
local_blockchain.chain[2].transactions = fake_transactions
local_blockchain.validate_chain()
local_blockchain.add_block(block_three_transactions)
print(local_blockchain.print_blocks())
print(local_blockchain.proof_of_work(local_blockchain.chain[0]))