mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-14 17:38:05 +00:00
feat: upgrade to Solana SDK v3.0.0 and
modernize dependencies - Upgrade all Solana SDK dependencies from v2.3.x to v3.0.0 - Update yellowstone-grpc dependencies from v8.0.0 to v9.0.0 - Upgrade tonic from v0.12.3 to v0.14.2 with transport features - Update prost and prost-types to v0.14.1 - Add solana-commitment-config and tonic-prost dependencies - Migrate from solana-sdk::instruction to message::compiled_instruction - Update imports for SPL token pack compatibility - Fix type compatibility issues with new gRPC and protobuf versions - Regenerate proto files with updated codegen and server implementations
This commit is contained in:
@@ -14,8 +14,8 @@ use crate::streaming::event_parser::Protocol;
|
||||
use crate::streaming::grpc::AccountPretty;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use solana_account_decoder::parse_nonce::parse_nonce;
|
||||
use solana_sdk::program_pack::Pack;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use spl_token::solana_program::program_pack::Pack;
|
||||
use spl_token::state::{Account, Mint};
|
||||
use spl_token_2022::{
|
||||
extension::StateWithExtensions,
|
||||
@@ -332,7 +332,7 @@ impl AccountEventParser {
|
||||
return Some(Box::new(event));
|
||||
}
|
||||
}
|
||||
let amount = if account.owner == spl_token_2022::ID {
|
||||
let amount = if account.owner.to_bytes() == spl_token_2022::ID.to_bytes() {
|
||||
StateWithExtensions::<Account2022>::unpack(&account.data)
|
||||
.ok()
|
||||
.map(|info| info.base.amount)
|
||||
|
||||
@@ -23,10 +23,7 @@ use crate::streaming::{
|
||||
},
|
||||
};
|
||||
use prost_types::Timestamp;
|
||||
use solana_sdk::{
|
||||
bs58, instruction::CompiledInstruction, pubkey::Pubkey, signature::Signature,
|
||||
transaction::VersionedTransaction,
|
||||
};
|
||||
use solana_sdk::{bs58, message::compiled_instruction::CompiledInstruction, pubkey::Pubkey, signature::Signature, transaction::VersionedTransaction};
|
||||
use solana_transaction_status::{
|
||||
EncodedConfirmedTransactionWithStatusMeta, InnerInstruction, InnerInstructions, UiInstruction,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use solana_sdk::{pubkey::Pubkey, signature::Signature};
|
||||
use solana_transaction_status::{TransactionWithStatusMeta, VersionedTransactionWithStatusMeta};
|
||||
use std::{collections::HashMap, fmt};
|
||||
use yellowstone_grpc_proto::{
|
||||
geyser::{
|
||||
|
||||
@@ -8,8 +8,8 @@ use crate::{
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use log::error;
|
||||
use solana_program::pubkey;
|
||||
use solana_sdk::{pubkey::Pubkey, transaction::VersionedTransaction};
|
||||
use solana_transaction_status::TransactionWithStatusMeta;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use yellowstone_grpc_proto::geyser::SubscribeUpdateTransactionInfo;
|
||||
use yellowstone_grpc_proto::geyser::{
|
||||
subscribe_update::UpdateOneof, SubscribeRequest, SubscribeRequestPing,
|
||||
};
|
||||
@@ -26,7 +26,7 @@ pub enum SystemEvent {
|
||||
pub struct TransferInfo {
|
||||
pub slot: u64,
|
||||
pub signature: String,
|
||||
pub tx: Option<VersionedTransaction>,
|
||||
pub tx: Option<SubscribeUpdateTransactionInfo>,
|
||||
}
|
||||
|
||||
impl YellowstoneGrpc {
|
||||
@@ -100,22 +100,11 @@ impl YellowstoneGrpc {
|
||||
{
|
||||
match event_pretty {
|
||||
EventPretty::Transaction(transaction_pretty) => {
|
||||
let tx = yellowstone_grpc_proto::convert_from::create_tx_with_meta(
|
||||
transaction_pretty.grpc_tx,
|
||||
);
|
||||
if let Ok(tx) = tx {
|
||||
let trade_raw: TransactionWithStatusMeta = tx;
|
||||
let meta = trade_raw.get_status_meta();
|
||||
if meta.is_none() {
|
||||
return Ok(());
|
||||
}
|
||||
let transaction = trade_raw.get_transaction();
|
||||
callback(SystemEvent::NewTransfer(TransferInfo {
|
||||
slot: transaction_pretty.slot,
|
||||
signature: transaction_pretty.signature.to_string(),
|
||||
tx: Some(transaction),
|
||||
}));
|
||||
}
|
||||
callback(SystemEvent::NewTransfer(TransferInfo {
|
||||
slot: transaction_pretty.slot,
|
||||
signature: transaction_pretty.signature.to_string(),
|
||||
tx: Some(transaction_pretty.grpc_tx),
|
||||
}));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user