Skip to content

Commit

Permalink
Merge pull request #607 from tellor-io/fix-gas-fetch-err
Browse files Browse the repository at this point in the history
Fix gas fetch err
  • Loading branch information
akremstudy authored Feb 22, 2023
2 parents b37b714 + 400639b commit 87eced2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/telliot_feeds/reporters/custom_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
self.max_fee = max_fee
self.priority_fee = priority_fee
self.legacy_gas_price = legacy_gas_price
self.gas_price_speed = gas_price_speed
self.gas_price_speed = [gas_price_speed]
self.trb_usd_median_feed = trb_usd_median_feed
self.eth_usd_median_feed = eth_usd_median_feed
self.custom_contract = custom_contract
Expand Down
8 changes: 4 additions & 4 deletions src/telliot_feeds/reporters/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from chained_accounts import ChainedAccount
from eth_utils import to_checksum_address
from telliot_core.contract.contract import Contract
from telliot_core.gas.legacy_gas import ethgasstation
from telliot_core.gas.legacy_gas import legacy_gas_station
from telliot_core.model.endpoints import RPCEndpoint
from telliot_core.utils.key_helpers import lazy_unlock_account
from telliot_core.utils.response import error_status
Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(
self.max_fee = max_fee
self.priority_fee = priority_fee
self.legacy_gas_price = legacy_gas_price
self.gas_price_speed = gas_price_speed
self.gas_price_speed = [gas_price_speed]
self.trb_usd_median_feed = trb_usd_median_feed
self.eth_usd_median_feed = eth_usd_median_feed
self.wait_period = wait_period
Expand Down Expand Up @@ -108,9 +108,9 @@ async def check_reporter_lock(self) -> ResponseStatus:

return status

async def fetch_gas_price(self, speed: Union[tuple[str], str] = "average") -> Optional[int]:
async def fetch_gas_price(self, speed: Optional[Any] = None) -> Optional[int]:
"""Fetch gas price from ethgasstation in gwei."""
return await ethgasstation(speed) # type: ignore
return await legacy_gas_station(chain_id=self.chain_id, speed_parse_lis=speed) # type: ignore

async def ensure_staked(self) -> Tuple[bool, ResponseStatus]:
"""Make sure the current user is staked
Expand Down
4 changes: 2 additions & 2 deletions src/telliot_feeds/reporters/tellor_flex.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(
self.wait_period = wait_period
self.priority_fee = priority_fee
self.legacy_gas_price = legacy_gas_price
self.gas_price_speed = gas_price_speed
self.gas_price_speed = [gas_price_speed]
self.autopaytip = 0
self.staked_amount: Optional[float] = None
self.qtag_selected = False if self.datafeed is None else True
Expand All @@ -84,7 +84,7 @@ def __init__(
self.account: ChainedAccount = account
assert self.acct_addr == to_checksum_address(self.account.address)

async def fetch_gas_price(self, speed: Optional[Union[tuple[str], str]] = None) -> Optional[int]:
async def fetch_gas_price(self, speed: Optional[Any] = None) -> Optional[int]:
"""Fetch estimated gas prices.
Expected to return gas price in gwei."""
Expand Down

0 comments on commit 87eced2

Please sign in to comment.