Skip to content

Commit 5967437

Browse files
committed
fix wasm build
1 parent 07c78f8 commit 5967437

File tree

1 file changed

+6
-3
lines changed
  • rust/signed_doc/src/tests_utils

1 file changed

+6
-3
lines changed

rust/signed_doc/src/tests_utils/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ pub mod rep_nomination_form_template;
3131
pub mod rep_profile;
3232
pub mod rep_profile_form_template;
3333

34-
use std::sync::LazyLock;
35-
3634
pub use brand_parameters::brand_parameters_doc;
3735
pub use brand_parameters_form_template::brand_parameters_form_template_doc;
3836
pub use campaign_parameters::campaign_parameters_doc;
@@ -121,7 +119,12 @@ pub fn build_verify_and_publish(
121119
provider: &mut TestCatalystProvider,
122120
gen_fn: impl FnOnce(&mut TestCatalystProvider) -> anyhow::Result<CatalystSignedDocument>,
123121
) -> anyhow::Result<CatalystSignedDocument> {
124-
static VALIDATOR: LazyLock<Validator> = LazyLock::new(Validator::new);
122+
#[cfg(not(target_arch = "wasm32"))]
123+
static VALIDATOR: std::sync::LazyLock<Validator> = std::sync::LazyLock::new(Validator::new);
124+
#[cfg(target_arch = "wasm32")]
125+
#[allow(non_snake_case)]
126+
let VALIDATOR = Validator::new();
127+
125128

126129
let doc = gen_fn(provider)?;
127130
VALIDATOR.validate(&doc, provider)?;

0 commit comments

Comments
 (0)