From a4a31c050fea3d1d2f18fd15ff9b6440c6a02e1c Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Wed, 7 May 2025 18:24:07 +0000 Subject: [PATCH] proto.eth.tx.new: adjust gas with data only for non-token TXs --- mmgen/proto/eth/tx/new.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mmgen/proto/eth/tx/new.py b/mmgen/proto/eth/tx/new.py index 71f17f91..3b129132 100755 --- a/mmgen/proto/eth/tx/new.py +++ b/mmgen/proto/eth/tx/new.py @@ -81,11 +81,12 @@ class New(Base, TxBase.New): self.txid = MMGenTxID(make_chksum_6(self.serialized).upper()) def set_gas_with_data(self, data): - self.gas = self.proto.coin_amt(self.dfl_gas + self.byte_cost * len(data), from_unit='wei') + if not self.is_token: + self.gas = self.proto.coin_amt(self.dfl_gas + self.byte_cost * len(data), from_unit='wei') # one-shot method def adj_gas_with_extra_data_len(self, extra_data_len): - if not hasattr(self, '_gas_adjusted'): + if not (self.is_token or hasattr(self, '_gas_adjusted')): self.gas += self.proto.coin_amt(self.byte_cost * extra_data_len, from_unit='wei') self._gas_adjusted = True