use base64 for the API passphrase and random address label
This commit is contained in:
parent
b8b9570356
commit
267896cbe1
|
@ -25,10 +25,12 @@ print 'Now that we have our address data in a nice Python data structure, let\'s
|
||||||
print jsonAddresses['addresses'][0]['label']
|
print jsonAddresses['addresses'][0]['label']
|
||||||
|
|
||||||
print 'Uncomment this next line to create a new random address.'
|
print 'Uncomment this next line to create a new random address.'
|
||||||
#print api.createRandomAddress('new address label')
|
addressLabel = 'new address label'.encode('base64')
|
||||||
|
print api.createRandomAddress(addressLabel)
|
||||||
|
|
||||||
print 'Uncomment these next three lines to create new new deterministic addresses.'
|
print 'Uncomment these next four lines to create new deterministic addresses.'
|
||||||
#jsonDeterministicAddresses = api.createDeterministicAddresses('asdfasdfqwerasdf', 2, 2, 1, False)
|
#passphrase = 'asdfasdfqwer'.encode('base64')
|
||||||
|
#jsonDeterministicAddresses = api.createDeterministicAddresses(passphrase, 2, 2, 1, False)
|
||||||
#print jsonDeterministicAddresses
|
#print jsonDeterministicAddresses
|
||||||
#print json.loads(jsonDeterministicAddresses)
|
#print json.loads(jsonDeterministicAddresses)
|
||||||
|
|
||||||
|
|
|
@ -3346,6 +3346,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
eighteenByteRipe = False
|
eighteenByteRipe = False
|
||||||
elif len(params) == 2:
|
elif len(params) == 2:
|
||||||
label, eighteenByteRipe = params
|
label, eighteenByteRipe = params
|
||||||
|
label = label.decode('base64')
|
||||||
apiAddressGeneratorReturnQueue.queue.clear()
|
apiAddressGeneratorReturnQueue.queue.clear()
|
||||||
apiSignalQueue.put(('createRandomAddress',(label, eighteenByteRipe))) #params should be a twopul which equals (eighteenByteRipe, label)
|
apiSignalQueue.put(('createRandomAddress',(label, eighteenByteRipe))) #params should be a twopul which equals (eighteenByteRipe, label)
|
||||||
return apiAddressGeneratorReturnQueue.get()
|
return apiAddressGeneratorReturnQueue.get()
|
||||||
|
@ -3374,6 +3375,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
passphrase, numberOfAddresses, addressVersionNumber, streamNumber, eighteenByteRipe = params
|
passphrase, numberOfAddresses, addressVersionNumber, streamNumber, eighteenByteRipe = params
|
||||||
if len(passphrase) == 0:
|
if len(passphrase) == 0:
|
||||||
return 'API Error 0001: the specified passphrase is blank.'
|
return 'API Error 0001: the specified passphrase is blank.'
|
||||||
|
passphrase = passphrase.decode('base64')
|
||||||
if addressVersionNumber == 0: #0 means "just use the proper addressVersionNumber"
|
if addressVersionNumber == 0: #0 means "just use the proper addressVersionNumber"
|
||||||
addressVersionNumber == 2
|
addressVersionNumber == 2
|
||||||
if addressVersionNumber != 2:
|
if addressVersionNumber != 2:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user