Skip to content

Commit

Permalink
Update BK_BMN.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Chicook authored Oct 15, 2024
1 parent fdc19a1 commit 937aa32
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/BK_INICIAR_WEB/BK_BMN.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Clase Block para manejar los bloques
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
Expand All @@ -22,6 +23,7 @@ def calculate_hash(self):
# Clase SimpleBlockchain
class SimpleBlockchain:
def __init__(self):
self.chain = []
self.create_genesis_block()
Expand Down Expand Up @@ -61,11 +63,13 @@ def create_block_from_BK_FN3(self):
print("Nuevo bloque creado desde módulo 2 con funciones ejecutadas")
# Mostrar la cadena de bloques
def show_chain(self):
for block in self.chain:
print(f"Índice: {block.index}, Data: {block.data}, Hash: {block.hash}")
print(f"Índice: {block.index}, Data: {block.data}, Hash: {block.hash}")
# Ejecución
if __name__ == "__main__":
blockchain = SimpleBlockchain()
blockchain.create_block_from_BK_FN2() # Llama a las funciones del módulo 1 y crea un bloque
Expand Down

0 comments on commit 937aa32

Please sign in to comment.