mirror touchup

This commit is contained in:
tim
2024-08-28 18:57:19 -04:00
parent a39eb4021f
commit 94cde13097

View File

@@ -175,15 +175,16 @@ async def main():
await asyncio.gather(*txs) await asyncio.gather(*txs)
log.info('Pools deployed') log.info('Pools deployed')
mirror_pools = [] mirror_pool_list = []
# log.debug(f'Getting pool info {" ".join(pools)}') # log.debug(f'Getting pool info {" ".join(pools)}')
for pool in pools: for pool in pools:
mirror_addr, mirror_inverted = await mirrorenv.pools(pool) mirror_addr, mirror_inverted = await mirrorenv.pools(pool)
if mirror_addr == ADDRESS_0: if mirror_addr == ADDRESS_0:
raise ValueError(f'Pool {pool} was not successfully mirrored') raise ValueError(f'Pool {pool} was not successfully mirrored')
log.debug(f'\t{pool} => {mirror_addr} inverted={mirror_inverted}') log.debug(f'\t{pool} => {mirror_addr} inverted={mirror_inverted}')
mirror_pools.append((mirror_addr, mirror_inverted)) mirror_pool_list.append((mirror_addr, mirror_inverted))
await write_metadata(pools, mirror_pools) await write_metadata(pools, mirror_pool_list)
mirror_pools = dict(zip(pools, mirror_pool_list))
if update_once: if update_once:
log.info(f'Updating pools 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 tx = await mirrorenv.transact.updatePool(pool, price, gas=1_000_000) # this is a B.S. gas number
await tx.wait() await tx.wait()
last_prices[pool] = price 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: except Exception as x:
log.debug(f'Could not update {pool}: {x}') log.debug(f'Could not update {pool}: {x}')
continue continue