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 #401

Merged
merged 4 commits into from Jan 19, 2022

Conversation

boyswan
Copy link
Contributor

@boyswan boyswan commented Jan 18, 2022

Exposing transaction::TransactionProgress will allow customs implementation of extrinsic submission 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();

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Jan 18, 2022

User @boyswan, please sign the CLA here.

@boyswan boyswan changed the title Expose transaction::TransactionProgress Expose transaction::TransactionProgress as public Jan 18, 2022
src/transaction.rs Outdated Show resolved Hide resolved
Co-authored-by: James Wilson <james@jsdw.me>
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

LGTM

@jsdw
Copy link
Collaborator

jsdw commented Jan 19, 2022

@boyswan looks like it just needs a cargo +nightly fmt to be run to fix the fmt CI and then it should be good to merge :)

@niklasad1 niklasad1 merged commit 79bf32a into paritytech:master Jan 19, 2022
0623forbidden pushed a commit to DEIPworld/substrate-subxt that referenced this pull request Feb 15, 2022
* Update transaction.rs

* documentation

* Update src/transaction.rs

Co-authored-by: James Wilson <james@jsdw.me>

* fmt

Co-authored-by: James Wilson <james@jsdw.me>
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.

None yet

3 participants