Skip to content

Commit

Permalink
allow passing in cache to use
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNineteen committed Nov 15, 2022
1 parent 68e21cf commit fec4426
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/driftpy/clearing_house_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fec4426

Please sign in to comment.