Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosvdr committed Jan 6, 2025
1 parent 1aad232 commit de9ee48
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions crates/tap-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ ractor = { version = "0.14", features = [
], default-features = false }
tap_aggregator.workspace = true
futures = { version = "0.3.30", default-features = false }
env_logger = '*'
log = '*'

[dev-dependencies]
tempfile = "3.8.0"
Expand Down
6 changes: 4 additions & 2 deletions crates/tap-agent/src/agent/sender_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,8 @@ pub mod tests {
// we implement the PartialEq and Eq traits for SenderAccountMessage to be able to compare
impl Eq for SenderAccountMessage {}

const RAV_REQUEST_TIMEOUT: Duration = Duration::from_secs(60);
const TAP_SENDER_TIMEOUT: Duration = Duration::from_secs(30);
impl PartialEq for SenderAccountMessage {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
Expand Down Expand Up @@ -1181,11 +1183,11 @@ pub mod tests {
rav_request_buffer: BUFFER_DURATION,
max_amount_willing_to_lose_grt,
trigger_value: rav_request_trigger_value,
rav_request_timeout: Duration::from_secs(60),
rav_request_timeout: RAV_REQUEST_TIMEOUT,
rav_request_receipt_limit,
indexer_address: INDEXER.1,
escrow_polling_interval: Duration::default(),
tap_sender_timeout: Duration::from_secs(30),
tap_sender_timeout: TAP_SENDER_TIMEOUT,
}));

let network_subgraph = Box::leak(Box::new(
Expand Down
12 changes: 8 additions & 4 deletions crates/tap-agent/src/agent/sender_accounts_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,10 @@ mod tests {
const DUMMY_URL: &str = "http://localhost:1234";
const TRIGGER_VALUE: u128 = 100;
const ESCROW_VALUE: u128 = 1000;
const RAV_REQUEST_BUFFER: Duration = Duration::from_secs(60);
const RAV_REQUEST_TIMEOUT: Duration = Duration::from_secs(30);
const ESCROW_POLLING_INTERVAL: Duration = Duration::from_secs(30);
const TAP_SENDER_TIMEOUT: Duration = Duration::from_secs(63);

async fn mock_escrow_subgraph_empty_response() -> (MockServer, MockGuard) {
let mock_ecrow_subgraph_server: MockServer = MockServer::start().await;
Expand Down Expand Up @@ -670,14 +674,14 @@ mod tests {

fn get_config() -> &'static SenderAccountConfig {
Box::leak(Box::new(SenderAccountConfig {
rav_request_buffer: Duration::from_secs(30),
rav_request_buffer: RAV_REQUEST_BUFFER,
max_amount_willing_to_lose_grt: TRIGGER_VALUE + 100,
trigger_value: TRIGGER_VALUE,
rav_request_timeout: Duration::from_secs(30),
rav_request_timeout: RAV_REQUEST_TIMEOUT,
rav_request_receipt_limit: 1000,
indexer_address: INDEXER.1,
escrow_polling_interval: Duration::from_secs(30),
tap_sender_timeout: Duration::from_secs(30),
escrow_polling_interval: ESCROW_POLLING_INTERVAL,
tap_sender_timeout: TAP_SENDER_TIMEOUT,
}))
}

Expand Down

0 comments on commit de9ee48

Please sign in to comment.