Skip to content

Commit 8a9077b

Browse files
committed
wasm: remove builder for now
1 parent 4a186e3 commit 8a9077b

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

lwk_wasm/src/prices.rs

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,6 @@ impl From<PricesFetcherBuilder> for lwk_wollet::PricesFetcherBuilder {
2626
}
2727
}
2828

29-
#[wasm_bindgen]
30-
impl PricesFetcherBuilder {
31-
/// Create a new PricesFetcherBuilder with default settings
32-
#[wasm_bindgen(constructor)]
33-
#[allow(clippy::new_without_default)]
34-
pub fn new() -> PricesFetcherBuilder {
35-
lwk_wollet::PricesFetcher::builder().into()
36-
}
37-
38-
/// Set the timeout for HTTP requests in seconds
39-
///
40-
/// Default is 10 seconds
41-
pub fn timeout(self, timeout_seconds: u8) -> PricesFetcherBuilder {
42-
self.inner.timeout(timeout_seconds).into()
43-
}
44-
45-
/// Build the PricesFetcher
46-
pub fn build(self) -> Result<PricesFetcher, Error> {
47-
let inner = self.inner.build()?;
48-
Ok(PricesFetcher { inner })
49-
}
50-
}
51-
5229
#[wasm_bindgen]
5330
impl PricesFetcher {
5431
/// Create a new PricesFetcher with default settings
@@ -58,11 +35,6 @@ impl PricesFetcher {
5835
Ok(PricesFetcher { inner })
5936
}
6037

61-
/// Get a builder for configuring the PricesFetcher
62-
pub fn builder() -> PricesFetcherBuilder {
63-
lwk_wollet::PricesFetcher::builder().into()
64-
}
65-
6638
/// Fetch exchange rates for the given currency (e.g., "USD", "EUR", "CHF")
6739
///
6840
/// Returns an ExchangeRates object containing rates from multiple sources and the median
@@ -126,8 +98,8 @@ mod tests {
12698

12799
#[wasm_bindgen_test]
128100
async fn test_prices_fetcher_builder() {
129-
let builder = PricesFetcherBuilder::new();
130-
let fetcher = builder.timeout(15).build().unwrap();
101+
let fetcher = PricesFetcher::new().unwrap();
102+
131103
let rates = fetcher.rates("EUR").await.unwrap();
132104

133105
assert!(rates.median() > 0.0);

0 commit comments

Comments
 (0)