Skip to content

Commit

Permalink
add comment and make serde impl crate
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed May 6, 2024
1 parent e34d55e commit 105b71e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/call_trait.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use starknet::account::{Call};
use starknet::{ContractAddress};
use starknet::{SyscallResult, syscalls::call_contract_syscall};

pub impl HashSerializable<T, S, +Serde<T>, +HashStateTrait<S>, +Drop<S>> 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<T, S, +Serde<T>, +HashStateTrait<S>, +Drop<S>> of Hash<@T, S> {
fn update_state(mut state: S, value: @T) -> S {
let mut arr = array![];
Serde::serialize(value, ref arr);
Expand Down

0 comments on commit 105b71e

Please sign in to comment.