From a6d289b2449cd0f4fd3c8a8509eaa37bba69e454 Mon Sep 17 00:00:00 2001 From: David Komer <6406986+dakom@users.noreply.github.com> Date: Mon, 24 Jun 2024 17:11:43 +0300 Subject: [PATCH] order serialization use cosmwasm_std functions --- packages/std/src/iterator.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/std/src/iterator.rs b/packages/std/src/iterator.rs index 36a121681d..41f043a093 100644 --- a/packages/std/src/iterator.rs +++ b/packages/std/src/iterator.rs @@ -36,6 +36,8 @@ impl From for i32 { #[cfg(test)] mod tests { + use crate::{from_json, to_json_vec}; + use super::*; #[test] @@ -43,22 +45,16 @@ mod tests { let ascending_bytes = br#""ascending""#; let descending_bytes = br#""descending""#; - assert_eq!( - serde_json::to_vec(&Order::Ascending).unwrap(), - ascending_bytes - ); - assert_eq!( - serde_json::to_vec(&Order::Descending).unwrap(), - descending_bytes - ); + assert_eq!(to_json_vec(&Order::Ascending).unwrap(), ascending_bytes); + assert_eq!(to_json_vec(&Order::Descending).unwrap(), descending_bytes); assert_eq!( - serde_json::from_slice::(ascending_bytes).unwrap(), + from_json::(ascending_bytes).unwrap(), Order::Ascending ); assert_eq!( - serde_json::from_slice::(descending_bytes).unwrap(), + from_json::(descending_bytes).unwrap(), Order::Descending ); }