payment requests: cmdline fixes
This commit is contained in:
parent
fbc23a61a3
commit
da55d9ed6e
@ -319,7 +319,7 @@ def sign_request_with_alias(pr, alias, alias_privkey):
|
|||||||
return pr
|
return pr
|
||||||
|
|
||||||
|
|
||||||
def sign_request_with_x509(pr, alias, alias_privkey):
|
def sign_request_with_x509(pr, key_path, cert_path):
|
||||||
import tlslite
|
import tlslite
|
||||||
with open(key_path, 'r') as f:
|
with open(key_path, 'r') as f:
|
||||||
rsakey = tlslite.utils.python_rsakey.Python_RSAKey.parsePEM(f.read())
|
rsakey = tlslite.utils.python_rsakey.Python_RSAKey.parsePEM(f.read())
|
||||||
@ -355,7 +355,7 @@ def make_request(config, req, alias=None, alias_privkey=None):
|
|||||||
|
|
||||||
if key_path and cert_path:
|
if key_path and cert_path:
|
||||||
sign_request_with_x509(pr, key_path, cert_path)
|
sign_request_with_x509(pr, key_path, cert_path)
|
||||||
requestor = pr.requestor
|
requestor = 'x'
|
||||||
|
|
||||||
elif alias and alias_privkey:
|
elif alias and alias_privkey:
|
||||||
requestor = alias
|
requestor = alias
|
||||||
|
|||||||
@ -1280,10 +1280,10 @@ class Abstract_Wallet(object):
|
|||||||
src = os.path.join(os.path.dirname(__file__), 'www', 'index.html')
|
src = os.path.join(os.path.dirname(__file__), 'www', 'index.html')
|
||||||
shutil.copy(src, index)
|
shutil.copy(src, index)
|
||||||
key = req.get('id', addr)
|
key = req.get('id', addr)
|
||||||
pr = paymentrequest.make_request(config, req)
|
pr, requestor = paymentrequest.make_request(config, req)
|
||||||
path = os.path.join(rdir, key + '.bip70')
|
path = os.path.join(rdir, key + '.bip70')
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
f.write(pr)
|
f.write(pr.SerializeToString())
|
||||||
# reload
|
# reload
|
||||||
req = self.get_payment_request(addr, config)
|
req = self.get_payment_request(addr, config)
|
||||||
with open(os.path.join(rdir, key + '.json'), 'w') as f:
|
with open(os.path.join(rdir, key + '.json'), 'w') as f:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user