commit 799452102bd299c933418f96a54680348d9cab34
parent 12c5692367ce1a0a6576d55cea775a0594311d32
Author: nolash <dev@holbrook.no>
Date: Sat, 12 Jun 2021 21:40:36 +0200
Enable literal v setting in apply signature
Diffstat:
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/crypto_dev_signer/eth/transaction.py b/crypto_dev_signer/eth/transaction.py
@@ -146,12 +146,15 @@ class EIP155Transaction:
return tx
- def apply_signature(self, chain_id, signature):
+ def apply_signature(self, chain_id, signature, literal_v=False):
if len(self.r + self.s) > 0:
raise AttributeError('signature already set')
if len(signature) < 65:
raise ValueError('invalid signature length')
- v = chain_id_to_v(chain_id, signature)
+ if literal_v:
+ v = signature[64]
+ else:
+ v = chain_id_to_v(chain_id, signature)
self.v = int_to_minbytes(v)
self.r = signature[:32]
self.s = signature[32:64]
diff --git a/setup.py b/setup.py
@@ -33,7 +33,7 @@ f.close()
setup(
name="crypto-dev-signer",
- version="0.4.14b4",
+ version="0.4.14b5",
description="A signer and keystore daemon and library for cryptocurrency software development",
author="Louis Holbrook",
author_email="dev@holbrook.no",