Skip to content

Commit e9ba5ce

Browse files
committed
feat(aggregator-client): make the crate wasm compatible
1 parent cfa402c commit e9ba5ce

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

internal/mithril-aggregator-client/src/query/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ pub enum QueryMethod {
1111
Post,
1212
}
1313

14-
// Todo: wasm compatibility
15-
#[async_trait::async_trait]
14+
#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))]
15+
#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)]
1616
pub trait AggregatorQuery {
1717
type Response: DeserializeOwned;
1818
type Body: serde::Serialize + Sized;

internal/mithril-aggregator-client/src/query/certificate/get_certificate_details.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use anyhow::anyhow;
2+
use async_trait::async_trait;
23
use reqwest::StatusCode;
34
use slog::debug;
45

@@ -20,7 +21,8 @@ impl CertificateDetailsQuery {
2021
}
2122
}
2223

23-
#[async_trait::async_trait]
24+
#[cfg_attr(target_family = "wasm", async_trait(?Send))]
25+
#[cfg_attr(not(target_family = "wasm"), async_trait)]
2426
impl AggregatorQuery for CertificateDetailsQuery {
2527
type Response = Option<CertificateMessage>;
2628
type Body = ();

0 commit comments

Comments
 (0)