From 7f2c32975d18f43f417c7ebd0cfa1000c2de1623 Mon Sep 17 00:00:00 2001 From: lash Date: Sun, 23 Jan 2022 20:36:29 +0000 Subject: [PATCH] Enable unpack of pre EIP155 txs --- CHANGELOG | 2 ++ chainlib/eth/tx.py | 3 ++- setup.cfg | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9d545e6..044be9f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +- 0.0.22: + * Enable unpack of pre EIP-155 transactions - 0.0.21: * Remove warnings from cytoolz/rlp in funga-eth - 0.0.15: diff --git a/chainlib/eth/tx.py b/chainlib/eth/tx.py index bf3d4de..54a005c 100644 --- a/chainlib/eth/tx.py +++ b/chainlib/eth/tx.py @@ -162,7 +162,8 @@ def __unpack_raw(tx_raw_bytes, chain_id=1): vb = chain_id if chain_id != 0: v = int.from_bytes(d[6], 'big') - vb = v - (chain_id * 2) - 35 + if v > 29: + vb = v - (chain_id * 2) - 35 r = bytearray(32) r[32-len(d[7]):] = d[7] s = bytearray(32) diff --git a/setup.cfg b/setup.cfg index cec92dc..f5f6bef 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = chainlib-eth -version = 0.0.21 +version = 0.0.22 description = Ethereum implementation of the chainlib interface author = Louis Holbrook author_email = dev@holbrook.no