Deprecate Instruction::new (#15695)
This commit is contained in:
@ -99,7 +99,7 @@ pub fn create_buffer(
|
||||
UpgradeableLoaderState::buffer_len(program_len)? as u64,
|
||||
&id(),
|
||||
),
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
id(),
|
||||
&UpgradeableLoaderInstruction::InitializeBuffer,
|
||||
vec![
|
||||
@ -118,7 +118,7 @@ pub fn write(
|
||||
offset: u32,
|
||||
bytes: Vec<u8>,
|
||||
) -> Instruction {
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
id(),
|
||||
&UpgradeableLoaderInstruction::Write { offset, bytes },
|
||||
vec![
|
||||
@ -148,7 +148,7 @@ pub fn deploy_with_max_program_len(
|
||||
UpgradeableLoaderState::program_len()? as u64,
|
||||
&id(),
|
||||
),
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
id(),
|
||||
&UpgradeableLoaderInstruction::DeployWithMaxDataLen { max_data_len },
|
||||
vec![
|
||||
@ -173,7 +173,7 @@ pub fn upgrade(
|
||||
spill_address: &Pubkey,
|
||||
) -> Instruction {
|
||||
let (programdata_address, _) = Pubkey::find_program_address(&[program_address.as_ref()], &id());
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
id(),
|
||||
&UpgradeableLoaderInstruction::Upgrade,
|
||||
vec![
|
||||
@ -198,7 +198,7 @@ pub fn set_buffer_authority(
|
||||
current_authority_address: &Pubkey,
|
||||
new_authority_address: &Pubkey,
|
||||
) -> Instruction {
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
id(),
|
||||
&UpgradeableLoaderInstruction::SetAuthority,
|
||||
vec![
|
||||
@ -224,7 +224,7 @@ pub fn set_upgrade_authority(
|
||||
if let Some(address) = new_authority_address {
|
||||
metas.push(AccountMeta::new_readonly(*address, false));
|
||||
}
|
||||
Instruction::new(id(), &UpgradeableLoaderInstruction::SetAuthority, metas)
|
||||
Instruction::new_with_bincode(id(), &UpgradeableLoaderInstruction::SetAuthority, metas)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -211,6 +211,10 @@ pub struct Instruction {
|
||||
}
|
||||
|
||||
impl Instruction {
|
||||
#[deprecated(
|
||||
since = "1.6.0",
|
||||
note = "Please use another `Instruction constructor instead"
|
||||
)]
|
||||
pub fn new<T: Serialize>(program_id: Pubkey, data: &T, accounts: Vec<AccountMeta>) -> Self {
|
||||
Self::new_with_bincode(program_id, data, accounts)
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ pub fn write(
|
||||
bytes: Vec<u8>,
|
||||
) -> Instruction {
|
||||
let account_metas = vec![AccountMeta::new(*account_pubkey, true)];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
*program_id,
|
||||
&LoaderInstruction::Write { offset, bytes },
|
||||
account_metas,
|
||||
@ -49,5 +49,5 @@ pub fn finalize(account_pubkey: &Pubkey, program_id: &Pubkey) -> Instruction {
|
||||
AccountMeta::new(*account_pubkey, true),
|
||||
AccountMeta::new_readonly(rent::id(), false),
|
||||
];
|
||||
Instruction::new(*program_id, &LoaderInstruction::Finalize, account_metas)
|
||||
Instruction::new_with_bincode(*program_id, &LoaderInstruction::Finalize, account_metas)
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
use crate::account_info::AccountInfo;
|
||||
|
||||
#[macro_export]
|
||||
#[deprecated(since = "1.4.14", note = "use `msg` macro instead")]
|
||||
#[deprecated(since = "1.4.14", note = "Please use `msg` macro instead")]
|
||||
macro_rules! info {
|
||||
($msg:expr) => {
|
||||
$crate::log::sol_log($msg)
|
||||
|
@ -446,8 +446,8 @@ mod tests {
|
||||
fn test_message_unique_program_ids() {
|
||||
let program_id0 = Pubkey::default();
|
||||
let program_ids = get_program_ids(&[
|
||||
Instruction::new(program_id0, &0, vec![]),
|
||||
Instruction::new(program_id0, &0, vec![]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![]),
|
||||
]);
|
||||
assert_eq!(program_ids, vec![program_id0]);
|
||||
}
|
||||
@ -457,9 +457,9 @@ mod tests {
|
||||
let program_id0 = Pubkey::default();
|
||||
let program_id1 = Pubkey::new_unique();
|
||||
let program_ids = get_program_ids(&[
|
||||
Instruction::new(program_id0, &0, vec![]),
|
||||
Instruction::new(program_id1, &0, vec![]),
|
||||
Instruction::new(program_id0, &0, vec![]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![]),
|
||||
Instruction::new_with_bincode(program_id1, &0, vec![]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![]),
|
||||
]);
|
||||
assert_eq!(program_ids, vec![program_id0, program_id1]);
|
||||
}
|
||||
@ -469,9 +469,9 @@ mod tests {
|
||||
let program_id0 = Pubkey::new_unique();
|
||||
let program_id1 = Pubkey::default(); // Key less than program_id0
|
||||
let program_ids = get_program_ids(&[
|
||||
Instruction::new(program_id0, &0, vec![]),
|
||||
Instruction::new(program_id1, &0, vec![]),
|
||||
Instruction::new(program_id0, &0, vec![]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![]),
|
||||
Instruction::new_with_bincode(program_id1, &0, vec![]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![]),
|
||||
]);
|
||||
assert_eq!(program_ids, vec![program_id0, program_id1]);
|
||||
}
|
||||
@ -482,8 +482,8 @@ mod tests {
|
||||
let id0 = Pubkey::default();
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -495,7 +495,7 @@ mod tests {
|
||||
let program_id = Pubkey::default();
|
||||
let id0 = Pubkey::default();
|
||||
let keys = get_keys(
|
||||
&[Instruction::new(
|
||||
&[Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new(id0, true)],
|
||||
@ -510,7 +510,7 @@ mod tests {
|
||||
let program_id = Pubkey::default();
|
||||
let id0 = Pubkey::default();
|
||||
let keys = get_keys(
|
||||
&[Instruction::new(
|
||||
&[Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new(id0, false)],
|
||||
@ -526,8 +526,8 @@ mod tests {
|
||||
let id0 = Pubkey::default();
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -540,8 +540,12 @@ mod tests {
|
||||
let id0 = Pubkey::default();
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new_readonly(id0, true)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id0, true)],
|
||||
),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -556,8 +560,12 @@ mod tests {
|
||||
let id0 = Pubkey::default();
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new_readonly(id0, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id0, false)],
|
||||
),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -573,8 +581,8 @@ mod tests {
|
||||
let id1 = Pubkey::default(); // Key less than id0
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id1, false)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id1, false)]),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -588,9 +596,9 @@ mod tests {
|
||||
let id1 = Pubkey::new_unique();
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id1, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id1, false)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, true)]),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -604,8 +612,8 @@ mod tests {
|
||||
let id1 = Pubkey::new_unique();
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id1, true)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id1, true)]),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -617,11 +625,11 @@ mod tests {
|
||||
fn test_message_signed_keys_len() {
|
||||
let program_id = Pubkey::default();
|
||||
let id0 = Pubkey::default();
|
||||
let ix = Instruction::new(program_id, &0, vec![AccountMeta::new(id0, false)]);
|
||||
let ix = Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, false)]);
|
||||
let message = Message::new(&[ix], None);
|
||||
assert_eq!(message.header.num_required_signatures, 0);
|
||||
|
||||
let ix = Instruction::new(program_id, &0, vec![AccountMeta::new(id0, true)]);
|
||||
let ix = Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, true)]);
|
||||
let message = Message::new(&[ix], Some(&id0));
|
||||
assert_eq!(message.header.num_required_signatures, 1);
|
||||
}
|
||||
@ -635,10 +643,18 @@ mod tests {
|
||||
let id3 = Pubkey::new_unique();
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new_readonly(id0, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new_readonly(id1, true)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id2, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id3, true)]),
|
||||
Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id0, false)],
|
||||
),
|
||||
Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id1, true)],
|
||||
),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id2, false)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id3, true)]),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -656,9 +672,9 @@ mod tests {
|
||||
let id1 = Pubkey::new_unique();
|
||||
let message = Message::new(
|
||||
&[
|
||||
Instruction::new(program_id0, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new(program_id1, &0, vec![AccountMeta::new(id1, true)]),
|
||||
Instruction::new(program_id0, &0, vec![AccountMeta::new(id1, false)]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new_with_bincode(program_id1, &0, vec![AccountMeta::new(id1, true)]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![AccountMeta::new(id1, false)]),
|
||||
],
|
||||
Some(&id1),
|
||||
);
|
||||
@ -682,15 +698,15 @@ mod tests {
|
||||
let payer = Pubkey::new_unique();
|
||||
let id0 = Pubkey::default();
|
||||
|
||||
let ix = Instruction::new(program_id, &0, vec![AccountMeta::new(id0, false)]);
|
||||
let ix = Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, false)]);
|
||||
let message = Message::new(&[ix], Some(&payer));
|
||||
assert_eq!(message.header.num_required_signatures, 1);
|
||||
|
||||
let ix = Instruction::new(program_id, &0, vec![AccountMeta::new(id0, true)]);
|
||||
let ix = Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, true)]);
|
||||
let message = Message::new(&[ix], Some(&payer));
|
||||
assert_eq!(message.header.num_required_signatures, 2);
|
||||
|
||||
let ix = Instruction::new(
|
||||
let ix = Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new(payer, true), AccountMeta::new(id0, true)],
|
||||
@ -706,8 +722,16 @@ mod tests {
|
||||
let id1 = Pubkey::new_unique();
|
||||
let keys = get_keys(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new_readonly(id0, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new_readonly(id1, true)]),
|
||||
Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id0, false)],
|
||||
),
|
||||
Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id1, true)],
|
||||
),
|
||||
],
|
||||
None,
|
||||
);
|
||||
@ -724,8 +748,8 @@ mod tests {
|
||||
let id = Pubkey::new_unique();
|
||||
let message = Message::new(
|
||||
&[
|
||||
Instruction::new(program_id0, &0, vec![AccountMeta::new(id, false)]),
|
||||
Instruction::new(program_id1, &0, vec![AccountMeta::new(id, true)]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![AccountMeta::new(id, false)]),
|
||||
Instruction::new_with_bincode(program_id1, &0, vec![AccountMeta::new(id, true)]),
|
||||
],
|
||||
Some(&id),
|
||||
);
|
||||
@ -770,10 +794,18 @@ mod tests {
|
||||
let id3 = Pubkey::new_unique();
|
||||
let message = Message::new(
|
||||
&[
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new(id1, true)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new_readonly(id2, false)]),
|
||||
Instruction::new(program_id, &0, vec![AccountMeta::new_readonly(id3, true)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new_with_bincode(program_id, &0, vec![AccountMeta::new(id1, true)]),
|
||||
Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id2, false)],
|
||||
),
|
||||
Instruction::new_with_bincode(
|
||||
program_id,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id3, true)],
|
||||
),
|
||||
],
|
||||
Some(&id1),
|
||||
);
|
||||
@ -793,10 +825,18 @@ mod tests {
|
||||
let id2 = Pubkey::new_unique();
|
||||
let id3 = Pubkey::new_unique();
|
||||
let instructions = vec![
|
||||
Instruction::new(program_id0, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new(program_id0, &0, vec![AccountMeta::new(id1, true)]),
|
||||
Instruction::new(program_id1, &0, vec![AccountMeta::new_readonly(id2, false)]),
|
||||
Instruction::new(program_id1, &0, vec![AccountMeta::new_readonly(id3, true)]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![AccountMeta::new(id0, false)]),
|
||||
Instruction::new_with_bincode(program_id0, &0, vec![AccountMeta::new(id1, true)]),
|
||||
Instruction::new_with_bincode(
|
||||
program_id1,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id2, false)],
|
||||
),
|
||||
Instruction::new_with_bincode(
|
||||
program_id1,
|
||||
&0,
|
||||
vec![AccountMeta::new_readonly(id3, true)],
|
||||
),
|
||||
];
|
||||
|
||||
let message = Message::new(&instructions, Some(&id1));
|
||||
|
@ -230,7 +230,7 @@ pub fn create_account(
|
||||
AccountMeta::new(*from_pubkey, true),
|
||||
AccountMeta::new(*to_pubkey, true),
|
||||
];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::CreateAccount {
|
||||
lamports,
|
||||
@ -258,7 +258,7 @@ pub fn create_account_with_seed(
|
||||
AccountMeta::new_readonly(*base, true),
|
||||
];
|
||||
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::CreateAccountWithSeed {
|
||||
base: *base,
|
||||
@ -273,7 +273,7 @@ pub fn create_account_with_seed(
|
||||
|
||||
pub fn assign(pubkey: &Pubkey, owner: &Pubkey) -> Instruction {
|
||||
let account_metas = vec![AccountMeta::new(*pubkey, true)];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::Assign { owner: *owner },
|
||||
account_metas,
|
||||
@ -290,7 +290,7 @@ pub fn assign_with_seed(
|
||||
AccountMeta::new(*address, false),
|
||||
AccountMeta::new_readonly(*base, true),
|
||||
];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::AssignWithSeed {
|
||||
base: *base,
|
||||
@ -306,7 +306,7 @@ pub fn transfer(from_pubkey: &Pubkey, to_pubkey: &Pubkey, lamports: u64) -> Inst
|
||||
AccountMeta::new(*from_pubkey, true),
|
||||
AccountMeta::new(*to_pubkey, false),
|
||||
];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::Transfer { lamports },
|
||||
account_metas,
|
||||
@ -326,7 +326,7 @@ pub fn transfer_with_seed(
|
||||
AccountMeta::new_readonly(*from_base, true),
|
||||
AccountMeta::new(*to_pubkey, false),
|
||||
];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::TransferWithSeed {
|
||||
lamports,
|
||||
@ -339,7 +339,7 @@ pub fn transfer_with_seed(
|
||||
|
||||
pub fn allocate(pubkey: &Pubkey, space: u64) -> Instruction {
|
||||
let account_metas = vec![AccountMeta::new(*pubkey, true)];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::Allocate { space },
|
||||
account_metas,
|
||||
@ -357,7 +357,7 @@ pub fn allocate_with_seed(
|
||||
AccountMeta::new(*address, false),
|
||||
AccountMeta::new_readonly(*base, true),
|
||||
];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::AllocateWithSeed {
|
||||
base: *base,
|
||||
@ -395,7 +395,7 @@ pub fn create_nonce_account_with_seed(
|
||||
nonce::State::size() as u64,
|
||||
&system_program::id(),
|
||||
),
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::InitializeNonceAccount(*authority),
|
||||
vec![
|
||||
@ -421,7 +421,7 @@ pub fn create_nonce_account(
|
||||
nonce::State::size() as u64,
|
||||
&system_program::id(),
|
||||
),
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::InitializeNonceAccount(*authority),
|
||||
vec![
|
||||
@ -439,7 +439,7 @@ pub fn advance_nonce_account(nonce_pubkey: &Pubkey, authorized_pubkey: &Pubkey)
|
||||
AccountMeta::new_readonly(recent_blockhashes::id(), false),
|
||||
AccountMeta::new_readonly(*authorized_pubkey, true),
|
||||
];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::AdvanceNonceAccount,
|
||||
account_metas,
|
||||
@ -459,7 +459,7 @@ pub fn withdraw_nonce_account(
|
||||
AccountMeta::new_readonly(rent::id(), false),
|
||||
AccountMeta::new_readonly(*authorized_pubkey, true),
|
||||
];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::WithdrawNonceAccount(lamports),
|
||||
account_metas,
|
||||
@ -475,7 +475,7 @@ pub fn authorize_nonce_account(
|
||||
AccountMeta::new(*nonce_pubkey, false),
|
||||
AccountMeta::new_readonly(*authorized_pubkey, true),
|
||||
];
|
||||
Instruction::new(
|
||||
Instruction::new_with_bincode(
|
||||
system_program::id(),
|
||||
&SystemInstruction::AuthorizeNonceAccount(*new_authority),
|
||||
account_metas,
|
||||
|
Reference in New Issue
Block a user