Created
November 8, 2021 22:59
-
-
Save perymerdeka/2c1c71a59b522b65809a11db9a7e97ca to your computer and use it in GitHub Desktop.
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
# 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