|
@ -110,7 +110,7 @@ class PaymentRequest: |
|
|
|
|
|
|
|
|
self.id = bitcoin.sha256(r)[0:16].encode('hex') |
|
|
self.id = bitcoin.sha256(r)[0:16].encode('hex') |
|
|
filename = os.path.join(self.dir_path, self.id) |
|
|
filename = os.path.join(self.dir_path, self.id) |
|
|
with open(filename,'w') as f: |
|
|
with open(filename,'wb') as f: |
|
|
f.write(r) |
|
|
f.write(r) |
|
|
|
|
|
|
|
|
return self.parse(r) |
|
|
return self.parse(r) |
|
@ -125,7 +125,7 @@ class PaymentRequest: |
|
|
|
|
|
|
|
|
def read_file(self, key): |
|
|
def read_file(self, key): |
|
|
filename = os.path.join(self.dir_path, key) |
|
|
filename = os.path.join(self.dir_path, key) |
|
|
with open(filename,'r') as f: |
|
|
with open(filename,'rb') as f: |
|
|
r = f.read() |
|
|
r = f.read() |
|
|
|
|
|
|
|
|
assert key == bitcoin.sha256(r)[0:16].encode('hex') |
|
|
assert key == bitcoin.sha256(r)[0:16].encode('hex') |
|
|