Last active
October 1, 2022 20:37
-
-
Save rserranon/b8118a9d74c0b96335977c5037333afb to your computer and use it in GitHub Desktop.
Exercise 3 Chain Code
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
# | |
# Chaincode excercise 3 | |
# | |
# generate new block | |
self.log.info("Generate new block") | |
new_block_hash = self.generate(self.nodes[1], 1) | |
# sync previously connected nodes | |
self.log.info("Sync previously connected nodes") | |
self.sync_all() | |
# find block and get hash | |
self.log.info("Find block and get hash") | |
hash = self.nodes[2].getblock(new_block_hash[0], 1)['hash'] | |
# assert both hashes are equal | |
self.log.info("Asserting we find the right block") | |
assert_equal(new_block_hash[0], hash) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment