alan-turing-institute / trustchain

Trustworthy decentralised PKI
https://alan-turing-institute.github.io/trustchain/
Apache License 2.0
9 stars 4 forks source link

Run fetch_bundle futures concurrently #111

Open thobson88 opened 1 year ago

thobson88 commented 1 year ago

The IONVerifier implementation of fetch_bundle() calls async methods to i) resolve the DID and ii) locate the relevant Bitcoin transaction:

pub async fn fetch_bundle(&self, did: &str) -> Result<(), VerifierError> {
    let (did_doc, did_doc_meta) = self.resolve_did(did).await?;
    let (block_hash, tx_index) = self.locate_transaction(did).await?;
    ...

Currently these calls are made in sequence, but we would like to have the two futures run concurrently, e.g. by using the futures::join! macro.