Skip to content

Commit 12d17a7

Browse files
committed
fix into local testing
1 parent 91cd47b commit 12d17a7

File tree

5 files changed

+17
-26
lines changed

5 files changed

+17
-26
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,8 @@ impl Actor for SenderAccount {
876876

877877
match escrow_subgraph
878878
.query::<LatestRavs, _>(latest_ravs_v2::Variables {
879-
payer: format!("{:x?}", sender_id),
880-
data_service: format!("{:x?}", data_service),
879+
payer: format!("{sender_id:x?}"),
880+
data_service: format!("{data_service:x?}"),
881881
service_provider: format!("{:x?}", config.indexer_address),
882882
collection_ids: collection_ids.clone(),
883883
})

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ impl AllocationId {
177177
impl Display for AllocationId {
178178
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
179179
match self {
180-
AllocationId::Legacy(allocation_id) => write!(f, "{}", allocation_id),
181-
AllocationId::Horizon(collection_id) => write!(f, "{}", collection_id),
180+
AllocationId::Legacy(allocation_id) => write!(f, "{allocation_id}"),
181+
AllocationId::Horizon(collection_id) => write!(f, "{collection_id}"),
182182
}
183183
}
184184
}

crates/tap-agent/src/tap/context/receipt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl ReceiptRead<TapReceipt> for TapAgentContext<Horizon> {
269269
let collection_id = FixedBytes::<32>::from_str(&record.collection_id).map_err(|e| {
270270
AdapterError::ReceiptRead {
271271
error: format!(
272-
"Error decoding allocation_id while retrieving receipt from database: {e}"
272+
"Error decoding collection_id while retrieving receipt from database: {e}"
273273
),
274274
}
275275
})?;

integration-tests/src/load_test.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,35 +173,29 @@ pub async fn receipt_handler_load_test_v2(num_receipts: usize, concurrency: usiz
173173
// Check if the send was Ok
174174
if let Err(e) = send_result {
175175
failed_sends += 1;
176-
eprintln!("V2 Receipt {} failed to send: {:?}", index, e); // Log the specific error
176+
eprintln!("V2 Receipt {index} failed to send: {e:?}"); // Log the specific error
177177
} else {
178178
successful_sends += 1;
179179
}
180180
}
181181
Err(join_error) => {
182182
// The task panicked or was cancelled
183183
failed_sends += 1;
184-
eprintln!(
185-
"V2 Receipt {} task execution failed (e.g., panic): {:?}",
186-
index, join_error
187-
);
184+
eprintln!("V2 Receipt {index} task execution failed (e.g., panic): {join_error:?}");
188185
}
189186
}
190187
}
191188

192189
let duration = start.elapsed();
193-
println!(
194-
"Completed processing {} V2 requests in {:?}",
195-
num_receipts, duration
196-
);
190+
println!("Completed processing {num_receipts} V2 requests in {duration:?}");
197191
if num_receipts > 0 {
198192
println!(
199193
"Average time per V2 request: {:?}",
200194
duration / num_receipts as u32
201195
);
202196
}
203-
println!("Successfully sent V2 receipts: {}", successful_sends);
204-
println!("Failed V2 receipts: {}", failed_sends);
197+
println!("Successfully sent V2 receipts: {successful_sends}");
198+
println!("Failed V2 receipts: {failed_sends}");
205199

206200
if failed_sends > 0 {
207201
return Err(anyhow::anyhow!(
@@ -233,7 +227,7 @@ async fn create_and_send_receipts_v2(
233227
let receipt_encoded = encode_v2_receipt(&receipt)?;
234228
let response = create_request(
235229
&http_client,
236-
format!("{}/subgraphs/id/{}", INDEXER_URL, SUBGRAPH_ID).as_str(),
230+
format!("{INDEXER_URL}/subgraphs/id/{SUBGRAPH_ID}").as_str(),
237231
&receipt_encoded,
238232
&json!({
239233
"query": "{ _meta { block { number } } }"

integration-tests/src/rav_tests.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ pub async fn test_tap_rav_v2() -> Result<()> {
238238
initial_metrics.unaggregated_fees_by_allocation(&allocation_id.to_string());
239239

240240
println!(
241-
"\n=== V2 Initial metrics: RAVs created: {}, Unaggregated fees: {} ===",
242-
initial_ravs_created, initial_unaggregated
241+
"\n=== V2 Initial metrics: RAVs created: {initial_ravs_created}, Unaggregated fees: {initial_unaggregated} ==="
243242
);
244243

245244
println!("\n=== V2 STAGE 1: Sending large receipt batches with small pauses ===");
@@ -270,7 +269,7 @@ pub async fn test_tap_rav_v2() -> Result<()> {
270269

271270
let response = create_request(
272271
&http_client,
273-
&format!("{}/subgraphs/id/{}", INDEXER_URL, SUBGRAPH_ID),
272+
&format!("{INDEXER_URL}/subgraphs/id/{SUBGRAPH_ID}"),
274273
&receipt_encoded,
275274
&json!({
276275
"query": "{ _meta { block { number } } }"
@@ -334,7 +333,7 @@ pub async fn test_tap_rav_v2() -> Result<()> {
334333

335334
let response = create_request(
336335
&http_client,
337-
&format!("{}/subgraphs/id/{}", INDEXER_URL, SUBGRAPH_ID),
336+
&format!("{INDEXER_URL}/subgraphs/id/{SUBGRAPH_ID}"),
338337
&receipt_encoded,
339338
&json!({
340339
"query": "{ _meta { block { number } } }"
@@ -372,23 +371,21 @@ pub async fn test_tap_rav_v2() -> Result<()> {
372371
// If we've succeeded, exit early
373372
if current_ravs_created > initial_ravs_created {
374373
println!(
375-
"✅ V2 TEST PASSED: RAVs created increased from {} to {}!",
376-
initial_ravs_created, current_ravs_created
374+
"✅ V2 TEST PASSED: RAVs created increased from {initial_ravs_created} to {current_ravs_created}!"
377375
);
378376
return Ok(());
379377
}
380378

381379
if current_unaggregated < initial_unaggregated * 0.9 {
382380
println!(
383-
"✅ V2 TEST PASSED: Unaggregated fees decreased significantly from {} to {}!",
384-
initial_unaggregated, current_unaggregated
381+
"✅ V2 TEST PASSED: Unaggregated fees decreased significantly from {initial_unaggregated} to {current_unaggregated}!"
385382
);
386383
return Ok(());
387384
}
388385
}
389386

390387
println!("\n=== V2 Summary ===");
391-
println!("Total V2 queries sent successfully: {}", total_successful);
388+
println!("Total V2 queries sent successfully: {total_successful}");
392389

393390
// If we got here, test failed
394391
println!("❌ V2 TEST FAILED: No RAV generation detected");

0 commit comments

Comments
 (0)