Skip to content

Commit 20c16a7

Browse files
committed
Revert "test(rav): use signed receipts in requests"
This reverts commit de47407.
1 parent de47407 commit 20c16a7

File tree

1 file changed

+18
-43
lines changed

1 file changed

+18
-43
lines changed

integration-tests/src/rav_tests.rs

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ pub async fn test_tap_rav_v1() -> Result<()> {
3030
// Setup HTTP client
3131
let http_client = Arc::new(Client::new());
3232

33-
// Create wallet for signing receipts
34-
let wallet: PrivateKeySigner = ACCOUNT0_SECRET.parse().unwrap();
35-
3633
// Query the network subgraph to find active allocations
3734
let allocation_id = find_allocation(http_client.clone(), GRAPH_URL).await?;
3835

@@ -67,27 +64,16 @@ pub async fn test_tap_rav_v1() -> Result<()> {
6764
);
6865

6966
for i in 0..NUM_RECEIPTS {
70-
// Create TAP receipt for this query
71-
let receipt = create_tap_receipt(
72-
MAX_RECEIPT_VALUE,
73-
&allocation_id,
74-
TAP_VERIFIER_CONTRACT,
75-
CHAIN_ID,
76-
&wallet,
77-
)?;
78-
79-
let receipt_json = serde_json::to_string(&receipt).unwrap();
80-
let response = create_request(
81-
&http_client,
82-
format!("{}/api/subgraphs/id/{}", GATEWAY_URL, SUBGRAPH_ID).as_str(),
83-
&receipt_json,
84-
&json!({
67+
let response = http_client
68+
.post(format!("{}/api/subgraphs/id/{}", GATEWAY_URL, SUBGRAPH_ID))
69+
.header("Content-Type", "application/json")
70+
.header("Authorization", format!("Bearer {}", GATEWAY_API_KEY))
71+
.json(&json!({
8572
"query": "{ _meta { block { number } } }"
86-
}),
87-
)
88-
.header("Authorization", format!("Bearer {}", GATEWAY_API_KEY))
89-
.send()
90-
.await?;
73+
}))
74+
.timeout(Duration::from_secs(10))
75+
.send()
76+
.await?;
9177

9278
if response.status().is_success() {
9379
total_successful += 1;
@@ -125,27 +111,16 @@ pub async fn test_tap_rav_v1() -> Result<()> {
125111
for i in 0..MAX_TRIGGERS {
126112
println!("Sending trigger query {}/{}...", i + 1, MAX_TRIGGERS);
127113

128-
// Create TAP receipt for this trigger query
129-
let receipt = create_tap_receipt(
130-
MAX_RECEIPT_VALUE,
131-
&allocation_id,
132-
TAP_VERIFIER_CONTRACT,
133-
CHAIN_ID,
134-
&wallet,
135-
)?;
136-
137-
let receipt_json = serde_json::to_string(&receipt).unwrap();
138-
let response = create_request(
139-
&http_client,
140-
format!("{}/api/subgraphs/id/{}", GATEWAY_URL, SUBGRAPH_ID).as_str(),
141-
&receipt_json,
142-
&json!({
114+
let response = http_client
115+
.post(format!("{}/api/subgraphs/id/{}", GATEWAY_URL, SUBGRAPH_ID))
116+
.header("Content-Type", "application/json")
117+
.header("Authorization", format!("Bearer {}", GATEWAY_API_KEY))
118+
.json(&json!({
143119
"query": "{ _meta { block { number } } }"
144-
}),
145-
)
146-
.header("Authorization", format!("Bearer {}", GATEWAY_API_KEY))
147-
.send()
148-
.await?;
120+
}))
121+
.timeout(Duration::from_secs(10))
122+
.send()
123+
.await?;
149124

150125
if response.status().is_success() {
151126
total_successful += 1;

0 commit comments

Comments
 (0)