Skip to content

Commit 954dd39

Browse files
committed
chore: remove receipt from request
Receipts are created and signed by the Gateway so no need to create and send them as part of the request header.
1 parent 0d2a1df commit 954dd39

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

integration-tests/src/rav_tests.rs

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,10 @@ pub async fn test_tap_rav_v1() -> Result<()> {
127127
);
128128

129129
for i in 0..NUM_RECEIPTS {
130-
let receipt = create_tap_receipt(
131-
MAX_RECEIPT_VALUE,
132-
&allocation_id,
133-
TAP_ESCROW_CONTRACT,
134-
&wallet,
135-
)?;
136-
137-
let receipt_json = serde_json::to_string(&receipt).unwrap();
138-
139130
let response = http_client
140131
.post(format!("{}/api/subgraphs/id/{}", GATEWAY_URL, SUBGRAPH_ID))
141132
.header("Content-Type", "application/json")
142133
.header("Authorization", format!("Bearer {}", GATEWAY_API_KEY))
143-
.header("Tap-Receipt", receipt_json)
144134
.json(&json!({
145135
"query": "{ _meta { block { number } } }"
146136
}))
@@ -150,15 +140,15 @@ pub async fn test_tap_rav_v1() -> Result<()> {
150140

151141
if response.status().is_success() {
152142
total_successful += 1;
153-
println!("Receipt {} of batch {} sent successfully", i + 1, batch + 1);
143+
println!("Query {} of batch {} sent successfully", i + 1, batch + 1);
154144
} else {
155145
return Err(anyhow::anyhow!(
156-
"Failed to send receipt: {}",
146+
"Failed to send query: {}",
157147
response.status()
158148
));
159149
}
160150

161-
// Small pause between receipts within batch
151+
// Small pause between queries within batch
162152
tokio::time::sleep(Duration::from_millis(100)).await;
163153
}
164154

@@ -180,24 +170,14 @@ pub async fn test_tap_rav_v1() -> Result<()> {
180170

181171
println!("\n=== STAGE 2: Sending continuous trigger receipts ===");
182172

183-
// Now send a series of regular receipts with short intervals until RAV is detected
173+
// Now send a series of regular queries with short intervals until RAV is detected
184174
for i in 0..MAX_TRIGGERS {
185-
println!("Sending trigger receipt {}/{}...", i + 1, MAX_TRIGGERS);
186-
187-
let trigger_receipt = create_tap_receipt(
188-
MAX_RECEIPT_VALUE,
189-
&allocation_id,
190-
TAP_ESCROW_CONTRACT,
191-
&wallet,
192-
)?;
193-
194-
let receipt_json = serde_json::to_string(&trigger_receipt).unwrap();
175+
println!("Sending trigger query {}/{}...", i + 1, MAX_TRIGGERS);
195176

196177
let response = http_client
197178
.post(format!("{}/api/subgraphs/id/{}", GATEWAY_URL, SUBGRAPH_ID))
198179
.header("Content-Type", "application/json")
199180
.header("Authorization", format!("Bearer {}", GATEWAY_API_KEY))
200-
.header("Tap-Receipt", receipt_json)
201181
.json(&json!({
202182
"query": "{ _meta { block { number } } }"
203183
}))
@@ -210,7 +190,7 @@ pub async fn test_tap_rav_v1() -> Result<()> {
210190
println!("Trigger receipt {} sent successfully", i + 1);
211191
} else {
212192
return Err(anyhow::anyhow!(
213-
"Failed to send trigger receipt: {}",
193+
"Failed to send trigger query: {}",
214194
response.status()
215195
));
216196
}
@@ -250,7 +230,7 @@ pub async fn test_tap_rav_v1() -> Result<()> {
250230
}
251231

252232
println!("\n=== Summary ===");
253-
println!("Total receipts sent successfully: {}", total_successful);
233+
println!("Total queries sent successfully: {}", total_successful);
254234
println!(
255235
"Total value sent: {} GRT",
256236
(MAX_RECEIPT_VALUE as f64 * total_successful as f64) / GRT_BASE as f64

0 commit comments

Comments
 (0)