def sign_and_inject(message: Message, signer: Signer, app: App) -> None: """Sign the message with key and inject it directly in the app transport layer.""" message.sign(signer) MessageHandler().on_message(app.raiden, message)
def sign(self, message: Message): """ Sign message inplace. """ if not isinstance(message, SignedMessage): raise ValueError('{} is not signable.'.format(repr(message))) message.sign(self.signer)
def sign(self, message: Message): """ Sign message inplace. """ if not isinstance(message, SignedMessage): raise ValueError('{} is not signable.'.format(repr(message))) message.sign(self.private_key)