Skip to content

Commit 244b542

Browse files
committed
Fix compilation
1 parent 712f20a commit 244b542

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

ledger/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ tuple-map = "0.4.0"
9393
wasm-bindgen = "=0.2.92"
9494
wasm-bindgen-test = "0.3"
9595
web-sys = { version = "0.3", features = ["Blob", "DedicatedWorkerGlobalScope", "MessageEvent", "Url", "Worker", "WorkerType", "WorkerOptions", "console", "Window", "Performance" ] }
96-
tokio = { version = "1.37", features = ["macros"] }
96+
tokio = { version = "1", features = ["macros", "rt"] }
9797

9898
[features]
9999
# Put zstd behind a feature, cargo always re-compile it without touching the files

ledger/src/proofs/provers.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,13 @@ mod prover_makers {
359359
}
360360
}
361361

362+
#[cfg(test)]
362363
pub fn make_blocking(
363364
block_verifier_index: Option<BlockVerifier>,
364365
tx_verifier_index: Option<TransactionVerifier>,
365366
) -> Self {
366367
tokio::runtime::Handle::current()
367-
.block_on(async { Self::make(block_verifier_index, tx_verifier_index).await });
368+
.block_on(async { Self::make(block_verifier_index, tx_verifier_index).await })
368369
}
369370
}
370371

@@ -382,9 +383,10 @@ mod prover_makers {
382383
}
383384
}
384385

386+
#[cfg(test)]
385387
pub fn make_blocking(tx_verifier_index: Option<TransactionVerifier>) -> Self {
386388
tokio::runtime::Handle::current()
387-
.block_on(async { Self::make(tx_verifier_index).await });
389+
.block_on(async { Self::make(tx_verifier_index).await })
388390
}
389391
}
390392

@@ -407,9 +409,10 @@ mod prover_makers {
407409
}
408410
}
409411

412+
#[cfg(test)]
410413
pub fn make_blocking(tx_verifier_index: Option<TransactionVerifier>) -> Self {
411414
tokio::runtime::Handle::current()
412-
.block_on(async { Self::make(tx_verifier_index).await });
415+
.block_on(async { Self::make(tx_verifier_index).await })
413416
}
414417
}
415418
}

ledger/src/proofs/verifiers.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl BlockVerifier {
231231

232232
#[cfg(target_family = "wasm")]
233233
impl BlockVerifier {
234-
pub async fn make() -> Self {
234+
async fn make_impl() -> Self {
235235
if let Some(v) = BLOCK_VERIFIER.get() {
236236
v.clone()
237237
} else {
@@ -241,6 +241,15 @@ impl BlockVerifier {
241241
BLOCK_VERIFIER.get_or_init(move || verifier).clone()
242242
}
243243
}
244+
245+
#[cfg(not(test))]
246+
pub async fn make() -> Self {
247+
Self::make_impl().await
248+
}
249+
#[cfg(test)]
250+
pub fn make() -> Self {
251+
tokio::runtime::Handle::current().block_on(async { Self::make_impl().await })
252+
}
244253
}
245254

246255
#[cfg(not(target_family = "wasm"))]

0 commit comments

Comments
 (0)