Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,635 changes: 2,378 additions & 2,257 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ check-cfg = [
'cfg(feature, values("frozen-abi", "no-entrypoint", "custom-heap", "custom-panic"))',
]

[workspace.metadata.cli]
solana = "2.3.4"

# Specify Rust toolchains for rustfmt, clippy, and build.
# Any unprovided toolchains default to stable.
[workspace.metadata.toolchains]
format = "nightly-2025-02-16"
lint = "nightly-2025-02-16"

[workspace.metadata.spellcheck]
config = "scripts/spellcheck.toml"

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RUST_TOOLCHAIN_NIGHTLY = nightly-2025-02-16
SOLANA_CLI_VERSION = 3.0.0
RUST_TOOLCHAIN_NIGHTLY = nightly-2026-01-22
SOLANA_CLI_VERSION = 3.1.8

nightly = +${RUST_TOOLCHAIN_NIGHTLY}

Expand Down
1 change: 1 addition & 0 deletions interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ serde-traits = ["dep:serde", "spl-pod/serde-traits"]
borsh = "1.5.7"
num-derive = "0.4"
num-traits = "0.2"
num_enum = "0.7"
serde = { version = "1.0.219", optional = true }
solana-borsh = "3.0.0"
solana-instruction = "3.0.0"
Expand Down
10 changes: 9 additions & 1 deletion interface/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ use solana_program_error::{ProgramError, ToStr};

/// Errors that may be returned by the interface.
#[repr(u32)]
#[derive(Clone, Debug, Eq, thiserror::Error, num_derive::FromPrimitive, PartialEq)]
#[derive(
Clone,
Debug,
Eq,
thiserror::Error,
num_derive::FromPrimitive,
num_enum::TryFromPrimitive,
PartialEq,
)]
pub enum TokenMetadataError {
/// Incorrect account provided
#[error("Incorrect account provided")]
Expand Down
19 changes: 9 additions & 10 deletions program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@ edition = { workspace = true }

[features]
no-entrypoint = []
test-sbf = []

[dependencies]
solana-program = "2.3.0"
spl-token-2022 = { version = "9.0.0", features = ["no-entrypoint"] }
spl-token-metadata-interface = { version = "0.7.0" }
spl-type-length-value = "0.8.0"
spl-pod = "0.5.0"
solana-program = "3.0.0"
spl-token-2022 = { version = "10.0.0", features = ["no-entrypoint"] }
spl-token-metadata-interface = { version = "0.8.0", path = "../interface" }
spl-type-length-value = "0.9.0"
spl-pod = "0.7.0"

[dev-dependencies]
solana-program-test = "2.3.4"
solana-sdk = "2.2.1"
solana-system-interface = "1"
spl-token-client = "0.16.1"
solana-program-test = { version = "3.1.8", features = ["agave-unstable-api"] }
solana-sdk = "3.0.0"
solana-system-interface = "2"
spl-token-client = { version = "0.18.0", features = ["dev-context-only-utils"] }
test-case = "3.3"

[lib]
Expand Down
7 changes: 2 additions & 5 deletions program/src/entrypoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

use {
crate::processor,
solana_program::{
account_info::AccountInfo, entrypoint::ProgramResult, program_error::PrintProgramError,
pubkey::Pubkey,
},
solana_program::{account_info::AccountInfo, entrypoint::ProgramResult, msg, pubkey::Pubkey},
spl_token_metadata_interface::error::TokenMetadataError,
};

Expand All @@ -17,7 +14,7 @@ fn process_instruction(
) -> ProgramResult {
if let Err(error) = processor::process(program_id, accounts, instruction_data) {
// catch the error so we can print it
error.print::<TokenMetadataError>();
msg!(error.to_str::<TokenMetadataError>());
return Err(error);
}
Ok(())
Expand Down
2 changes: 0 additions & 2 deletions program/tests/emit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(feature = "test-sbf")]

mod program_test;
use {
program_test::{setup, setup_metadata, setup_mint},
Expand Down
2 changes: 0 additions & 2 deletions program/tests/initialize.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(feature = "test-sbf")]

mod program_test;
use {
program_test::{setup, setup_metadata, setup_mint},
Expand Down
4 changes: 1 addition & 3 deletions program/tests/program_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(feature = "test-sbf")]

use {
solana_program_test::{processor, tokio::sync::Mutex, ProgramTest, ProgramTestContext},
solana_sdk::{
Expand All @@ -21,7 +19,7 @@ use {
};

fn keypair_clone(kp: &Keypair) -> Keypair {
Keypair::from_bytes(&kp.to_bytes()).expect("failed to copy keypair")
Keypair::try_from(kp.to_bytes().as_ref()).expect("failed to copy keypair")
}

pub async fn setup(
Expand Down
2 changes: 0 additions & 2 deletions program/tests/remove_key.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(feature = "test-sbf")]

mod program_test;
use {
program_test::{setup, setup_metadata, setup_mint, setup_update_field},
Expand Down
2 changes: 0 additions & 2 deletions program/tests/update_authority.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(feature = "test-sbf")]

mod program_test;
use {
program_test::{setup, setup_metadata, setup_mint},
Expand Down
2 changes: 0 additions & 2 deletions program/tests/update_field.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![cfg(feature = "test-sbf")]
#![allow(clippy::items_after_test_module)]

mod program_test;
use {
program_test::{setup, setup_metadata, setup_mint},
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.86.0"
channel = "1.93.0"