feat: upgrade to v2.0.0 with major dependency updates

- Upgrade Solana dependencies from 2.3.x to 3.0.0 series
  - Upgrade solana-streamer-sdk from 0.4.13 to 0.5.0
  - Upgrade yellowstone-grpc from 8.0.0 to 9.0.0
  - Add new SPL token utility modules (spl_token.rs, spl_token_2022.rs,
  spl_associated_token_account.rs)
  - Remove deprecated gRPC protocol definitions (protos/ directory)
  - Remove event_subscription example and update all example dependencies
  - Update README documentation to reflect v2.0.0 changes
  - Refactor imports to use new dependency structure across examples

  BREAKING CHANGES:
  - Solana SDK upgraded to 3.0.0 with API changes
  - Removed gRPC protocol definitions
  - Updated import paths for SPL token operations
This commit is contained in:
ysq
2025-09-27 14:24:41 +08:00
parent e75b0c9480
commit a7f673b43d
70 changed files with 502 additions and 3001 deletions
+11 -13
View File
@@ -1,8 +1,8 @@
use parking_lot::Mutex;
use solana_hash::Hash;
use solana_nonce::state::State;
use solana_nonce::versions::Versions;
use solana_sdk::account_utils::StateMut;
use solana_sdk::nonce::state::Versions;
use solana_sdk::nonce::State;
use solana_sdk::pubkey::Pubkey;
use solana_streamer_sdk::common::SolanaRpcClient;
use std::str::FromStr;
@@ -59,8 +59,8 @@ impl NonceCache {
self.update_nonce_info_partial(nonce_account, None, Some(false));
}
/// Get a copy of NonceInfo
pub fn get_nonce_info(&self) -> NonceInfo {
/// Get a copy of NonceInfo
pub fn get_nonce_info(&self) -> NonceInfo {
let nonce_info = self.nonce_info.lock();
NonceInfo {
nonce_account: nonce_info.nonce_account,
@@ -72,15 +72,13 @@ impl NonceCache {
pub fn get_durable_nonce_info() -> DurableNonceInfo {
let nonce_info = Self::get_instance().get_nonce_info();
let nonce_account = nonce_info.nonce_account;
let current_nonce = if nonce_account.is_some() && nonce_info.current_nonce != Hash::default() {
Some(nonce_info.current_nonce)
} else {
None
};
DurableNonceInfo {
nonce_account,
current_nonce,
}
let current_nonce =
if nonce_account.is_some() && nonce_info.current_nonce != Hash::default() {
Some(nonce_info.current_nonce)
} else {
None
};
DurableNonceInfo { nonce_account, current_nonce }
}
/// Partially update NonceInfo, only update the passed fields