commit 43f3aff255380a183e25e039b7fc1953af06c1b1
parent 586eccfba022069bae77dcad24edefebb8ed304d
Author: lash <dev@holbrook.no>
Date: Sat, 14 May 2022 20:05:32 +0000
Compact gas price limit fields in tx json
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/chainlib/eth/tx.py b/chainlib/eth/tx.py
@@ -410,12 +410,14 @@ class TxFactory:
txe = EIP155Transaction(tx, tx['nonce'], tx['chainId'])
txes = txe.serialize()
gas_price = strip_0x(txes['gasPrice'])
+ gas_price = compact(gas_price)
gas = strip_0x(txes['gas'])
+ gas = compact(gas)
return {
'from': tx['from'],
'to': txes['to'],
- 'gasPrice': add_0x(compact(gas_price)),
- 'gas': add_0x(compact(gas)),
+ 'gasPrice': add_0x(gas_price, compact_value=True),
+ 'gas': add_0x(gas, compact_value=True),
'data': txes['data'],
}