Make literal v literal v in argument
This commit is contained in:
parent
799452102b
commit
5dd9db32b1
@ -3,3 +3,6 @@ ethereum_recid_modifier = 35
|
|||||||
def chain_id_to_v(chain_id, signature):
|
def chain_id_to_v(chain_id, signature):
|
||||||
v = signature[64]
|
v = signature[64]
|
||||||
return (chain_id * 2) + ethereum_recid_modifier + v
|
return (chain_id * 2) + ethereum_recid_modifier + v
|
||||||
|
|
||||||
|
def chainv_to_v(chain_id, v):
|
||||||
|
return v - ethereum_recid_modifier - (chain_id * 2)
|
||||||
|
@ -146,15 +146,13 @@ class EIP155Transaction:
|
|||||||
return tx
|
return tx
|
||||||
|
|
||||||
|
|
||||||
def apply_signature(self, chain_id, signature, literal_v=False):
|
def apply_signature(self, chain_id, signature, v=None):
|
||||||
if len(self.r + self.s) > 0:
|
if len(self.r + self.s) > 0:
|
||||||
raise AttributeError('signature already set')
|
raise AttributeError('signature already set')
|
||||||
if len(signature) < 65:
|
if len(signature) < 65:
|
||||||
raise ValueError('invalid signature length')
|
raise ValueError('invalid signature length')
|
||||||
if literal_v:
|
if v == None:
|
||||||
v = signature[64]
|
v = signature[64]
|
||||||
else:
|
|
||||||
v = chain_id_to_v(chain_id, signature)
|
|
||||||
self.v = int_to_minbytes(v)
|
self.v = int_to_minbytes(v)
|
||||||
self.r = signature[:32]
|
self.r = signature[:32]
|
||||||
self.s = signature[32:64]
|
self.s = signature[32:64]
|
||||||
|
2
setup.py
2
setup.py
@ -33,7 +33,7 @@ f.close()
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="crypto-dev-signer",
|
name="crypto-dev-signer",
|
||||||
version="0.4.14b5",
|
version="0.4.14b6",
|
||||||
description="A signer and keystore daemon and library for cryptocurrency software development",
|
description="A signer and keystore daemon and library for cryptocurrency software development",
|
||||||
author="Louis Holbrook",
|
author="Louis Holbrook",
|
||||||
author_email="dev@holbrook.no",
|
author_email="dev@holbrook.no",
|
||||||
|
Loading…
Reference in New Issue
Block a user