proto.eth.tx.new: adjust gas with data only for non-token TXs
This commit is contained in:
parent
a351b16e11
commit
a4a31c050f
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue