Open
Conversation
Et7f3
commented
Apr 9, 2022
Author
Et7f3
left a comment
There was a problem hiding this comment.
And the rest should be only print.
blockchain/chain.py
Outdated
| """ | ||
| hashData = str(self.index) + str(self.data) + self.timestamp + self.previousHash + str(self.nonce) | ||
| return hashlib.sha256(hashData).hexdigest() | ||
| return hashlib.sha256(hashData.encode("utf8")).hexdigest() |
| Method to write new mined block to blockchain | ||
| """ | ||
| dataFile = file("chain.txt", "w") | ||
| dataFile = open("chain.txt", "w") |
Author
There was a problem hiding this comment.
| # Start blockshell shell | ||
| while True: | ||
| cmd = raw_input("[BlockShell] $ ") | ||
| cmd = input("[BlockShell] $ ") |
Author
There was a problem hiding this comment.
Author
|
#18 did the work (work for py2 and py3) and was rejected. Maybe for raw_input hack. I followed official recommandation so I hope it will be merged. Also python2 is really old and even Debian install python3 as default and python2 as option. |
| Method for Proof of Work | ||
| """ | ||
| print Back.RED + "\n[Status] Mining block (" + str(self.index) + ") with PoW ..." | ||
| print(Back.RED + "\n[Status] Mining block (" + str(self.index) + ") with PoW ...") |
There was a problem hiding this comment.
probably use fstrings. Since this is cli we should use click and show messages with click.echo
Author
There was a problem hiding this comment.
I opted for minimal change. If we are ok about putting 3.6 as lower bound why not.
There was a problem hiding this comment.
but I agree this doesn't block your PR
smitthakkar96
approved these changes
Apr 19, 2022
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #17