From 68ca0a8318570af989ede1b7c58971496e777469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Delabrouille?= Date: Tue, 28 Nov 2023 18:29:53 +0100 Subject: [PATCH] fix: tests and ensure_no_std --- crates/starknet-types-core/Cargo.toml | 1 + crates/starknet-types-core/src/felt/mod.rs | 2 +- crates/starknet-types-rpc/Cargo.toml | 2 +- ensure_no_std/Cargo.toml | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/starknet-types-core/Cargo.toml b/crates/starknet-types-core/Cargo.toml index 6b4d4ba..3bbfbbf 100644 --- a/crates/starknet-types-core/Cargo.toml +++ b/crates/starknet-types-core/Cargo.toml @@ -43,6 +43,7 @@ arbitrary = ["std", "dep:arbitrary"] parity-scale-codec = ["dep:parity-scale-codec"] serde = ["dep:serde"] num-traits = [] +alloc = ["serde?/alloc"] [dev-dependencies] proptest = "1.1.0" diff --git a/crates/starknet-types-core/src/felt/mod.rs b/crates/starknet-types-core/src/felt/mod.rs index e2f5b13..0cfbcf2 100644 --- a/crates/starknet-types-core/src/felt/mod.rs +++ b/crates/starknet-types-core/src/felt/mod.rs @@ -980,8 +980,8 @@ mod errors { #[cfg(test)] mod test { use super::alloc::{format, string::String, vec::Vec}; + use super::felt_arbitrary::nonzero_felt; use super::*; - use crate::felt_arbitrary::nonzero_felt; use core::ops::Shl; use proptest::prelude::*; #[cfg(feature = "serde")] diff --git a/crates/starknet-types-rpc/Cargo.toml b/crates/starknet-types-rpc/Cargo.toml index 38ae114..4760201 100644 --- a/crates/starknet-types-rpc/Cargo.toml +++ b/crates/starknet-types-rpc/Cargo.toml @@ -16,7 +16,7 @@ default = ["std"] std = ["serde/std", "starknet-types-core/std"] [dependencies] -starknet-types-core = { path = "../starknet-types-core", default-features = false, features = ["serde"] } +starknet-types-core = { path = "../starknet-types-core", default-features = false, features = ["serde", "alloc"] } serde = { version = "1", default-features = false, features = ["derive"] } [dev-dependencies] diff --git a/ensure_no_std/Cargo.toml b/ensure_no_std/Cargo.toml index 4d13191..84bc500 100644 --- a/ensure_no_std/Cargo.toml +++ b/ensure_no_std/Cargo.toml @@ -9,6 +9,7 @@ starknet-types-core = { path = "../crates/starknet-types-core", default-features "serde", "curve", "parity-scale-codec", + "num-traits", ] } starknet-types-rpc = { path = "../crates/starknet-types-rpc", default-features = false } wee_alloc = "0.4.5"