Skip to content

Instantly share code, notes, and snippets.

@perymerdeka
Created November 8, 2021 22:59
Show Gist options
  • Save perymerdeka/2c1c71a59b522b65809a11db9a7e97ca to your computer and use it in GitHub Desktop.
Save perymerdeka/2c1c71a59b522b65809a11db9a7e97ca to your computer and use it in GitHub Desktop.
# code exec
if __name__ == "__main__":
trans1: str = "Anna send 1 BTC to Feri"
trans2: str = "Feri Send 1.3 BTC to Budi"
trans3: str = "Bagus Send 3.5 BTC to Hadi"
trans4: str = 'Ivan send 5.5 BTC to Feryy'
# transaction List
transact: list = [trans1, trans2, trans3, trans4]
# define class and Call Method
initial_block: Blockchain = Blockchain("Initial String", transact)
initial_block.get_transaction()
# the second block
seconds_block: Blockchain = Blockchain(initial_block.block_hash, [trans2, trans4])
seconds_block.get_transaction()
# third block
third_block = Blockchain(seconds_block.block_hash, [trans1, trans3, trans2])
third_block.get_transaction()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment