Skip to content

Commit 20dc653

Browse files
kevinheaveybuffalojoec
authored andcommitted
remove code no longer required externally
1 parent f6760cb commit 20dc653

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

interface/src/instruction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn create_account<T: ConfigState>(
2121
lamports: u64,
2222
keys: Vec<(Pubkey, bool)>,
2323
) -> Vec<Instruction> {
24-
let space = T::max_space() + ConfigKeys::serialized_size(keys);
24+
let space = T::max_space() + bincode::serialized_size(&ConfigKeys { keys }).unwrap();
2525
vec![
2626
system_instruction::create_account(
2727
from_account_pubkey,

interface/src/state.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use solana_pubkey::Pubkey;
22
#[cfg(feature = "bincode")]
33
#[allow(deprecated)]
44
use {
5-
bincode::{deserialize, serialize, serialized_size},
6-
solana_account::{Account, AccountSharedData},
5+
bincode::{deserialize, serialized_size},
76
solana_stake_interface::config::Config as StakeConfig,
87
};
98
#[cfg(feature = "serde")]
@@ -37,33 +36,9 @@ pub struct ConfigKeys {
3736
pub keys: Vec<(Pubkey, bool)>,
3837
}
3938

40-
#[cfg(feature = "bincode")]
41-
impl ConfigKeys {
42-
pub fn serialized_size(keys: Vec<(Pubkey, bool)>) -> u64 {
43-
serialized_size(&ConfigKeys { keys }).unwrap()
44-
}
45-
}
46-
4739
#[cfg(feature = "bincode")]
4840
pub fn get_config_data(bytes: &[u8]) -> Result<&[u8], bincode::Error> {
4941
deserialize::<ConfigKeys>(bytes)
5042
.and_then(|keys| serialized_size(&keys))
5143
.map(|offset| &bytes[offset as usize..])
5244
}
53-
54-
#[cfg(feature = "bincode")]
55-
// utility for pre-made Accounts
56-
pub fn create_config_account<T: ConfigState>(
57-
keys: Vec<(Pubkey, bool)>,
58-
config_data: &T,
59-
lamports: u64,
60-
) -> AccountSharedData {
61-
let mut data = serialize(&ConfigKeys { keys }).unwrap();
62-
data.extend_from_slice(&serialize(config_data).unwrap());
63-
AccountSharedData::from(Account {
64-
lamports,
65-
data,
66-
owner: crate::id(),
67-
..Account::default()
68-
})
69-
}

0 commit comments

Comments
 (0)