From 5edc526c79b071af1c446d3d2b1e62627d2791f2 Mon Sep 17 00:00:00 2001 From: forest Date: Fri, 15 May 2020 18:26:41 -0500 Subject: [PATCH] remove broken unneeded code from bitpay --- capsulflask/btcpay/client.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/capsulflask/btcpay/client.py b/capsulflask/btcpay/client.py index 3876e27..4bad199 100644 --- a/capsulflask/btcpay/client.py +++ b/capsulflask/btcpay/client.py @@ -42,33 +42,14 @@ class Client: return response.json()['data'] self.response_error(response) - def verify_tokens(self): - """ - Deprecated, will be made private in 2.4 - """ - xidentity = key_utils.get_compressed_public_key_from_pem(self.pem) - url = self.uri + "/tokens" - xsignature = key_utils.sign(self.uri + "/tokens", self.pem) - headers = {"content-type": "application/json", 'X-Identity': xidentity, 'X-Signature': xsignature, 'X-accept-version': '2.0.0'} - response = requests.get(self.uri + "/tokens", headers=headers, verify=self.verify) - if response.ok: - allTokens = response.json()['data'] - selfKeys = self.tokens.keys() - matchedTokens = [token for token in allTokens for key in selfKeys if token.get(key) == self.tokens.get(key)] - if not matchedTokens: - return False - return True - def verify_invoice_params(self, price, currency): - """ - Deprecated, will be made private in 2.4 - """ if re.match("^[A-Z]{3,3}$", currency) is None: raise BtcPayArgumentError("Currency is invalid.") try: float(price) except: raise BtcPayArgumentError("Price must be formatted as a float") + def response_error(self, response): raise BtcPayBtcPayError('%(code)d: %(message)s' % {'code': response.status_code, 'message': response.json()['error']})