Skip to content

Commit

Permalink
fix(test): curve events attached to wrong loop
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler committed Sep 26, 2023
1 parent 016a2f5 commit 8fee62d
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions y/prices/stable_swap/curve.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import asyncio
import logging
from collections import defaultdict
from contextlib import suppress
from enum import IntEnum
from functools import cached_property
from typing import Dict, List, NoReturn, Optional, Tuple

import a_sync
Expand Down Expand Up @@ -233,12 +233,32 @@ def __init__(self, asynchronous: bool = False) -> None:
self.pools = set()
self.token_to_pool = dict() # lp_token -> pool

self._address_providers_loading = a_sync.Event()
self._address_providers_loaded = a_sync.Event()
self._registries_loaded = a_sync.Event()
self._loaded_registries = set()
self._all_loading = a_sync.Event()
self._all_loaded = a_sync.Event()

@cached_property
def _address_providers_loading(self) -> a_sync.Event:
"""A helper function to ensure the Event is attached to the correct loop."""
return a_sync.Event()

@cached_property
def _address_providers_loaded(self) -> a_sync.Event:
"""A helper function to ensure the Event is attached to the correct loop."""
return a_sync.Event()

@cached_property
def _registries_loaded(self) -> a_sync.Event:
"""A helper function to ensure the Event is attached to the correct loop."""
return a_sync.Event()

@cached_property
def _all_loading(self) -> a_sync.Event:
"""A helper function to ensure the Event is attached to the correct loop."""
return a_sync.Event()

@cached_property
def _all_loaded(self) -> a_sync.Event:
"""A helper function to ensure the Event is attached to the correct loop."""
return a_sync.Event()

def __repr__(self) -> str:
return "<CurveRegistry>"
Expand Down

0 comments on commit 8fee62d

Please sign in to comment.