From 94cde130977e881dccf24f814e574be8f7fce4bc Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 28 Aug 2024 18:57:19 -0400 Subject: [PATCH] mirror touchup --- src/dexorder/bin/mirror.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dexorder/bin/mirror.py b/src/dexorder/bin/mirror.py index 9ff331e..7186389 100644 --- a/src/dexorder/bin/mirror.py +++ b/src/dexorder/bin/mirror.py @@ -175,15 +175,16 @@ async def main(): await asyncio.gather(*txs) log.info('Pools deployed') - mirror_pools = [] + mirror_pool_list = [] # log.debug(f'Getting pool info {" ".join(pools)}') for pool in pools: mirror_addr, mirror_inverted = await mirrorenv.pools(pool) if mirror_addr == ADDRESS_0: raise ValueError(f'Pool {pool} was not successfully mirrored') log.debug(f'\t{pool} => {mirror_addr} inverted={mirror_inverted}') - mirror_pools.append((mirror_addr, mirror_inverted)) - await write_metadata(pools, mirror_pools) + mirror_pool_list.append((mirror_addr, mirror_inverted)) + await write_metadata(pools, mirror_pool_list) + mirror_pools = dict(zip(pools, mirror_pool_list)) if update_once: log.info(f'Updating pools once') @@ -203,7 +204,8 @@ async def main(): tx = await mirrorenv.transact.updatePool(pool, price, gas=1_000_000) # this is a B.S. gas number await tx.wait() last_prices[pool] = price - log.debug(f'Mirrored {pool} {price}') + addr, inverted = mirror_pools[pool] + log.debug(f'Mirrored {addr} {price}') except Exception as x: log.debug(f'Could not update {pool}: {x}') continue