Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asyncio wrappers for CosmPy transactions #14

Open
jrriehl opened this issue Nov 21, 2022 · 1 comment
Open

Asyncio wrappers for CosmPy transactions #14

jrriehl opened this issue Nov 21, 2022 · 1 comment

Comments

@jrriehl
Copy link
Contributor

jrriehl commented Nov 21, 2022

No description provided.

@jrriehl
Copy link
Contributor Author

jrriehl commented Nov 22, 2022

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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant