Skip to content

Commit 9ef10b8

Browse files
committed
Fix imports
1 parent d475428 commit 9ef10b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+550
-578
lines changed

Cargo.lock

Lines changed: 31 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ pinocchio = { version = "0.9", path = "sdk/pinocchio" }
2323
pinocchio-log-macro = { version = "0.5", path = "sdk/log/macro" }
2424
quote = "1.0"
2525
regex = "1"
26-
solana-account-view = { version = "0.0.0", git = "https://github.com/febo/solana-sdk.git", branch = "solana-account-view" }
27-
solana-address = { version = "1.0", git = "https://github.com/febo/solana-sdk.git", branch = "solana-account-view" }
26+
solana-account-view = { version = "0.0.0", git = "https://github.com/febo/solana-sdk.git", branch = "solana-instruction-view" }
27+
solana-address = { version = "1.0", git = "https://github.com/febo/solana-sdk.git", branch = "solana-instruction-view" }
28+
solana-instruction-view = { version = "0.0.0", git = "https://github.com/febo/solana-sdk.git", branch = "solana-instruction-view" }
29+
solana-program-error = { version = "3.0.0", git = "https://github.com/febo/solana-sdk.git", branch = "solana-instruction-view" }
2830
syn = "1.0"
2931

3032
[workspace.metadata.cli]

programs/associated-token-account/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ rust-version = { workspace = true }
1212
crate-type = ["rlib"]
1313

1414
[dependencies]
15-
pinocchio = { workspace = true }
15+
solana-account-view = { workspace = true }
1616
solana-address = { workspace = true, features = ["decode"] }
17+
solana-instruction-view = { workspace = true, features = ["cpi"] }
18+
solana-program-error = { workspace = true }

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use solana_account_view::AccountView;
22
use solana_instruction_view::{
33
cpi::{invoke_signed, Signer},
4-
AccountMeta, InstructionView,
4+
AccountPrivilege, InstructionView,
55
};
66
use solana_program_error::ProgramResult;
77

