class Block:
def init(self, previous_hash, transaction):
self.transactions = transaction
self.previous_hash = previous_hash
string_to_hash = "".join(transaction) + previous_hash
self.block_hash = hashlib.sha256(string_to_hash.encode()).hexdigest()
blockchain =
genesis_block = Block(“Blockchain is Amazing…”, [“X sent 1 BTC to Y”,
"X sent 2 BTC to Y",
"X sent 3 BTC to Y",
"X sent 4 BTC to Y"])
print(genesis_block.block_hash)
TypeError Traceback (most recent call last)
in ()
4 “X sent 2 BTC to Y”,
5 “X sent 3 BTC to Y”,
----> 6 “X sent 4 BTC to Y”])
7
8
TypeError: Block() takes no arguments