mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-17 02:48:05 +00:00
refactor: overhaul event parser architecture for better performance
- Centralize event parsing logic and remove factory pattern - Add high-performance clock module to reduce latency - Consolidate protocol parsers with unified interface - Introduce account pubkey caching and streamline traits - Remove deprecated macro-based and multi-protocol implementations
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
use anyhow::Result;
|
||||
use solana_sdk::commitment_config::CommitmentConfig;
|
||||
|
||||
use solana_streamer_sdk::streaming::event_parser::core::event_parser::EventParser;
|
||||
use solana_streamer_sdk::streaming::event_parser::Protocol;
|
||||
use solana_streamer_sdk::streaming::event_parser::UnifiedEvent;
|
||||
use solana_streamer_sdk::streaming::event_parser::{
|
||||
protocols::MutilEventParser, EventParser, Protocol,
|
||||
};
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -99,7 +98,7 @@ async fn get_single_transaction_details(signature_str: &str) -> Result<()> {
|
||||
Protocol::RaydiumCpmm,
|
||||
Protocol::RaydiumAmmV4,
|
||||
];
|
||||
let parser: Arc<dyn EventParser> = Arc::new(MutilEventParser::new(protocols, None));
|
||||
let parser: Arc<EventParser> = Arc::new(EventParser::new(protocols, None));
|
||||
parser
|
||||
.parse_encoded_confirmed_transaction_with_status_meta(
|
||||
signature,
|
||||
|
||||
Reference in New Issue
Block a user