Compact gas price limit fields in tx json

This commit is contained in:
lash 2022-05-14 20:05:32 +00:00
parent 586eccfba0
commit 43f3aff255
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -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'],
}