Created
May 18, 2020 19:08
-
-
Save bajcmartinez/7b92190e8afb4fc6cb1e00e82e96c812 to your computer and use it in GitHub Desktop.
From Zero to Blockchain in Python - Part 1 - Constructor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def __init__(self): | |
self.__current_transactions = [] | |
self.__chain = [] | |
# Create genesis block | |
self.create_genesis() | |
def create_genesis(self): | |
""" | |
Creates the Genesis block and passes it to the chain | |
:return: None | |
""" | |
genesis_block = Block(0, self.__current_transactions, 0, '00') | |
self.__chain.append(genesis_block) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment