apply_gas_multiplier
Function
def apply_gas_multiplier(tx, multiplier=None):
if not multiplier:
multiplier = os.getenv('GAS_MULTIPLIER')
try:
multiplier = float(multiplier)
except ValueError:
raise ValueError("Invalid float for GAS_MULTIPLIER")
else:
tx['gas'] = int(tx['gas'] * multiplier)
if 'maxFeePerGas' in tx:
tx['maxFeePerGas'] = int(tx['maxFeePerGas'] * multiplier)
return tx