From 105b71e728869435addeab677477acda7009560f Mon Sep 17 00:00:00 2001 From: Moody Salem Date: Mon, 6 May 2024 07:40:41 -0400 Subject: [PATCH] add comment and make serde impl crate --- src/call_trait.cairo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/call_trait.cairo b/src/call_trait.cairo index d70ca9b..802a86a 100644 --- a/src/call_trait.cairo +++ b/src/call_trait.cairo @@ -7,7 +7,9 @@ use starknet::account::{Call}; use starknet::{ContractAddress}; use starknet::{SyscallResult, syscalls::call_contract_syscall}; -pub impl HashSerializable, +HashStateTrait, +Drop> of Hash<@T, S> { +// Care must be taken when using this implementation: Serde of the type T must be safe for hashing. +// This means that no two values of type T have the same serialization. +pub(crate) impl HashSerializable, +HashStateTrait, +Drop> of Hash<@T, S> { fn update_state(mut state: S, value: @T) -> S { let mut arr = array![]; Serde::serialize(value, ref arr);