@@ -18,18 +18,20 @@ pub type Epoch = u64;
1818pub type ForkVersion = [ u8 ; 4 ] ;
1919pub type DomainType = [ u8 ; 4 ] ;
2020
21- #[ derive( Debug , Clone ) ]
21+ #[ derive( Debug , Clone , BorshSchema ) ]
2222pub struct PublicKeyBytes ( pub [ u8 ; PUBLIC_KEY_BYTES_LEN ] ) ;
23- #[ derive( Debug , Clone ) ]
23+ #[ derive( Debug , Clone , BorshSchema ) ]
2424pub struct SignatureBytes ( pub [ u8 ; SIGNATURE_BYTES_LEN ] ) ;
25- #[ derive( Debug , Clone ) ]
25+ #[ derive( Debug , Clone , BorshSchema ) ]
2626pub struct SyncCommitteeBits ( pub [ u8 ; SYNC_COMMITTEE_BITS_SIZE_IN_BYTES ] ) ;
2727
2828arr_wrapper_impl_tree_hash_and_borsh ! ( PublicKeyBytes , PUBLIC_KEY_BYTES_LEN ) ;
2929arr_wrapper_impl_tree_hash_and_borsh ! ( SignatureBytes , SIGNATURE_BYTES_LEN ) ;
3030arr_wrapper_impl_tree_hash_and_borsh ! ( SyncCommitteeBits , SYNC_COMMITTEE_BITS_SIZE_IN_BYTES ) ;
3131
32- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize , tree_hash_derive:: TreeHash ) ]
32+ #[ derive(
33+ Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize , tree_hash_derive:: TreeHash ,
34+ ) ]
3335#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
3436pub struct BeaconBlockHeader {
3537 #[ cfg_attr( not( target_arch = "wasm32" ) , serde( with = "serde_utils::quoted_u64" ) ) ]
@@ -53,7 +55,7 @@ pub struct SigningData {
5355 pub domain : H256 ,
5456}
5557
56- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize ) ]
58+ #[ derive( Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize ) ]
5759#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
5860pub struct ExtendedBeaconBlockHeader {
5961 pub header : BeaconBlockHeader ,
@@ -72,48 +74,50 @@ impl From<HeaderUpdate> for ExtendedBeaconBlockHeader {
7274 }
7375}
7476
75- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize ) ]
77+ #[ derive( Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize ) ]
7678#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
7779pub struct SyncCommitteePublicKeys ( pub Vec < PublicKeyBytes > ) ;
7880vec_wrapper_impl_tree_hash ! ( SyncCommitteePublicKeys ) ;
7981
80- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize , tree_hash_derive:: TreeHash ) ]
82+ #[ derive(
83+ Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize , tree_hash_derive:: TreeHash ,
84+ ) ]
8185#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
8286pub struct SyncCommittee {
8387 pub pubkeys : SyncCommitteePublicKeys ,
8488 pub aggregate_pubkey : PublicKeyBytes ,
8589}
8690
87- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize ) ]
91+ #[ derive( Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize ) ]
8892#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
8993pub struct SyncAggregate {
9094 pub sync_committee_bits : SyncCommitteeBits ,
9195 pub sync_committee_signature : SignatureBytes ,
9296}
9397
94- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize ) ]
98+ #[ derive( Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize ) ]
9599#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
96100pub struct SyncCommitteeUpdate {
97101 pub next_sync_committee : SyncCommittee ,
98102 pub next_sync_committee_branch : Vec < H256 > ,
99103}
100104
101- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize ) ]
105+ #[ derive( Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize ) ]
102106#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
103107pub struct HeaderUpdate {
104108 pub beacon_header : BeaconBlockHeader ,
105109 pub execution_block_hash : H256 ,
106110 pub execution_hash_branch : Vec < H256 > ,
107111}
108112
109- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize ) ]
113+ #[ derive( Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize ) ]
110114#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
111115pub struct FinalizedHeaderUpdate {
112116 pub header_update : HeaderUpdate ,
113117 pub finality_branch : Vec < H256 > ,
114118}
115119
116- #[ derive( Debug , Clone , BorshDeserialize , BorshSerialize ) ]
120+ #[ derive( Debug , Clone , BorshDeserialize , BorshSchema , BorshSerialize ) ]
117121#[ cfg_attr( not( target_arch = "wasm32" ) , derive( Serialize , Deserialize ) ) ]
118122pub struct LightClientUpdate {
119123 pub attested_beacon_header : BeaconBlockHeader ,
@@ -124,7 +128,7 @@ pub struct LightClientUpdate {
124128 pub sync_committee_update : Option < SyncCommitteeUpdate > ,
125129}
126130
127- #[ derive( Clone , BorshDeserialize , BorshSerialize ) ]
131+ #[ derive( Clone , BorshDeserialize , BorshSchema , BorshSerialize ) ]
128132pub struct LightClientState {
129133 pub finalized_beacon_header : ExtendedBeaconBlockHeader ,
130134 pub current_sync_committee : SyncCommittee ,
0 commit comments