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

Expose transaction::TransactionProgress as public #400

Closed
boyswan opened this issue Jan 18, 2022 · 2 comments
Closed

Expose transaction::TransactionProgress as public #400

boyswan opened this issue Jan 18, 2022 · 2 comments

Comments

@boyswan
Copy link
Contributor

boyswan commented Jan 18, 2022

Currently there's no submit_then_watch to work with offline signed Tx's - using sign_and_submit_then_watch requires the use of a signer.

By exposing transaction::TransactionProgress I can have my own implementation of submit_then_watch without being bound to signing in subxt.

async fn submit_then_watch<'client>(
    client: &'client Client<DefaultConfig>,
    ext_hash: H256,
    signed_tx: Bytes,
) -> Result<TransactionProgress<'client, DefaultConfig>, parity_scale_codec::Error> {
    let sub = client.rpc().watch_extrinsic(signed_tx).await.unwrap();
    Ok(TransactionProgress::new(sub, client, ext_hash))
}

let events = submit_then_watch(&api, ext_hash, signed_tx)
      .await
      .unwrap()
      .wait_for_finalized_success()
      .await
      .unwrap();
@jsdw
Copy link
Collaborator

jsdw commented Jan 18, 2022

Sounds good to me! Happy to accept a PR to expose this, otherwise I'll get around to it quite soon :)

@boyswan
Copy link
Contributor Author

boyswan commented Jan 18, 2022

#401

@boyswan boyswan closed this as completed Jan 19, 2022
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

2 participants