Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2,200 changes: 558 additions & 1,642 deletions Cargo.lock

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ jsonrpsee = { version = "0.16.2", features = [
"http-client",
"client",
] }
solana-sdk = "2.1.9"
solana-commitment-config = "2.1.9"
solana-message = "2.1.9"
solana-system-interface = "1.0.0"
solana-transaction-status-client-types = "2.1.9"
solana-transaction-status = "2.1.9"
solana-address-lookup-table-interface = "2.2.2"
solana-program = "2.1.9"
solana-client = "2.1.9"
solana-sdk = "3.0.0"
solana-commitment-config = "3.0.0"
solana-message = "3.0.1"
solana-system-interface = "2.0.0"
solana-transaction-status-client-types = "3.0.8"
solana-transaction-status = "3.0.8"
solana-address-lookup-table-interface = "3.0.0"
solana-program = "3.0.0"
solana-program-pack = "3.0.0"
solana-compute-budget-interface = "3.0.0"
solana-client = "3.0.8"
bs58 = "0.5.1"
bincode = "1.3.3"
borsh = "1.5.3"
Expand All @@ -67,11 +69,9 @@ futures-util = "0.3.31"
hyper = "1.5.1"
http = "0.2"
toml = "0.8.19"
spl-token = { version = "7.0.0", features = ["no-entrypoint"] }
spl-token-2022 = { version = "8.0.0", features = ["no-entrypoint"] }
spl-associated-token-account = { version = "6.0.0", features = [
"no-entrypoint",
] }
spl-token-interface = { version = "2.0.0" }
spl-token-2022-interface = { version = "2.0.0" }
spl-associated-token-account-interface = { version = "2.0.0" }
chrono = "0.4.39"
hex = "0.4.3"
p256 = "0.13.3"
Expand Down
13 changes: 8 additions & 5 deletions crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ solana-commitment-config = { workspace = true }
solana-message = { workspace = true }
solana-system-interface = { workspace = true }
solana-program = { workspace = true }
solana-program-pack = { workspace = true }
solana-compute-budget-interface = { workspace = true }
solana-transaction-status-client-types = { workspace = true }
solana-transaction-status = { workspace = true }
solana-address-lookup-table-interface = { workspace = true }
Expand All @@ -37,11 +39,12 @@ base64 = { workspace = true }
tokio = { workspace = true }
async-trait = { workspace = true }
reqwest = { workspace = true }
spl-token = { workspace = true }
spl-token-2022 = { workspace = true }
spl-associated-token-account = { workspace = true }
solana-signers = { git = "https://github.com/solana-foundation/solana-signers", features = [
spl-token-interface = { workspace = true }
spl-token-2022-interface = { workspace = true }
spl-associated-token-account-interface = { workspace = true }
solana-signers = { git = "https://github.com/solana-foundation/solana-signers", default-features = false, features = [
"all",
"sdk-v3",
] }
vaultrs = { workspace = true }
deadpool-redis = { workspace = true }
Expand All @@ -56,7 +59,7 @@ rand = "0.9.2"
utoipa = { workspace = true }
dirs = "6.0.0"
mockall = "0.13.1"
spl-pod = "0.5.0"
spl-pod = "0.7.1"
p256 = { version = "0.13", features = ["ecdsa"] }
chrono = { workspace = true }
hex = { workspace = true }
Expand Down
21 changes: 12 additions & 9 deletions crates/lib/src/admin/token_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ use crate::{
transaction::TransactionUtil,
};
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_compute_budget_interface::ComputeBudgetInstruction;
use solana_message::{Message, VersionedMessage};
use solana_sdk::{
compute_budget::ComputeBudgetInstruction, instruction::Instruction, pubkey::Pubkey,
};
use solana_sdk::{instruction::Instruction, pubkey::Pubkey};
use solana_signers::SolanaSigner;

use spl_associated_token_account::{
get_associated_token_address, instruction::create_associated_token_account,
use spl_associated_token_account_interface::{
address::get_associated_token_address, instruction::create_associated_token_account,
};
use std::{fmt::Display, str::FromStr, sync::Arc};

Expand Down Expand Up @@ -389,13 +388,17 @@ mod tests {
let atas_to_create = vec![
ATAToCreate {
mint: mint1,
ata: spl_associated_token_account::get_associated_token_address(&address, &mint1),
token_program: spl_token::id(),
ata: spl_associated_token_account_interface::address::get_associated_token_address(
&address, &mint1,
),
token_program: spl_token_interface::id(),
},
ATAToCreate {
mint: mint2,
ata: spl_associated_token_account::get_associated_token_address(&address, &mint2),
token_program: spl_token::id(),
ata: spl_associated_token_account_interface::address::get_associated_token_address(
&address, &mint2,
),
token_program: spl_token_interface::id(),
},
];

Expand Down
2 changes: 1 addition & 1 deletion crates/lib/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use solana_sdk::pubkey::Pubkey;
use spl_token_2022::extension::ExtensionType;
use spl_token_2022_interface::extension::ExtensionType;
use std::{fs, path::Path, str::FromStr};
use toml;
use utoipa::ToSchema;
Expand Down
4 changes: 2 additions & 2 deletions crates/lib/src/fee/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ mod tests {
config_mock::ConfigMockBuilder,
rpc_mock::RpcMockBuilder,
},
token::{interface::TokenInterface, TokenProgram},
token::{interface::TokenInterface, spl_token::TokenProgram},
transaction::TransactionUtil,
};
use solana_message::{v0, Message, VersionedMessage};
Expand All @@ -509,7 +509,7 @@ mod tests {
},
program::ID as SYSTEM_PROGRAM_ID,
};
use spl_associated_token_account::get_associated_token_address;
use spl_associated_token_account_interface::address::get_associated_token_address;

#[test]
fn test_is_fee_payer_in_signers_legacy_fee_payer_is_signer() {
Expand Down
16 changes: 8 additions & 8 deletions crates/lib/src/rpc_server/method/transfer_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,16 @@ pub async fn transfer_transaction(
#[cfg(test)]
mod tests {
use super::*;
use crate::{
use crate::tests::{
common::{setup_or_get_test_signer, RpcMockBuilder},
config_mock::ConfigMockBuilder,
state::update_config,
tests::{
common::{setup_or_get_test_signer, RpcMockBuilder},
config_mock::ConfigMockBuilder,
},
};

#[tokio::test]
async fn test_transfer_transaction_invalid_source() {
let config = ConfigMockBuilder::new().build();
let _ = update_config(config);
update_config(config).unwrap();
let _ = setup_or_get_test_signer();

let rpc_client = Arc::new(RpcMockBuilder::new().with_mint_account(6).build());
Expand Down Expand Up @@ -192,7 +190,8 @@ mod tests {

#[tokio::test]
async fn test_transfer_transaction_invalid_destination() {
let _m = ConfigMockBuilder::new().build_and_setup();
let config = ConfigMockBuilder::new().build();
update_config(config).unwrap();
let _ = setup_or_get_test_signer();

let rpc_client = Arc::new(RpcMockBuilder::new().with_mint_account(6).build());
Expand All @@ -219,7 +218,8 @@ mod tests {

#[tokio::test]
async fn test_transfer_transaction_invalid_token() {
let _m = ConfigMockBuilder::new().build_and_setup();
let config = ConfigMockBuilder::new().build();
update_config(config).unwrap();
let _ = setup_or_get_test_signer();

let rpc_client = Arc::new(RpcMockBuilder::new().with_mint_account(6).build());
Expand Down
29 changes: 17 additions & 12 deletions crates/lib/src/tests/account_mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use spl_pod::{
optional_keys::OptionalNonZeroPubkey,
primitives::{PodU16, PodU64},
};
use spl_token::state::{Account as TokenAccount, AccountState as SplAccountState, Mint};
use spl_token_2022::{
use spl_token_2022_interface::{
extension::{
self,
transfer_fee::{TransferFee, TransferFeeConfig},
Expand All @@ -18,9 +17,11 @@ use spl_token_2022::{
Account as Token2022AccountState, AccountState as Token2022AccountState_, Mint as Mint2022,
},
};
use spl_token_interface::state::{Account as TokenAccount, AccountState as SplAccountState, Mint};

use crate::token::{
spl_token_2022::Token2022Mint, spl_token_2022_util::ParsedExtension, Token2022Account,
spl_token_2022::{Token2022Account, Token2022Mint},
spl_token_2022_util::ParsedExtension,
};

// Common default values used across mock builders
Expand Down Expand Up @@ -242,7 +243,7 @@ impl TokenAccountMockBuilder {
Account {
lamports: self.lamports,
data,
owner: spl_token::id(),
owner: spl_token_interface::id(),
executable: false,
rent_epoch: self.rent_epoch,
}
Expand All @@ -267,7 +268,7 @@ impl TokenAccountMockBuilder {
Account {
lamports: self.lamports,
data,
owner: spl_token_2022::id(),
owner: spl_token_2022_interface::id(),
executable: false,
rent_epoch: self.rent_epoch,
}
Expand Down Expand Up @@ -397,7 +398,7 @@ impl MintAccountMockBuilder {
Account {
lamports: self.lamports,
data,
owner: spl_token::id(),
owner: spl_token_interface::id(),
executable: false,
rent_epoch: self.rent_epoch,
}
Expand All @@ -421,7 +422,7 @@ impl MintAccountMockBuilder {
Account {
lamports: self.lamports,
data,
owner: spl_token_2022::id(),
owner: spl_token_2022_interface::id(),
executable: false,
rent_epoch: self.rent_epoch,
}
Expand Down Expand Up @@ -484,7 +485,7 @@ impl MintAccountMockBuilder {
Ok(Account {
lamports: self.lamports,
data,
owner: spl_token_2022::id(),
owner: spl_token_2022_interface::id(),
executable: false,
rent_epoch: self.rent_epoch,
})
Expand Down Expand Up @@ -588,10 +589,14 @@ pub fn create_mock_token2022_mint_with_extensions(
/// Helper to create Transfer Fee Config for testing
pub fn create_transfer_fee_config(basis_points: u16, max_fee: u64) -> TransferFeeConfig {
TransferFeeConfig {
transfer_fee_config_authority: OptionalNonZeroPubkey::try_from(Some(Pubkey::new_unique()))
.unwrap(),
withdraw_withheld_authority: OptionalNonZeroPubkey::try_from(Some(Pubkey::new_unique()))
.unwrap(),
transfer_fee_config_authority: OptionalNonZeroPubkey::try_from(Some(
spl_pod::solana_pubkey::Pubkey::new_unique(),
))
.unwrap(),
withdraw_withheld_authority: OptionalNonZeroPubkey::try_from(Some(
spl_pod::solana_pubkey::Pubkey::new_unique(),
))
.unwrap(),
withheld_amount: PodU64::from(0),
newer_transfer_fee: TransferFee {
epoch: PodU64::from(0),
Expand Down
2 changes: 1 addition & 1 deletion crates/lib/src/tests/transaction_mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use solana_sdk::{
pubkey::Pubkey,
signature::Keypair,
signer::Signer,
system_instruction::transfer,
transaction::{Transaction, VersionedTransaction},
};
use solana_system_interface::instruction::transfer;

use crate::transaction::TransactionUtil;

Expand Down
2 changes: 0 additions & 2 deletions crates/lib/src/token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ pub mod spl_token_2022_util;
pub mod token;

pub use interface::{TokenInterface, TokenState};
pub use spl_token::{TokenAccount, TokenProgram};
pub use spl_token_2022::{Token2022Account, Token2022Program};
Loading
Loading