Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

derive Serde trait to storage proof structs #294

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading