From 3c441256b1ac6169c3e0ccefed5bcde929c312fb Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 13:11:14 +0000 Subject: [PATCH] style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf This commit fixes the style issues introduced in c5cbe89 according to the output from Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf. Details: None --- blockchain/block.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blockchain/block.py b/blockchain/block.py index ca6f44246..7945ecbae 100644 --- a/blockchain/block.py +++ b/blockchain/block.py @@ -1,6 +1,7 @@ import hashlib import time + class Block: def __init__(self, index, previous_hash, timestamp, data, hash): self.index = index @@ -12,13 +13,13 @@ def __init__(self, index, previous_hash, timestamp, data, hash): @staticmethod def calculate_hash(index, previous_hash, timestamp, data): value = str(index) + str(previous_hash) + str(timestamp) + str(data) - return hashlib.sha256(value.encode('utf-8')).hexdigest() + return hashlib.sha256(value.encode("utf-8")).hexdigest() def __str__(self): - return 'Block: {index}, Previous Hash: {previous_hash}, Timestamp: {timestamp}, Data: {data}, Hash: {hash}'.format( + return "Block: {index}, Previous Hash: {previous_hash}, Timestamp: {timestamp}, Data: {data}, Hash: {hash}".format( index=self.index, previous_hash=self.previous_hash, timestamp=self.timestamp, data=self.data, - hash=self.hash + hash=self.hash, )