From 4307dc5c164f659909911336190b3e29c4b08b05 Mon Sep 17 00:00:00 2001 From: linnefromice Date: Wed, 10 Jan 2024 21:04:07 +0900 Subject: [PATCH] debug --- src/backend/src/types.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/src/types.rs b/src/backend/src/types.rs index b414757..2f4f0a4 100644 --- a/src/backend/src/types.rs +++ b/src/backend/src/types.rs @@ -9,10 +9,15 @@ pub struct Snapshot { } impl ic_stable_structures::Storable for Snapshot { fn from_bytes(bytes: std::borrow::Cow<[u8]>) -> Self { + ic_cdk::println!("from_bytes"); + ic_cdk::println!("{:x?}", bytes); Decode!(bytes.as_ref(), Self).unwrap() } fn to_bytes(&self) -> std::borrow::Cow<[u8]> { - Cow::Owned(Encode!(self).unwrap()) + let bytes = Encode!(self).unwrap(); + ic_cdk::println!("to_bytes"); + ic_cdk::println!("{:x?}", bytes); + Cow::Owned(bytes) } } impl ic_stable_structures::BoundedStorable for Snapshot {