Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazabbas committed May 9, 2024
1 parent 5cede6c commit ba189cf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
12 changes: 7 additions & 5 deletions pyth_observer/check/price_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ def error_message(self) -> dict:
"type": "PriceFeedCheck",
"symbol": self.__state.symbol,
"latest_trading_slot": self.__state.latest_trading_slot,
"block_slot": self.__state.latest_block_slot
"block_slot": self.__state.latest_block_slot,
}


class PriceFeedCoinGeckoCheck(PriceFeedCheck):
def __init__(self, state: PriceFeedState, config: PriceFeedCheckConfig):
self.__state = state
Expand Down Expand Up @@ -130,7 +131,7 @@ def error_message(self) -> dict:
"type": "PriceFeedCheck",
"symbol": self.__state.symbol,
"pyth_price": self.__state.price_aggregate,
"coingecko_price": self.__state.coingecko_price
"coingecko_price": self.__state.coingecko_price,
}


Expand Down Expand Up @@ -159,9 +160,10 @@ def error_message(self) -> dict:
"msg": f"{self.__state.symbol} confidence interval is too low.",
"type": "PriceFeedCheck",
"symbol": self.__state.symbol,
"confidence_interval": self.__state.confidence_interval_aggregate
"confidence_interval": self.__state.confidence_interval_aggregate,
}


class PriceFeedCrossChainOnlineCheck(PriceFeedCheck):
def __init__(self, state: PriceFeedState, config: PriceFeedCheckConfig):
self.__state = state
Expand Down Expand Up @@ -214,7 +216,7 @@ def error_message(self) -> dict:
"msg": f"{self.__state.symbol} isn't online at the price service.",
"type": "PriceFeedCheck",
"symbol": self.__state.symbol,
"last_publish_time": publish_time.format('YYYY-MM-DD HH:mm:ss ZZ')
"last_publish_time": publish_time.format("YYYY-MM-DD HH:mm:ss ZZ"),
}


Expand Down Expand Up @@ -275,7 +277,7 @@ def error_message(self) -> dict:
"type": "PriceFeedCheck",
"symbol": self.__state.symbol,
"price": self.__state.price_aggregate,
"price_at_price_service": price
"price_at_price_service": price,
}


Expand Down
8 changes: 4 additions & 4 deletions pyth_observer/check/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def error_message(self) -> dict:
"publisher": self.__state.publisher_name,
"symbol": self.__state.symbol,
"publisher_price": f"{self.__state.price} ± {self.__state.confidence_interval}",
"aggregate_price": f"{self.__state.price_aggregate} ± {self.__state.confidence_interval_aggregate}"
"aggregate_price": f"{self.__state.price_aggregate} ± {self.__state.confidence_interval_aggregate}",
}


Expand Down Expand Up @@ -123,7 +123,7 @@ def error_message(self) -> dict:
"publisher": self.__state.publisher_name,
"symbol": self.__state.symbol,
"price": self.__state.price,
"confidence_interval": self.__state.confidence_interval
"confidence_interval": self.__state.confidence_interval,
}


Expand Down Expand Up @@ -158,7 +158,7 @@ def error_message(self) -> dict:
"publisher": self.__state.publisher_name,
"symbol": self.__state.symbol,
"publisher_slot": self.__state.slot,
"aggregate_slot": self.__state.aggregate_slot
"aggregate_slot": self.__state.aggregate_slot,
}


Expand Down Expand Up @@ -207,7 +207,7 @@ def error_message(self) -> dict:
"symbol": self.__state.symbol,
"publisher_price": f"{self.__state.price} ± {self.__state.confidence_interval}",
"aggregate_price": f"{self.__state.price_aggregate} ± {self.__state.confidence_interval_aggregate}",
"deviation": deviation
"deviation": deviation,
}

# Returns the distance between the aggregate price and the closest side of the publisher's confidence interval
Expand Down
1 change: 1 addition & 0 deletions pyth_observer/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

load_dotenv()


class Context(TypedDict):
network: str
publishers: Dict[str, Publisher]
Expand Down

0 comments on commit ba189cf

Please sign in to comment.