Skip to content

Fix async problem found in deposit_to_asset_bank#129

Merged
nikita-seedlabs merged 1 commit intonikita/readonly_tokenfrom
kevin/readonly_token
Jun 13, 2025
Merged

Fix async problem found in deposit_to_asset_bank#129
nikita-seedlabs merged 1 commit intonikita/readonly_tokenfrom
kevin/readonly_token

Conversation

@kevin-ip
Copy link
Copy Markdown
Contributor

@kevin-ip kevin-ip commented Jun 13, 2025

Since self.__rpc_calls.deposit_to_asset_bank is a blocking call, let's wrap it in sync_to_async to unblock the event loop

@kevin-ip kevin-ip requested a review from a team June 13, 2025 23:42
Comment thread python/example/main.py
# await client.deposit_to_asset_bank("USDC", 10000000000, "0x0000AnyWallet")
# example of how to deposit into own account for own wallet
client.deposit_to_asset_bank("USDC", 10000000000, sui_wallet.sui_address)
await client.deposit_to_asset_bank("USDC", 10000000000, sui_wallet.sui_address)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be async in the first place?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary but the majority of the methods in the client are defined as async. It's better to be consistent.

@kevin-ip kevin-ip force-pushed the kevin/readonly_token branch from b77825c to b44bad5 Compare June 13, 2025 23:45
@nikita-seedlabs nikita-seedlabs merged commit ecaf8df into nikita/readonly_token Jun 13, 2025
@nikita-seedlabs nikita-seedlabs deleted the kevin/readonly_token branch June 13, 2025 23:54
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

Successfully merging this pull request may close these issues.

2 participants