From fec4426292c2a1153090298b5a1cfcd8f821af35 Mon Sep 17 00:00:00 2001 From: 0xNineteen <0x39015319@gmail.com> Date: Tue, 15 Nov 2022 14:14:43 -0500 Subject: [PATCH] allow passing in cache to use --- src/driftpy/clearing_house_user.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/driftpy/clearing_house_user.py b/src/driftpy/clearing_house_user.py index 13ae9c0e..e356f8ce 100644 --- a/src/driftpy/clearing_house_user.py +++ b/src/driftpy/clearing_house_user.py @@ -66,9 +66,13 @@ def __init__( # get_user # if state = cache => get cached_market else get new market - async def set_cache(self): + async def set_cache(self, CACHE=None): self.cache_is_set = True + if CACHE is not None: + self.CACHE = CACHE + return + self.CACHE = {} state = await get_state_account(self.program) self.CACHE['state'] = state