Skip to content

Commit 9794ba0

Browse files
committed
fix(stream): Partial fix for stream service compilation errors (WIP)
- Fixed variable shadowing: renamed transaction decode variable - Fixed axum serve: added into_make_service() - Stream feature still has compilation errors - needs more work - Graph features (wallet hop, DeFi filter) are working correctly
1 parent 98e8a49 commit 9794ba0

File tree

3 files changed

+114
-4
lines changed

3 files changed

+114
-4
lines changed

Cargo.lock

Lines changed: 110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/stream_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub async fn start_server(
9191
tracing::info!("Stream server listening on {}", addr);
9292

9393
let listener = tokio::net::TcpListener::bind(addr).await?;
94-
axum::serve(listener, app).await?;
94+
axum::serve(listener, app.into_make_service()).await?;
9595

9696
Ok(())
9797
}

src/services/stream_service.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,17 +287,17 @@ impl StreamService {
287287
// Get recent block with transactions
288288
if let Ok(block) = client.get_block(slot) {
289289
for tx_with_meta in block.transactions.iter().take(10) {
290-
if let Some(tx) = &tx_with_meta.transaction.decode() {
290+
if let Some(transaction) = &tx_with_meta.transaction.decode() {
291291
if let Some(meta) = &tx_with_meta.meta {
292-
let signature = tx.signatures[0].to_string();
292+
let signature = transaction.signatures[0].to_string();
293293

294294
let event = SolanaEvent::Transaction {
295295
signature: signature.clone(),
296296
slot,
297297
timestamp: block.block_time.unwrap_or(0) as u64,
298298
success: meta.status.is_ok(),
299299
fee: meta.fee,
300-
signer: tx.message.account_keys[0].to_string(),
300+
signer: transaction.message.account_keys[0].to_string(),
301301
};
302302

303303
stats.lock().unwrap().events_processed += 1;

0 commit comments

Comments
 (0)