Ejemplo n.º 1
0
 def listen(self,transport):
     """
     >>> import transports
     >>> w = Wallet()
     >>> stt = transports.SimpleTestTransport()
     >>> w.listen(stt)
     >>> stt.send('HANDSHAKE',{'protocol': 'opencoin 1.0'})
     <Message('HANDSHAKE_ACCEPT',None)>
     >>> stt.send('sendMoney',[1,2])
     <Message('Receipt',None)>
     """
     protocol = protocols.answerHandshakeProtocol(TRANSFER_TOKEN_REQUEST=protocols.TransferTokenRecipient(self),)
     transport.setProtocol(protocol)
     transport.start()
Ejemplo n.º 2
0
 def listen(self, transport):
     """
     >>> import transports
     >>> w = Wallet()
     >>> stt = transports.SimpleTestTransport()
     >>> w.listen(stt)
     >>> stt.send('HANDSHAKE',{'protocol': 'opencoin 1.0'})
     <Message('HANDSHAKE_ACCEPT',None)>
     >>> stt.send('sendMoney',[1,2])
     <Message('Receipt',None)>
     """
     protocol = protocols.answerHandshakeProtocol(
         TRANSFER_TOKEN_REQUEST=protocols.TransferTokenRecipient(self), )
     transport.setProtocol(protocol)
     transport.start()
Ejemplo n.º 3
0
 def listen(self,transport):
     """
     >>> import transports
     >>> w = Wallet()
     >>> stt = transports.SimpleTestTransport()
     >>> w.listen(stt)
     >>> stt.send('HANDSHAKE',{'protocol': 'opencoin 1.0'})
     <Message('HANDSHAKE_ACCEPT',None)>
     >>> stt.send('sendMoney',[1,2])
     <Message('Receipt',None)>
     """
     protocol = protocols.answerHandshakeProtocol(sendMoney=protocols.WalletRecipientProtocol(self),
                                                  SUM_ANNOUNCE=protocols.TokenSpendRecipient(self))
     transport.setProtocol(protocol)
     transport.start()
Ejemplo n.º 4
0
 def listen(self, transport):
     """
     >>> import transports
     >>> w = Wallet()
     >>> stt = transports.SimpleTestTransport()
     >>> w.listen(stt)
     >>> stt.send('HANDSHAKE',{'protocol': 'opencoin 1.0'})
     <Message('HANDSHAKE_ACCEPT',None)>
     >>> stt.send('sendMoney',[1,2])
     <Message('Receipt',None)>
     """
     protocol = protocols.answerHandshakeProtocol(
         sendMoney=protocols.WalletRecipientProtocol(self),
         SUM_ANNOUNCE=protocols.TokenSpendRecipient(self))
     transport.setProtocol(protocol)
     transport.start()