@@ -39,13 +39,13 @@ impl Create<'_> {
3939
#[inline(always)]
4040
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
4141
// account metadata
42-
let account_metas: [AccountMeta; 6] = [
43-
AccountMeta::writable_signer(self.funding_account.key()),
44-
AccountMeta::writable(self.account.key()),
45-
AccountMeta::readonly(self.wallet.key()),
46-
AccountMeta::readonly(self.mint.key()),
47-
AccountMeta::readonly(self.system_program.key()),
48-
AccountMeta::readonly(self.token_program.key()),
42+
let account_metas: [AccountPrivilege; 6] = [
43+
AccountPrivilege::writable_signer(self.funding_account.key()),
44+
AccountPrivilege::writable(self.account.key()),
45+
AccountPrivilege::readonly(self.wallet.key()),
46+
AccountPrivilege::readonly(self.mint.key()),
47+
AccountPrivilege::readonly(self.system_program.key()),
48+
AccountPrivilege::readonly(self.token_program.key()),
4949
];
5050

5151
// Instruction data:

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use solana_account_view::AccountView;
22
use solana_instruction_view::{
33
cpi::{invoke_signed, Signer},
4-
AccountMeta, InstructionView,
4+
AccountPrivilege, InstructionView,
55
};
66
use solana_program_error::ProgramResult;
77

@@ -40,13 +40,13 @@ impl CreateIdempotent<'_> {
4040
#[inline(always)]
4141
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
4242
// account metadata
43-
let account_metas: [AccountMeta; 6] = [
44-
AccountMeta::writable_signer(self.funding_account.key()),
45-
AccountMeta::writable(self.account.key()),
46-
AccountMeta::readonly(self.wallet.key()),
47-
AccountMeta::readonly(self.mint.key()),
48-
AccountMeta::readonly(self.system_program.key()),
49-
AccountMeta::readonly(self.token_program.key()),
43+
let account_metas: [AccountPrivilege; 6] = [
44+
AccountPrivilege::writable_signer(self.funding_account.key()),
45+
AccountPrivilege::writable(self.account.key()),
46+
AccountPrivilege::readonly(self.wallet.key()),
47+
AccountPrivilege::readonly(self.mint.key()),
48+
AccountPrivilege::readonly(self.system_program.key()),
49+
AccountPrivilege::readonly(self.token_program.key()),
5050
];
5151

5252
// Instruction data:

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use solana_account_view::AccountView;
22
use solana_instruction_view::{
33
cpi::{invoke_signed, Signer},
4-
AccountMeta, InstructionView,
4+
AccountPrivilege, InstructionView,
55
};
66
use solana_program_error::ProgramResult;
77

@@ -50,14 +50,14 @@ impl RecoverNested<'_> {
5050
#[inline(always)]
5151
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
5252
// account metadata
53-
let account_metas: [AccountMeta; 7] = [
54-
AccountMeta::writable(self.account.key()),
55-
AccountMeta::readonly(self.mint.key()),
56-
AccountMeta::writable(self.destination_account.key()),
57-
AccountMeta::readonly(self.owner_account.key()),
58-
AccountMeta::readonly(self.owner_mint.key()),
59-
AccountMeta::writable_signer(self.wallet.key()),
60-
AccountMeta::readonly(self.token_program.key()),
53+
let account_metas: [AccountPrivilege; 7] = [
54+
AccountPrivilege::writable(self.account.key()),
55+
AccountPrivilege::readonly(self.mint.key()),
56+
AccountPrivilege::writable(self.destination_account.key()),
57+
AccountPrivilege::readonly(self.owner_account.key()),
58+
AccountPrivilege::readonly(self.owner_mint.key()),
59+
AccountPrivilege::writable_signer(self.wallet.key()),
60+
AccountPrivilege::readonly(self.token_program.key()),
6161
];
6262

6363
// Instruction data:

programs/memo/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ rust-version = { workspace = true }
1212
crate-type = ["rlib"]
1313

1414
[dependencies]
15-
pinocchio = { workspace = true }
15+
solana-account-view = { workspace = true }
1616
solana-address = { workspace = true, features = ["decode"] }
17+
solana-instruction-view = { workspace = true, features = ["cpi"] }
18+
solana-program-error = { workspace = true }

programs/memo/src/instructions/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use core::mem::MaybeUninit;
22

3-
use pinocchio::{
4-
account_view::AccountView,
5-
cpi::{slice_invoke_signed, MAX_CPI_ACCOUNTS},
6-
instruction::{AccountMeta, Instruction, Signer},
7-
program_error::ProgramError,
8-
ProgramResult,
3+
use solana_account_view::AccountView;
4+
use solana_instruction_view::{
5+
cpi::{slice_invoke_signed, Signer, MAX_CPI_ACCOUNTS},
6+
AccountPrivilege, InstructionView,
97
};
8+
use solana_program_error::{ProgramError, ProgramResult};
109

1110
/// Memo instruction.
1211
///
@@ -27,7 +26,8 @@ impl Memo<'_, '_, '_> {
2726

2827
#[inline(always)]
2928
pub fn invoke_signed(&self, signers_seeds: &[Signer]) -> ProgramResult {
30-
const UNINIT_META: MaybeUninit<AccountMeta> = MaybeUninit::<AccountMeta>::uninit();
29+
const UNINIT_META: MaybeUninit<AccountPrivilege> =
30+
MaybeUninit::<AccountPrivilege>::uninit();
3131

3232
// We don't know num_accounts at compile time, so we use MAX_CPI_ACCOUNTS
3333
let mut account_metas = [UNINIT_META; MAX_CPI_ACCOUNTS];
@@ -43,14 +43,14 @@ impl Memo<'_, '_, '_> {
4343
// SAFETY: i is less than len(self.signers)
4444
account_metas
4545
.get_unchecked_mut(i)
46-
.write(AccountMeta::readonly_signer(
46+
.write(AccountPrivilege::readonly_signer(
4747
self.signers.get_unchecked(i).key(),
4848
));
4949
}
5050
}
5151

5252
// SAFETY: len(account_metas) <= MAX_CPI_ACCOUNTS
53-
let instruction = Instruction {
53+
let instruction = InstructionView {
5454
program_id: &crate::ID,
5555
accounts: unsafe {
5656
core::slice::from_raw_parts(account_metas.as_ptr() as _, num_accounts)

programs/system/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ crate-type = ["rlib"]
1313

1414
[dependencies]
1515
pinocchio = { workspace = true }
16+
solana-account-view = { workspace = true }
1617
solana-address = { workspace = true, features = ["decode"] }
18+
solana-instruction-view = { workspace = true, features = ["cpi"] }
19+
solana-program-error = { workspace = true }

programs/system/src/instructions/advance_nonce_account.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use solana_account_view::AccountView;
22
use solana_instruction_view::{
33
cpi::{invoke_signed, Signer},
4-
AccountMeta, InstructionView,
4+
AccountPrivilege, InstructionView,
55
};
66
use solana_program_error::ProgramResult;
77

@@ -31,10 +31,10 @@ impl AdvanceNonceAccount<'_> {
3131
#[inline(always)]
3232
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
3333
// account metadata
34-
let account_metas: [AccountMeta; 3] = [
35-
AccountMeta::writable(self.account.key()),
36-
AccountMeta::readonly(self.recent_blockhashes_sysvar.key()),
37-
AccountMeta::readonly_signer(self.authority.key()),
34+
let account_metas: [AccountPrivilege; 3] = [
35+
AccountPrivilege::writable(self.account.key()),
36+
AccountPrivilege::readonly(self.recent_blockhashes_sysvar.key()),
37+
AccountPrivilege::readonly_signer(self.authority.key()),
3838
];
3939

4040
// instruction

0 commit comments

Comments
 (0)