Skip to content

Commit

Permalink
fix: import networks singltone inside get_network_height because of c…
Browse files Browse the repository at this point in the history
…ircular import
  • Loading branch information
tmcgroul committed Feb 12, 2024
1 parent 4720e1e commit 33520c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ape_subsquid/query.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Iterator, Optional, Type, TypeVar, cast

from ape import networks
from ape.api import BlockAPI, ReceiptAPI
from ape.api.query import (
AccountTransactionQuery,
Expand Down Expand Up @@ -217,6 +216,9 @@ def gateway_ingest(gateway: SubsquidGateway, network: str, query: Query) -> Iter


def get_network_height() -> int:
# fix circular import
from ape import networks

network = get_network(networks)
height = gateway.get_height(network)
return height

0 comments on commit 33520c2

Please sign in to comment.