cosmpy.aerial.gas
Transaction gas strategy.
Gas Strategy Objects
class GasStrategy(ABC)
Transaction gas strategy.
estimate_gas
@abstractmethod def estimate_gas(tx: Transaction) -> int
Estimate the transaction gas.
Arguments:
tx
: Transaction.
Returns:
None.
block_gas_limit
@abstractmethod def block_gas_limit() -> int
Get the block gas limit.
Returns:
None.
SimulationGasStrategy Objects
Simulation transaction gas strategy.
Arguments:
GasStrategy
: gas strategy.
init
def __init__(client: "LedgerClient", multiplier: Optional[float] = None)
Init the simulation transaction gas strategy.
Arguments:
client
: ledger client.multiplier
: multiplier, defaults to None.
estimate_gas
def estimate_gas(tx: Transaction) -> int
Get estimated transaction gas.
Arguments:
tx
: transaction.
Returns:
Estimated transaction gas.
block_gas_limit
def block_gas_limit() ->int
Get the block gas limit.
Returns:
Block gas limit.
OfflineMessageTableStrategy Objects
class OfflineMessageTableStrategy(GasStrategy)
Offline message table strategy.
Arguments:
GasStrategy
: gas strategy.
default_table
@staticmethod def default_table() ->"OfflineMessageTableStrategy"
Offline message strategy default table.
Returns:
Offline message default table strategy.
init
def __init__ (fallback_gas_limit: Optional[int] = None, block_limit: Optional[int] = None)
Init offline message table strategy.
Arguments:
fallback_gas_limit
: fallback gas limit, defaults to None.block_limit
: block limit, defaults to None.
update_entry
def update_entry(transaction_type: str, gas_limit: int)
Update the entry of the transaction.
Arguments:
tx
: transaction.
Returns:
Estimated transaction gas.
block_gas_limit
def block_gas_limit() ->int
Get the block gas limit.
Returns:
Block gas limit.