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

[storagext] Add subscribe flag instead of always waiting for success #428

Closed
Tracked by #415
jmg-duarte opened this issue Oct 4, 2024 · 0 comments · Fixed by #503
Closed
Tracked by #415

[storagext] Add subscribe flag instead of always waiting for success #428

jmg-duarte opened this issue Oct 4, 2024 · 0 comments · Fixed by #503
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@jmg-duarte
Copy link
Collaborator

jmg-duarte commented Oct 4, 2024

Due to paritytech/subxt#1668 we can't blindly trust the following code

// finalized != successful
let xt_events = finalized_xt.wait_for_success().await?;

Adding a subscribe flag should solve this, at the CLI level, we can also offer that.
Something like

storagext-cli --subscribe market add-balance ... # and ignore the subscribe on commands that dont use it
# or
storagext-cli market add-balance --subscribe # which is a bit more of a pain to implement but the cli becomes cleaner\

Use one of:

As for results, since the "non subscribe" means that you don't have a result, maybe Either will help instead of re-inventing it (Result would work but it has the Success/Error intent)

@jmg-duarte jmg-duarte added bug Something isn't working enhancement New feature or request labels Oct 4, 2024
@jmg-duarte jmg-duarte added this to the Phase 2 milestone Oct 4, 2024
@jmg-duarte jmg-duarte changed the title [storagext] Add subscribe flag instead of always expect a success [storagext] Add subscribe flag instead of always waiting for success Oct 4, 2024
@neutrinoks neutrinoks linked a pull request Oct 14, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
2 participants