Skip to content

Commit 81ec397

Browse files
committed
Update upgrade_nonce_account
- Using array slices directly
1 parent 48daf47 commit 81ec397

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

programs/system/src/instructions/advance_nonce_account.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ impl AdvanceNonceAccount<'_> {
3838
];
3939

4040
// instruction data uses 4-byte LE discriminator expected by the system program
41-
const DATA: [u8; 4] = [4, 0, 0, 0];
4241
let instruction = Instruction {
4342
program_id: &crate::ID,
4443
accounts: &account_metas,
45-
data: &DATA,
44+
data: &[4, 0, 0, 0],
4645
};
4746

4847
invoke_signed(

programs/system/src/instructions/upgrade_nonce_account.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ impl UpgradeNonceAccount<'_> {
2121
// account metadata
2222
let account_metas: [AccountMeta; 1] = [AccountMeta::writable(self.account.key())];
2323

24-
// instruction
24+
// instruction data uses 4-byte LE discriminator expected by the system program
2525
let instruction = Instruction {
2626
program_id: &crate::ID,
2727
accounts: &account_metas,
28-
data: &[12],
28+
data: &[12, 0, 0, 0],
2929
};
3030

3131
invoke(&instruction, &[self.account])

0 commit comments

Comments
 (0)