- Timestamp:
- 04/23/09 15:33:57 (3 years ago)
- Location:
- trunk/sandbox/jhb/oc2
- Files:
-
- 2 modified
-
documentation.py (modified) (7 diffs)
-
protocols.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/sandbox/jhb/oc2/documentation.py
r272 r273 449 449 >>> authorizer.deny = True 450 450 >>> testserver.run_once(port,mint=mint,authorizer=authorizer) 451 >>> text,value = clientside.run() 452 >>> text 451 >>> clientside.run().header 453 452 'TransferReject' 454 453 … … 464 463 >>> authorizer.deny = False 465 464 >>> testserver.run_once(port,mint=mint,authorizer=authorizer) 466 >>> text,value =clientside.run()467 >>> text465 >>> response = clientside.run() 466 >>> response.header 468 467 'TransferAccept' 469 >>> blindsign = value[0]468 >>> blindsign = response.signatures[0] 470 469 >>> blank.signature = key.unblind(secret,blindsign) 471 470 >>> coin = blank … … 490 489 >>> mint.delay = True 491 490 >>> testserver.run_once(port,mint=mint,authorizer=authorizer) 492 >>> text,value = clientside.run() 493 >>> text 491 >>> clientside.run().header 494 492 'TransferDelay' 495 493 >>> mint.delay = False … … 531 529 >>> clientside = protocols.TransferResume(transport,tid) 532 530 >>> testserver.run_once(port,issuer=issuer) 533 >>> text,value = clientside.run() 534 >>> text 531 >>> clientside.run().header 535 532 'TransferDelay' 536 533 >>> issuer.delay = False … … 550 547 >>> clientside = protocols.TransferResume(transport,tid) 551 548 >>> testserver.run_once(port,issuer=issuer) 552 >>> text,value =clientside.run()553 >>> text549 >>> response = clientside.run() 550 >>> response.header 554 551 'TransferAccept' 555 552 … … 566 563 ############################################################################### 567 564 568 >>> blindsign = value[0]565 >>> blindsign = response.signatures[0] 569 566 >>> blank.signature = key.unblind(secret,blindsign) 570 567 >>> coin = blank … … 679 676 >>> clientside = protocols.TransferRequest(transport,tid,blinds = blinds, coins = coins) 680 677 >>> testserver.run_once(port,issuer=issuer,mint=mint) 681 >>> text,value = clientside.run()682 >>> bobblank.signature = key.unblind(bobsecret, value[0])678 >>> response = clientside.run() 679 >>> bobblank.signature = key.unblind(bobsecret,response.signatures[0]) 683 680 >>> bobcoin = bobblank 684 681 >>> key.verifyContainerSignature(bobcoin) -
trunk/sandbox/jhb/oc2/protocols.py
r272 r273 99 99 100 100 response = self.transport(message) 101 header = response.header 102 if header == 'TransferReject': 103 return ('TransferReject','') 104 elif header == 'TransferDelay': 105 return ('TransferDelay','') 106 elif header == 'TransferAccept': 107 return ('TransferAccept',response.signatures) 108 else: 109 raise 'unknown thing' 101 return response 102 110 103 111 104 class TransferHandling(Protocol): … … 143 136 message.transactionId = self.transactionId 144 137 response = self.transport(message) 145 header = response.header 146 if header == 'TransferReject': 147 return ('TransferReject','') 148 elif header == 'TransferDelay': 149 return ('TransferDelay','') 150 elif header == 'TransferAccept': 151 return ('TransferAccept',response.signatures) 152 else: 153 raise 'unknown thing' 154 155 return response.cdd 138 return response 156 139 157 140 class TransferResumeHandling(Protocol):
