Skip to content

Commit ec35f09

Browse files
mvinesjoncinque
authored andcommitted
Port SPL to solana-program and cargo build-bpf
1 parent d0e286f commit ec35f09

File tree

3 files changed

+13
-24
lines changed

3 files changed

+13
-24
lines changed

program/src/Cargo.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
# Note: This crate must be built using do.sh
3-
41
[package]
52
name = "spl-memo"
63
version = "1.0.9"
@@ -11,12 +8,10 @@ license = "Apache-2.0"
118
edition = "2018"
129

1310
[features]
14-
no-entrypoint = []
15-
program = ["solana-sdk/program"]
16-
default = ["solana-sdk/default"]
11+
exclude_entrypoint = []
1712

1813
[dependencies]
19-
solana-sdk = { version = "1.3.17", default-features = false, optional = true }
14+
solana-program = "1.4.3"
2015

2116
[lib]
2217
name = "spl_memo"

program/src/entrypoint.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
//! Program entrypoint definitions
1+
//! Program entrypoint
22
3-
#![cfg(feature = "program")]
4-
#![cfg(not(feature = "no-entrypoint"))]
5-
6-
use solana_sdk::{
7-
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, program_error::ProgramError,
8-
pubkey::Pubkey,
3+
use solana_program::{
4+
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, info,
5+
program_error::ProgramError, pubkey::Pubkey,
96
};
107
use std::str::from_utf8;
118

@@ -15,18 +12,15 @@ fn process_instruction<'a>(
1512
_accounts: &'a [AccountInfo<'a>],
1613
instruction_data: &[u8],
1714
) -> ProgramResult {
15+
info!("hi");
1816
from_utf8(instruction_data).map_err(|_| ProgramError::InvalidInstructionData)?;
1917
Ok(())
2018
}
2119

22-
// Pull in syscall stubs when building for non-BPF targets
23-
#[cfg(not(target_arch = "bpf"))]
24-
solana_sdk::program_stubs!();
25-
2620
#[cfg(test)]
2721
mod tests {
2822
use super::*;
29-
use solana_sdk::{program_error::ProgramError, pubkey::Pubkey};
23+
use solana_program::{program_error::ProgramError, pubkey::Pubkey};
3024

3125
#[test]
3226
fn test_utf8_memo() {

program/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
//! A simple program that accepts a string of encoded characters and verifies that it parses. Currently handles UTF-8.
44
5-
pub mod entrypoint;
5+
#[cfg(not(feature = "exclude_entrypoint"))]
6+
mod entrypoint;
67

7-
// Export current solana-sdk types for downstream users who may also be building with a different
8-
// solana-sdk version
9-
pub use solana_sdk;
8+
// Export current sdk types for downstream users building with a different sdk version
9+
pub use solana_program;
1010

11-
solana_sdk::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo");
11+
solana_program::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo");

0 commit comments

Comments
 (0)