Skip to content

Commit b49fbc0

Browse files
committed
silence warnings in basics example
- use workspace deps - use solana-system-interface - use borsh::to_vec() - use allow unexpected cfgs and depreciated
1 parent c17918f commit b49fbc0

File tree

51 files changed

+1169
-1788
lines changed

Some content is hidden

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

51 files changed

+1169
-1788
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@ resolver = "2"
4141

4242
[profile.release]
4343
overflow-checks = true
44+
45+
[workspace.dependencies]
46+
borsh = "1.5.7"
47+
borsh-derive = "1.5.7"
48+
solana-program = "3.0"
49+
spl-token = { version = "8.0.0", features = [ "no-entrypoint" ] }
50+
spl-associated-token-account = { version = "7.0.0", features = [ "no-entrypoint" ] }
51+
solana-system-interface = {version = "2.0.0", features = ["bincode"]}
52+
pinocchio = "=0.8.1"
53+
pinocchio-log = "0.4.0"
54+
mpl-token-metadata = { version = "5.1.1", features = [ "no-entrypoint" ] }

basics/account-data/anchor/programs/anchor-program-example/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![allow(clippy::result_large_err)]
2+
#![allow(unexpected_cfgs)]
3+
#![allow(deprecated)]
24
use anchor_lang::prelude::*;
35
use instructions::*;
46

basics/account-data/native/program/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
borsh = "1.5.7"
8-
borsh-derive = "1.5.7"
9-
solana-program = "3.0"
7+
borsh.workspace = true
8+
borsh-derive.workspace = true
9+
solana-program.workspace = true
10+
solana-system-interface.workspace = true
1011

1112
[lib]
1213
crate-type = ["cdylib", "lib"]

basics/account-data/native/program/src/instructions/create.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use solana_program::{
55
program::invoke,
66
pubkey::Pubkey,
77
rent::Rent,
8-
system_instruction,
98
sysvar::Sysvar,
109
};
1110

@@ -21,11 +20,11 @@ pub fn create_address_info(
2120
let payer = next_account_info(accounts_iter)?;
2221
let system_program = next_account_info(accounts_iter)?;
2322

24-
let account_span = (address_info.try_to_vec()?).len();
23+
let account_span = borsh::to_vec(&address_info)?.len();
2524
let lamports_required = (Rent::get()?).minimum_balance(account_span);
2625

2726
invoke(
28-
&system_instruction::create_account(
27+
&solana_system_interface::instruction::create_account(
2928
payer.key,
3029
address_info_account.key,
3130
lamports_required,

basics/checking-accounts/anchor/programs/anchor-program-example/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![allow(clippy::result_large_err)]
2+
#![allow(unexpected_cfgs)]
3+
#![allow(deprecated)]
24

35
use anchor_lang::prelude::*;
46

basics/checking-accounts/native/program/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
solana-program = "3.0"
7+
solana-program.workspace = true
8+
solana-system-interface.workspace = true
89

910
[lib]
1011
crate-type = ["cdylib", "lib"]

basics/checking-accounts/native/program/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use solana_program::{
77
msg,
88
program_error::ProgramError,
99
pubkey::Pubkey,
10-
system_program,
1110
};
1211

1312
entrypoint!(process_instruction);
@@ -19,7 +18,7 @@ fn process_instruction(
1918
) -> ProgramResult {
2019
// You can verify the program ID from the instruction is in fact
2120
// the program ID of your program.
22-
if system_program::check_id(program_id) {
21+
if solana_system_interface::program::check_id(program_id) {
2322
return Err(ProgramError::IncorrectProgramId);
2423
};
2524

@@ -62,7 +61,7 @@ fn process_instruction(
6261
};
6362

6463
// You can also check pubkeys against constants.
65-
if system_program.key != &system_program::ID {
64+
if system_program.key != &solana_system_interface::program::ID {
6665
return Err(ProgramError::IncorrectProgramId);
6766
};
6867

basics/close-account/anchor/programs/close-account/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![allow(clippy::result_large_err)]
2+
#![allow(unexpected_cfgs)]
3+
#![allow(deprecated)]
24

35
use anchor_lang::prelude::*;
46
mod instructions;

basics/close-account/native/program/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
borsh = "1.5.7"
8-
borsh-derive = "1.5.7"
9-
solana-program = "3.0"
7+
borsh.workspace = true
8+
borsh-derive.workspace = true
9+
solana-program.workspace = true
10+
solana-system-interface.workspace = true
1011

1112
[lib]
1213
crate-type = ["cdylib", "lib"]

0 commit comments

Comments
 (0)