Skip to content

Commit 633e4a4

Browse files
committed
chore(agent): incrementally remove ractor - stage 1
1 parent 1d1e6cc commit 633e4a4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

crates/tap-agent/src/agent/sender_account.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use indexer_query::{
1818
};
1919
use indexer_watcher::watch_pipe;
2020
use prometheus::{register_gauge_vec, register_int_gauge_vec, GaugeVec, IntGaugeVec};
21+
#[cfg(any(test, feature = "test"))]
2122
use ractor::{Actor, ActorProcessingErr, ActorRef, MessagingErr, SupervisionEvent};
2223
use reqwest::Url;
2324
use sqlx::PgPool;
@@ -327,6 +328,7 @@ impl PartialEq for SenderAccountMessage {
327328
#[cfg(any(test, feature = "test"))]
328329
impl Eq for SenderAccountMessage {}
329330

331+
#[cfg(any(test, feature = "test"))]
330332
/// A SenderAccount manages the receipts accounting between the indexer and the sender across
331333
/// multiple allocations.
332334
///
@@ -338,6 +340,7 @@ impl Eq for SenderAccountMessage {}
338340
/// - Requesting the last RAV from the sender's TAP aggregator for all EOL allocations.
339341
pub struct SenderAccount;
340342

343+
#[cfg(any(test, feature = "test"))]
341344
/// Arguments received in startup while spawing [SenderAccount] actor
342345
pub struct SenderAccountArgs {
343346
/// Configuration derived from config.toml
@@ -371,6 +374,7 @@ pub struct SenderAccountArgs {
371374
pub sender_type: SenderType,
372375
}
373376

377+
#[cfg(any(test, feature = "test"))]
374378
/// State used by the actor
375379
///
376380
/// This is a separate instance that makes it easier to have mutable
@@ -845,6 +849,7 @@ impl State {
845849
}
846850
}
847851

852+
#[cfg(any(test, feature = "test"))]
848853
/// Actor implementation for [SenderAccount]
849854
#[async_trait::async_trait]
850855
impl Actor for SenderAccount {

crates/tap-agent/src/agent/sender_account_task.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ impl SenderAccountTask {
306306
}
307307
#[cfg(test)]
308308
SenderAccountMessage::GetSenderFeeTracker(reply) => {
309+
// Note: This is the ractor-based interface for legacy tests
310+
// The reply.send() is compatible since ractor RpcReplyPort has a send method
309311
let _ = reply.send(state.sender_fee_tracker.clone());
310312
}
311313
#[cfg(test)]

0 commit comments

Comments
 (0)