From 11cbffbf8b583e481611e534e7a6676229ff5a7d Mon Sep 17 00:00:00 2001 From: david weil Date: Thu, 28 Nov 2019 19:35:32 -0300 Subject: [PATCH 1/2] fix for 1347 --- web3/_utils/method_formatters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web3/_utils/method_formatters.py b/web3/_utils/method_formatters.py index 970a69d15b..279bc74d72 100644 --- a/web3/_utils/method_formatters.py +++ b/web3/_utils/method_formatters.py @@ -120,9 +120,9 @@ def is_attrdict(val): 'value': to_integer_if_hex, 'from': to_checksum_address, 'publicKey': apply_formatter_if(is_not_null, to_hexbytes(64)), - 'r': to_hexbytes(32, variable_length=True), + 'r': apply_formatter_if(is_not_null, to_hexbytes(32, variable_length=True)), 'raw': HexBytes, - 's': to_hexbytes(32, variable_length=True), + 's': apply_formatter_if(is_not_null, to_hexbytes(32, variable_length=True)), 'to': apply_formatter_if(is_address, to_checksum_address), 'hash': to_hexbytes(32), 'v': apply_formatter_if(is_not_null, to_integer_if_hex), From cf5c099dedc60af15eb1d1c78aeebbf3fb1bd16a Mon Sep 17 00:00:00 2001 From: Keri Date: Mon, 2 Dec 2019 15:01:59 -0700 Subject: [PATCH 2/2] Add newsfragment for #1531 --- newsfragments/1531.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/1531.bugfix.rst diff --git a/newsfragments/1531.bugfix.rst b/newsfragments/1531.bugfix.rst new file mode 100644 index 0000000000..3609c60435 --- /dev/null +++ b/newsfragments/1531.bugfix.rst @@ -0,0 +1 @@ +Only apply hexbytes formatting to r and s values in transaction if present