def __init__(self):
self.chain = []
self.generate_genesis_block()
def generate_genesis_block(self):
self.chain.append(Hope("0", ['Hope']))
def create_block_from_transaction(self, transaction_list):
previous_block_hash = self.last_block.block_hash
self.chain.append(Hope(previous_block_hash, transaction_list))
def display_chain(self):
for i in range(len(self.chain)):
print(f"Data {i + 1}: {self.chain[i].block_data}")
print(f"Hash {i + 1}: {self.chain[i].block_hash}\n")
@property
def last_block(self):
return self.chain[-1]


self.chain = []
self.generate_genesis_block()
def generate_genesis_block(self):
self.chain.append(Hope("0", ['Hope']))
def create_block_from_transaction(self, transaction_list):
previous_block_hash = self.last_block.block_hash
self.chain.append(Hope(previous_block_hash, transaction_list))
def display_chain(self):
for i in range(len(self.chain)):
print(f"Data {i + 1}: {self.chain[i].block_data}")
print(f"Hash {i + 1}: {self.chain[i].block_hash}\n")
@property
def last_block(self):
return self.chain[-1]

