MCPcopy
hub / github.com/raiden-network/raiden / sign

Method sign

raiden/utils/signer.py:92–99  ·  view source on GitHub ↗

Sign data hash with local private key

(self, data: bytes, v: int = 27)

Source from the content-addressed store, hash-verified

90 self.address = self.private_key.public_key.to_canonical_address()
91
92 def sign(self, data: bytes, v: int = 27) -> Signature:
93 """Sign data hash with local private key"""
94 assert v in (0, 27), "Raiden is only signing messages with v in (0, 27)"
95 _hash = eth_sign_sha3(data)
96 signature = self.private_key.sign_msg_hash(message_hash=_hash)
97 sig_bytes = signature.to_bytes()
98 # adjust last byte to v
99 return sig_bytes[:-1] + bytes([sig_bytes[-1] + v])

Callers 10

get_loginFunction · 0.95
matrix_api_shellFunction · 0.95
test_token_network_proxyFunction · 0.95
_Function · 0.95
test_signer_signFunction · 0.95
test_encrypt_secretFunction · 0.95

Calls 1

eth_sign_sha3Function · 0.85