Skip to content

Commit

Permalink
derive Serde trait to storage proof structs (#294)
Browse files Browse the repository at this point in the history
In order to use those structs as calldata in contracts, Serde trait must
be implemented
  • Loading branch information
feltroidprime authored Apr 16, 2024
1 parent 617087b commit fe337ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/merkle_tree/src/storage_proof.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::hash::HashStateTrait;
use core::pedersen::PedersenTrait;
use core::poseidon::PoseidonTrait;

#[derive(Drop)]
#[derive(Drop, Serde)]
pub struct BinaryNode {
left: felt252,
right: felt252,
Expand All @@ -15,7 +15,7 @@ pub impl BinaryNodeImpl of BinaryNodeTrait {
}
}

#[derive(Drop, Copy)]
#[derive(Drop, Copy, Serde)]
pub struct EdgeNode {
path: felt252,
child: felt252,
Expand All @@ -29,13 +29,13 @@ pub impl EdgeNodeImpl of EdgeNodeTrait {
}
}

#[derive(Drop)]
#[derive(Drop, Serde)]
pub enum TrieNode {
Binary: BinaryNode,
Edge: EdgeNode,
}

#[derive(Destruct)]
#[derive(Destruct, Serde)]
pub struct ContractData {
class_hash: felt252,
nonce: felt252,
Expand All @@ -55,7 +55,7 @@ pub impl ContractDataImpl of ContractDataTrait {
}
}

#[derive(Destruct)]
#[derive(Destruct, Serde)]
pub struct ContractStateProof {
class_commitment: felt252,
contract_proof: Array<TrieNode>,
Expand Down

0 comments on commit fe337ab

Please sign in to comment.