Skip to content

Commit 33e4f2d

Browse files
authored
fix(client)!: use AsyncGrpcCall also in BlobApi::submit (#760)
1 parent 70b87de commit 33e4f2d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

client/src/blob.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use futures_util::{Stream, StreamExt};
77

88
use crate::api::blob::BlobsAtHeight;
99
use crate::client::ClientInner;
10+
use crate::state::AsyncGrpcCall;
1011
use crate::tx::{TxConfig, TxInfo};
1112
use crate::types::nmt::{Namespace, NamespaceProof};
1213
use crate::types::{Blob, Commitment};
@@ -53,8 +54,17 @@ impl BlobApi {
5354
/// ```
5455
///
5556
/// [`StateApi::submit_pay_for_blob`]: crate::api::StateApi::submit_pay_for_blob
56-
pub async fn submit(&self, blobs: &[Blob], cfg: TxConfig) -> Result<TxInfo> {
57-
Ok(self.inner.grpc()?.submit_blobs(blobs, cfg).await?)
57+
pub fn submit(&self, blobs: &[Blob], cfg: TxConfig) -> AsyncGrpcCall<TxInfo> {
58+
let inner = self.inner.clone();
59+
let blobs = blobs.to_vec();
60+
61+
AsyncGrpcCall::new(move |context| async move {
62+
Ok(inner
63+
.grpc()?
64+
.submit_blobs(&blobs, cfg)
65+
.context(&context)
66+
.await?)
67+
})
5868
}
5969

6070
/// Retrieves the blob by commitment under the given namespace and height.

0 commit comments

Comments
 (0)