autosign defaults to True; missing order lookup bugfix
This commit is contained in:
@@ -121,7 +121,7 @@ async def main():
|
|||||||
delay = max(0.010, config.polling)
|
delay = max(0.010, config.polling)
|
||||||
update_once = config.polling <= 0
|
update_once = config.polling <= 0
|
||||||
global source_w3
|
global source_w3
|
||||||
source_w3 = await create_w3(config.mirror_source_rpc_url, name='source')
|
source_w3 = await create_w3(config.mirror_source_rpc_url, name='source', autosign=False)
|
||||||
pools = (config.mirror_pools or [])
|
pools = (config.mirror_pools or [])
|
||||||
if not pools:
|
if not pools:
|
||||||
log.error('must configure mirror_pools')
|
log.error('must configure mirror_pools')
|
||||||
@@ -129,7 +129,7 @@ async def main():
|
|||||||
if config.account is None:
|
if config.account is None:
|
||||||
# Dev Account #5
|
# Dev Account #5
|
||||||
config.account = '0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba'
|
config.account = '0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba'
|
||||||
await blockchain.connect(autosign=True, name='target') # autosign on the target chain
|
await blockchain.connect(name='target')
|
||||||
|
|
||||||
mirror_addr = config.mirror_env
|
mirror_addr = config.mirror_env
|
||||||
if mirror_addr is None:
|
if mirror_addr is None:
|
||||||
@@ -160,7 +160,7 @@ async def main():
|
|||||||
if any(result['status'] != 1 for result in results):
|
if any(result['status'] != 1 for result in results):
|
||||||
log.error('Mirroring a token reverted.')
|
log.error('Mirroring a token reverted.')
|
||||||
exit(1)
|
exit(1)
|
||||||
log.info(f'Tokens deployed {results}')
|
log.info(f'Tokens deployed')
|
||||||
|
|
||||||
log.debug(f'Mirroring pools {", ".join(pools)}')
|
log.debug(f'Mirroring pools {", ".join(pools)}')
|
||||||
txs = []
|
txs = []
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ from ..configuration.resolve import resolve_ws_url
|
|||||||
from ..contract import get_contract_data
|
from ..contract import get_contract_data
|
||||||
|
|
||||||
|
|
||||||
async def connect(rpc_url=None, account=NARG, autosign=False, name='default'):
|
async def connect(rpc_url=None, account=NARG, autosign=True, name='default'):
|
||||||
"""
|
"""
|
||||||
connects to the rpc_url and configures context vars
|
connects to the rpc_url and configures context vars
|
||||||
"""
|
"""
|
||||||
@@ -28,7 +28,7 @@ async def connect(rpc_url=None, account=NARG, autosign=False, name='default'):
|
|||||||
return w3
|
return w3
|
||||||
|
|
||||||
|
|
||||||
async def create_w3(rpc_url=None, account=NARG, autosign=False, name='default'):
|
async def create_w3(rpc_url=None, account=NARG, autosign=True, name='default'):
|
||||||
# todo create a proxy w3 that rotates among rpc urls
|
# todo create a proxy w3 that rotates among rpc urls
|
||||||
# self.w3s = tuple(await create_w3(url) for url in rpc_url_or_tag)
|
# self.w3s = tuple(await create_w3(url) for url in rpc_url_or_tag)
|
||||||
# chain_id = self.w3s[0].eth.chain_id
|
# chain_id = self.w3s[0].eth.chain_id
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ def build_wrapper(addr, name, func):
|
|||||||
try:
|
try:
|
||||||
account = current_account.get()
|
account = current_account.get()
|
||||||
except LookupError:
|
except LookupError:
|
||||||
|
account = None
|
||||||
|
if account is None:
|
||||||
raise RuntimeError(f'Cannot invoke transaction {addr}.{name}() without setting an Account.')
|
raise RuntimeError(f'Cannot invoke transaction {addr}.{name}() without setting an Account.')
|
||||||
tx = await func(*args).build_transaction(kwargs)
|
tx = await func(*args).build_transaction(kwargs)
|
||||||
tx['from'] = account.address
|
tx['from'] = account.address
|
||||||
|
|||||||
@@ -67,10 +67,7 @@ class Order:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def of(a, b=None) -> 'Order':
|
def of(a, b=None) -> 'Order':
|
||||||
key = (OrderKey(a.vault, a.order_index) if type(a) is TrancheKey else a) if b is None else OrderKey(a, b)
|
key = (OrderKey(a.vault, a.order_index) if type(a) is TrancheKey else a) if b is None else OrderKey(a, b)
|
||||||
try:
|
return Order.instances[key]
|
||||||
return Order.instances[key]
|
|
||||||
except KeyError:
|
|
||||||
return Order(key)
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user