Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit b0e553f

Browse files
authored
remove solana-program from spl-memo (#7429)
* remove solana-program from spl-memo * fix imports in tests * fix more test imports * fmt
1 parent 5a2bd4c commit b0e553f

File tree

6 files changed

+32
-24
lines changed

6 files changed

+32
-24
lines changed

Cargo.lock

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

memo/program/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ no-entrypoint = []
1212
test-sbf = []
1313

1414
[dependencies]
15-
solana-program = "2.1.0"
15+
solana-account-info = "2.1.0"
16+
solana-instruction = "2.1.0"
17+
solana-msg = "2.1.0"
18+
solana-program-entrypoint = "2.1.0"
19+
solana-program-error = "2.1.0"
20+
solana-pubkey = "2.1.0"
1621

1722
[dev-dependencies]
1823
solana-program-test = "2.1.0"

memo/program/src/entrypoint.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
33
#![cfg(not(feature = "no-entrypoint"))]
44

5-
use solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, pubkey::Pubkey};
5+
use {
6+
solana_account_info::AccountInfo, solana_program_entrypoint::ProgramResult,
7+
solana_pubkey::Pubkey,
8+
};
69

7-
solana_program::entrypoint!(process_instruction);
10+
solana_program_entrypoint::entrypoint!(process_instruction);
811
fn process_instruction(
912
program_id: &Pubkey,
1013
accounts: &[AccountInfo],

memo/program/src/lib.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@ pub mod processor;
99

1010
// Export current sdk types for downstream users building with a different sdk
1111
// version
12-
pub use solana_program;
13-
use solana_program::{
14-
instruction::{AccountMeta, Instruction},
15-
pubkey::Pubkey,
12+
pub use {
13+
solana_account_info, solana_instruction, solana_msg, solana_program_entrypoint,
14+
solana_program_error, solana_pubkey,
15+
};
16+
use {
17+
solana_instruction::{AccountMeta, Instruction},
18+
solana_pubkey::Pubkey,
1619
};
1720

1821
/// Legacy symbols from Memo v1
1922
pub mod v1 {
20-
solana_program::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo");
23+
solana_pubkey::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo");
2124
}
2225

23-
solana_program::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr");
26+
solana_pubkey::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr");
2427

2528
/// Build a memo instruction, possibly signed
2629
///

memo/program/src/processor.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
//! Program state processor
22
33
use {
4-
solana_program::{
5-
account_info::AccountInfo, entrypoint::ProgramResult, msg, program_error::ProgramError,
6-
pubkey::Pubkey,
7-
},
8-
std::str::from_utf8,
4+
solana_account_info::AccountInfo, solana_msg::msg, solana_program_entrypoint::ProgramResult,
5+
solana_program_error::ProgramError, solana_pubkey::Pubkey, std::str::from_utf8,
96
};
107

118
/// Instruction processor
@@ -39,11 +36,8 @@ pub fn process_instruction(
3936
#[cfg(test)]
4037
mod tests {
4138
use {
42-
super::*,
43-
solana_program::{
44-
account_info::IntoAccountInfo, program_error::ProgramError, pubkey::Pubkey,
45-
},
46-
solana_sdk::account::Account,
39+
super::*, solana_account_info::IntoAccountInfo, solana_program_error::ProgramError,
40+
solana_pubkey::Pubkey, solana_sdk::account::Account,
4741
};
4842

4943
#[test]

memo/program/tests/functional.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#![cfg(feature = "test-sbf")]
22

33
use {
4-
solana_program::{
5-
instruction::{AccountMeta, Instruction, InstructionError},
6-
pubkey::Pubkey,
7-
},
4+
solana_instruction::{error::InstructionError, AccountMeta, Instruction},
85
solana_program_test::*,
6+
solana_pubkey::Pubkey,
97
solana_sdk::{
108
signature::{Keypair, Signer},
119
transaction::{Transaction, TransactionError},

0 commit comments

Comments
 (0)