Skip to content

Conversation

@Et7f3
Copy link

@Et7f3 Et7f3 commented Apr 9, 2022

fix #17

Copy link
Author

@Et7f3 Et7f3 left a 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.

"""
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()
Copy link
Author

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")
Copy link
Author

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] $ ")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Et7f3
Copy link
Author

Et7f3 commented Apr 9, 2022

#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 ...")

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

Copy link
Author

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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python 3 version

2 participants