Config instructions now only require one key (#4258)

This commit is contained in:
Michael Vines
2019-05-12 22:47:12 -07:00
committed by GitHub
parent 426d06b89b
commit 8542006259
3 changed files with 31 additions and 45 deletions

View File

@@ -20,14 +20,7 @@ pub fn create_account<T: ConfigState>(
}
/// Store new data in a configuration account
pub fn store<T: ConfigState>(
from_account_pubkey: &Pubkey,
config_account_pubkey: &Pubkey,
data: &T,
) -> Instruction {
let account_metas = vec![
AccountMeta::new(*from_account_pubkey, true),
AccountMeta::new(*config_account_pubkey, true),
];
pub fn store<T: ConfigState>(config_account_pubkey: &Pubkey, data: &T) -> Instruction {
let account_metas = vec![AccountMeta::new(*config_account_pubkey, true)];
Instruction::new(id(), data, account_metas)
}