From 270eb626422de24d6da0d93a7e4d6c0eb0f5c59c Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 09:46:42 +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 6c657e5 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 --- .../pi_wallet/services/pi_api_service.py | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/blockchain_integration/pi_network/wallet/pi_wallet/services/pi_api_service.py b/blockchain_integration/pi_network/wallet/pi_wallet/services/pi_api_service.py index 4fc6e4d0d..9c68b8e47 100644 --- a/blockchain_integration/pi_network/wallet/pi_wallet/services/pi_api_service.py +++ b/blockchain_integration/pi_network/wallet/pi_wallet/services/pi_api_service.py @@ -1,7 +1,10 @@ import requests + from .exceptions.pi_network_exceptions import PiNetworkApiException + class PiApiService: + def __init__(self, api_endpoint, api_key, api_secret): self.api_endpoint = api_endpoint self.api_key = api_key @@ -9,30 +12,34 @@ def __init__(self, api_endpoint, api_key, api_secret): def get_blockchain_info(self): headers = { - 'Content-Type': 'application/json', - 'Authorization': f'Bearer {self.api_key}' + "Content-Type": "application/json", + "Authorization": f"Bearer {self.api_key}", } - response = requests.get(f'{self.api_endpoint}/blockchain', headers=headers) + response = requests.get(f"{self.api_endpoint}/blockchain", headers=headers) if response.status_code != 200: raise PiNetworkApiException(response.status_code, response.text) return response.json() def broadcast_transaction(self, transaction): headers = { - 'Content-Type': 'application/json', - 'Authorization': f'Bearer {self.api_key}' + "Content-Type": "application/json", + "Authorization": f"Bearer {self.api_key}", } - response = requests.post(f'{self.api_endpoint}/transaction', json=transaction, headers=headers) + response = requests.post( + f"{self.api_endpoint}/transaction", json=transaction, headers=headers + ) if response.status_code != 201: raise PiNetworkApiException(response.status_code, response.text) return response.json() def verify_transaction(self, transaction): headers = { - 'Content-Type': 'application/json', - 'Authorization': f'Bearer {self.api_key}' + "Content-Type": "application/json", + "Authorization": f"Bearer {self.api_key}", } - response = requests.get(f'{self.api_endpoint}/transaction/{transaction["hash"]}', headers=headers) + response = requests.get( + f'{self.api_endpoint}/transaction/{transaction["hash"]}', headers=headers + ) if response.status_code != 200: raise PiNetworkApiException(response.status_code, response.text) return response.json()