File tree Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Expand file tree Collapse file tree 3 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pub trait BenchSetup: ConfigState + Default {
3939
4040 fn default_space ( keys : Vec < ( Pubkey , bool ) > ) -> usize {
4141 ( Self :: max_space ( )
42- . checked_add ( ConfigKeys :: serialized_size ( keys) )
42+ . checked_add ( bincode :: serialized_size ( & ConfigKeys { keys } ) . unwrap ( ) )
4343 . unwrap ( ) ) as usize
4444 }
4545
Original file line number Diff line number Diff line change 55 id,
66 state:: { ConfigKeys , ConfigState } ,
77 } ,
8+ bincode:: serialized_size,
89 solana_program:: {
910 instruction:: { AccountMeta , Instruction } ,
1011 pubkey:: Pubkey ,
@@ -25,7 +26,7 @@ pub fn create_account<T: ConfigState>(
2526 lamports : u64 ,
2627 keys : Vec < ( Pubkey , bool ) > ,
2728) -> Vec < Instruction > {
28- let space = T :: max_space ( ) . saturating_add ( ConfigKeys :: serialized_size ( keys) ) ;
29+ let space = T :: max_space ( ) . saturating_add ( serialized_size ( & ConfigKeys { keys } ) . unwrap ( ) ) ;
2930 vec ! [
3031 system_instruction:: create_account(
3132 from_account_pubkey,
Original file line number Diff line number Diff line change 11//! Program state types.
22
33use {
4- bincode:: serialized_size,
54 serde:: { Deserialize , Serialize } ,
65 solana_program:: { pubkey:: Pubkey , short_vec} ,
76} ;
@@ -20,11 +19,3 @@ pub struct ConfigKeys {
2019 #[ serde( with = "short_vec" ) ]
2120 pub keys : Vec < ( Pubkey , bool ) > ,
2221}
23-
24- impl ConfigKeys {
25- /// Get the serialized size of the `ConfigKeys` struct,
26- /// given a list of keys.
27- pub fn serialized_size ( keys : Vec < ( Pubkey , bool ) > ) -> u64 {
28- serialized_size ( & ConfigKeys { keys } ) . unwrap ( )
29- }
30- }
You can’t perform that action at this time.
0 commit comments