uAgents
uAgents copied to clipboard
Asyncio wrappers for CosmPy transactions
trafficstars
Currently we use this to wrap the registration transaction in an async function, but it would probably be better to come up with a standard way of doing this, maybe even fro eventual addition to the CosmPy repo:
logging.info(f"Registering Agent {self._name}...")
transaction = await self._loop.run_in_executor(
None,
functools.partial(
self._reg_contract.execute,
msg,
ctx.wallet,
funds=f"{REGISTRATION_FEE}{REGISTRATION_DENOM}",
),
)
await self._loop.run_in_executor(None, transaction.wait_to_complete)
logging.info(f"Registering Agent {self._name}...complete")
Is this still valid? The network module has async registration capabilities and as far as I know the only part in which you would need something like this is when using wait_for_tx_to_complete() so I'd say we are good for now.
Do you have another specific use-case in mind?
Yes, this was completed quite a while ago. Closing now.