Skip to content

Commit d475428

Browse files
committed
Use solana-instruction-view
1 parent 76c5c3f commit d475428

40 files changed

+133
-986
lines changed

programs/associated-token-account/src/instructions/create.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use pinocchio::{
2-
account_view::AccountView,
3-
instruction::{AccountMeta, Instruction, Signer},
4-
program::invoke_signed,
5-
ProgramResult,
1+
use solana_account_view::AccountView;
2+
use solana_instruction_view::{
3+
cpi::{invoke_signed, Signer},
4+
AccountMeta, InstructionView,
65
};
6+
use solana_program_error::ProgramResult;
77

88
/// Creates an associated token account for the given wallet address and token mint.
99
/// Returns an error if the account exists.
@@ -53,7 +53,7 @@ impl Create<'_> {
5353

5454
let instruction_data = [0u8];
5555

56-
let instruction = Instruction {
56+
let instruction = InstructionView {
5757
program_id: &crate::ID,
5858
accounts: &account_metas,
5959
data: &instruction_data,

programs/associated-token-account/src/instructions/create_idempotent.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use pinocchio::{
2-
account_view::AccountView,
3-
instruction::{AccountMeta, Instruction, Signer},
4-
program::invoke_signed,
5-
ProgramResult,
1+
use solana_account_view::AccountView;
2+
use solana_instruction_view::{
3+
cpi::{invoke_signed, Signer},
4+
AccountMeta, InstructionView,
65
};
6+
use solana_program_error::ProgramResult;
77

88
/// Creates an associated token account for the given wallet address and
99
/// token mint, if it doesn't already exist. Returns an error if the
@@ -54,7 +54,7 @@ impl CreateIdempotent<'_> {
5454

5555
let instruction_data = [1u8];
5656

57-
let instruction = Instruction {
57+
let instruction = InstructionView {
5858
program_id: &crate::ID,
5959
accounts: &account_metas,
6060
data: &instruction_data,

programs/associated-token-account/src/instructions/recover_nested.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use pinocchio::{
2-
account_view::AccountView,
3-
instruction::{AccountMeta, Instruction, Signer},
4-
program::invoke_signed,
5-
ProgramResult,
1+
use solana_account_view::AccountView;
2+
use solana_instruction_view::{
3+
cpi::{invoke_signed, Signer},
4+
AccountMeta, InstructionView,
65
};
6+
use solana_program_error::ProgramResult;
77

88
/// Transfers from and closes a nested associated token account: an
99
/// associated token account owned by an associated token account.
@@ -65,7 +65,7 @@ impl RecoverNested<'_> {
6565

6666
let instruction_data = [2u8];
6767

68-
let instruction = Instruction {
68+
let instruction = InstructionView {
6969
program_id: &crate::ID,
7070
accounts: &account_metas,
7171
data: &instruction_data,

programs/system/src/instructions/advance_nonce_account.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use pinocchio::{
2-
account_view::AccountView,
3-
instruction::{AccountMeta, Instruction, Signer},
4-
program::invoke_signed,
5-
ProgramResult,
1+
use solana_account_view::AccountView;
2+
use solana_instruction_view::{
3+
cpi::{invoke_signed, Signer},
4+
AccountMeta, InstructionView,
65
};
6+
use solana_program_error::ProgramResult;
77

88
/// Consumes a stored nonce, replacing it with a successor.
99
///
@@ -38,7 +38,7 @@ impl AdvanceNonceAccount<'_> {
3838
];
3939

4040
// instruction
41-
let instruction = Instruction {
41+
let instruction = InstructionView {
4242
program_id: &crate::ID,
4343
accounts: &account_metas,
4444
data: &[4],

programs/system/src/instructions/allocate.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use pinocchio::{
2-
account_view::AccountView,
3-
instruction::{AccountMeta, Instruction, Signer},
4-
program::invoke_signed,
5-
ProgramResult,
1+
use solana_account_view::AccountView;
2+
use solana_instruction_view::{
3+
cpi::{invoke_signed, Signer},
4+
AccountMeta, InstructionView,
65
};
6+
use solana_program_error::ProgramResult;
77

88
/// Allocate space in a (possibly new) account without funding.
99
///
@@ -35,7 +35,7 @@ impl Allocate<'_> {
3535
instruction_data[0] = 8;
3636
instruction_data[4..12].copy_from_slice(&self.space.to_le_bytes());
3737

38-
let instruction = Instruction {
38+
let instruction = InstructionView {
3939
program_id: &crate::ID,
4040
accounts: &account_metas,
4141
data: &instruction_data,

programs/system/src/instructions/allocate_with_seed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl AllocateWithSeed<'_, '_, '_> {
6464
instruction_data[offset..offset + 8].copy_from_slice(&self.space.to_le_bytes());
6565
instruction_data[offset + 8..offset + 40].copy_from_slice(self.owner.as_ref());
6666

67-
let instruction = Instruction {
67+
let instruction = InstructionView {
6868
program_id: &crate::ID,
6969
accounts: &account_metas,
7070
data: &instruction_data[..offset + 40],

programs/system/src/instructions/assign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl Assign<'_, '_> {
3636
instruction_data[0] = 1;
3737
instruction_data[4..36].copy_from_slice(self.owner.as_ref());
3838

39-
let instruction = Instruction {
39+
let instruction = InstructionView {
4040
program_id: &crate::ID,
4141
accounts: &account_metas,
4242
data: &instruction_data,

programs/system/src/instructions/assign_with_seed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl AssignWithSeed<'_, '_, '_> {
5858
instruction_data[44..offset].copy_from_slice(self.seed.as_bytes());
5959
instruction_data[offset..offset + 32].copy_from_slice(self.owner.as_ref());
6060

61-
let instruction = Instruction {
61+
let instruction = InstructionView {
6262
program_id: &crate::ID,
6363
accounts: &account_metas,
6464
data: &instruction_data[..offset + 32],

programs/system/src/instructions/authorize_nonce_account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl AuthorizeNonceAccount<'_, '_> {
4545
instruction_data[0] = 7;
4646
instruction_data[4..36].copy_from_slice(self.new_authority.as_array());
4747

48-
let instruction = Instruction {
48+
let instruction = InstructionView {
4949
program_id: &crate::ID,
5050
accounts: &account_metas,
5151
data: &instruction_data,

programs/system/src/instructions/create_account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<'a> CreateAccount<'a> {
7575
instruction_data[12..20].copy_from_slice(&self.space.to_le_bytes());
7676
instruction_data[20..52].copy_from_slice(self.owner.as_ref());
7777

78-
let instruction = Instruction {
78+
let instruction = InstructionView {
7979
program_id: &crate::ID,
8080
accounts: &account_metas,
8181
data: &instruction_data,

0 commit comments

Comments
 (0)