remove broken unneeded code from bitpay
This commit is contained in:
parent
2bfd3787e9
commit
5edc526c79
@ -42,33 +42,14 @@ class Client:
|
|||||||
return response.json()['data']
|
return response.json()['data']
|
||||||
self.response_error(response)
|
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):
|
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:
|
if re.match("^[A-Z]{3,3}$", currency) is None:
|
||||||
raise BtcPayArgumentError("Currency is invalid.")
|
raise BtcPayArgumentError("Currency is invalid.")
|
||||||
try:
|
try:
|
||||||
float(price)
|
float(price)
|
||||||
except:
|
except:
|
||||||
raise BtcPayArgumentError("Price must be formatted as a float")
|
raise BtcPayArgumentError("Price must be formatted as a float")
|
||||||
|
|
||||||
def response_error(self, response):
|
def response_error(self, response):
|
||||||
raise BtcPayBtcPayError('%(code)d: %(message)s' % {'code': response.status_code, 'message': response.json()['error']})
|
raise BtcPayBtcPayError('%(code)d: %(message)s' % {'code': response.status_code, 'message': response.json()['error']})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user