-
Notifications
You must be signed in to change notification settings - Fork 112
deps(python): Python 2 -> 3 by hand #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Et7f3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ok.
| Method to write new mined block to blockchain | ||
| """ | ||
| dataFile = file("chain.txt", "w") | ||
| dataFile = open("chain.txt", "w") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Start blockshell shell | ||
| while True: | ||
| cmd = raw_input("[BlockShell] $ ") | ||
| cmd = input("[BlockShell] $ ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably use fstrings. Since this is cli we should use click and show messages with click.echo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I agree this doesn't block your PR
fix #17