Skip to content

Commit 9c6277c

Browse files
merge
2 parents ebec51b + 7a5dca6 commit 9c6277c

File tree

27 files changed

+505
-313
lines changed

27 files changed

+505
-313
lines changed

.github/workflows/containers.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ jobs:
6666
type=semver,pattern={{major}}.{{minor}},value=${{steps.extract_version.outputs.version}}
6767
type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{steps.extract_version.outputs.version}}
6868
type=semver,pattern={{major}},value=${{steps.extract_version.outputs.version}}
69+
type=semver,pattern=v{{version}},value=${{steps.extract_version.outputs.version}}
70+
type=semver,pattern=v{{major}}.{{minor}},value=${{steps.extract_version.outputs.version}}
71+
type=semver,pattern=v{{major}}.{{minor}}.{{patch}},value=${{steps.extract_version.outputs.version}}
72+
type=semver,pattern=v{{major}},value=${{steps.extract_version.outputs.version}}
6973
type=sha
7074
7175
- name: Log in to the Container registry
@@ -79,6 +83,6 @@ jobs:
7983
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
8084
with:
8185
context: ./
82-
push: true
86+
push: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
8387
tags: ${{ steps.meta.outputs.tags }}
8488
file: Dockerfile.${{ matrix.target }}

.release-please-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"tap-agent": "1.4.1",
3-
"common": "1.2.1",
2+
"tap-agent": "1.5.0",
3+
"common": "1.3.0",
44
"config": "1.2.0",
5-
"service": "1.2.1"
5+
"service": "1.2.2"
66
}

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.3.0](https://github.com/graphprotocol/indexer-rs/compare/indexer-common-v1.2.1...indexer-common-v1.3.0) (2024-11-01)
4+
5+
6+
### Features
7+
8+
* enable value check ([#430](https://github.com/graphprotocol/indexer-rs/issues/430)) ([466a5a9](https://github.com/graphprotocol/indexer-rs/commit/466a5a92c66f5cd31f5aa9c20fb51cd0df391d6c))
9+
310
## [1.2.1](https://github.com/graphprotocol/indexer-rs/compare/indexer-common-v1.2.0...indexer-common-v1.2.1) (2024-10-30)
411

512

common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "indexer-common"
3-
version = "1.2.1"
3+
version = "1.3.0"
44
edition = "2021"
55

66
[dependencies]

common/src/allocations/monitor.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,22 @@ mod test {
134134

135135
use super::*;
136136

137-
fn network_subgraph_client() -> &'static SubgraphClient {
138-
Box::leak(Box::new(SubgraphClient::new(
139-
reqwest::Client::new(),
140-
None,
141-
DeploymentDetails::for_query_url(NETWORK_SUBGRAPH_URL).unwrap(),
142-
)))
137+
async fn network_subgraph_client() -> &'static SubgraphClient {
138+
Box::leak(Box::new(
139+
SubgraphClient::new(
140+
reqwest::Client::new(),
141+
None,
142+
DeploymentDetails::for_query_url(NETWORK_SUBGRAPH_URL).unwrap(),
143+
)
144+
.await,
145+
))
143146
}
144147

145148
#[tokio::test]
146149
#[ignore = "depends on the defunct hosted-service"]
147150
async fn test_network_query() {
148151
let result = get_allocations(
149-
network_subgraph_client(),
152+
network_subgraph_client().await,
150153
Address::from_str("0x326c584e0f0eab1f1f83c93cc6ae1acc0feba0bc").unwrap(),
151154
Duration::from_secs(1712448507),
152155
)
@@ -158,7 +161,7 @@ mod test {
158161
#[ignore = "depends on the defunct hosted-service"]
159162
async fn test_network_query_empty_response() {
160163
let result = get_allocations(
161-
network_subgraph_client(),
164+
network_subgraph_client().await,
162165
Address::from_str("0xdeadbeefcafebabedeadbeefcafebabedeadbeef").unwrap(),
163166
Duration::from_secs(1712448507),
164167
)

common/src/attestations/dispute_manager.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ mod test {
6565
*test_vectors::NETWORK_SUBGRAPH_DEPLOYMENT
6666
))
6767
.unwrap(),
68-
);
68+
)
69+
.await;
6970

7071
// Mock result for current epoch requests
7172
mock_server

common/src/escrow_accounts.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,19 @@ mod tests {
201201
async fn test_current_accounts() {
202202
// Set up a mock escrow subgraph
203203
let mock_server = MockServer::start().await;
204-
let escrow_subgraph = Box::leak(Box::new(SubgraphClient::new(
205-
reqwest::Client::new(),
206-
None,
207-
DeploymentDetails::for_query_url(&format!(
208-
"{}/subgraphs/id/{}",
209-
&mock_server.uri(),
210-
*test_vectors::ESCROW_SUBGRAPH_DEPLOYMENT
211-
))
212-
.unwrap(),
213-
)));
204+
let escrow_subgraph = Box::leak(Box::new(
205+
SubgraphClient::new(
206+
reqwest::Client::new(),
207+
None,
208+
DeploymentDetails::for_query_url(&format!(
209+
"{}/subgraphs/id/{}",
210+
&mock_server.uri(),
211+
*test_vectors::ESCROW_SUBGRAPH_DEPLOYMENT
212+
))
213+
.unwrap(),
214+
)
215+
.await,
216+
));
214217

215218
let mock = Mock::given(method("POST"))
216219
.and(path(format!(

common/src/indexer_service/http/indexer_service.rs

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -200,36 +200,39 @@ impl IndexerService {
200200
.build()
201201
.expect("Failed to init HTTP client");
202202

203-
let network_subgraph: &'static SubgraphClient = Box::leak(Box::new(SubgraphClient::new(
204-
http_client.clone(),
205-
options
206-
.config
207-
.subgraphs
208-
.network
209-
.config
210-
.deployment_id
211-
.map(|deployment| {
212-
DeploymentDetails::for_graph_node_url(
213-
options.config.graph_node.status_url.clone(),
214-
options.config.graph_node.query_url.clone(),
215-
deployment,
216-
)
217-
})
218-
.transpose()
219-
.expect(
220-
"Failed to parse graph node query endpoint and network subgraph deployment",
221-
),
222-
DeploymentDetails::for_query_url_with_token(
223-
options.config.subgraphs.network.config.query_url.as_ref(),
203+
let network_subgraph: &'static SubgraphClient = Box::leak(Box::new(
204+
SubgraphClient::new(
205+
http_client.clone(),
224206
options
225207
.config
226208
.subgraphs
227209
.network
228210
.config
229-
.query_auth_token
230-
.clone(),
231-
)?,
232-
)));
211+
.deployment_id
212+
.map(|deployment| {
213+
DeploymentDetails::for_graph_node_url(
214+
options.config.graph_node.status_url.clone(),
215+
options.config.graph_node.query_url.clone(),
216+
deployment,
217+
)
218+
})
219+
.transpose()
220+
.expect(
221+
"Failed to parse graph node query endpoint and network subgraph deployment",
222+
),
223+
DeploymentDetails::for_query_url_with_token(
224+
options.config.subgraphs.network.config.query_url.as_ref(),
225+
options
226+
.config
227+
.subgraphs
228+
.network
229+
.config
230+
.query_auth_token
231+
.clone(),
232+
)?,
233+
)
234+
.await,
235+
));
233236

234237
// Identify the dispute manager for the configured network
235238
let dispute_manager = dispute_manager(network_subgraph, Duration::from_secs(3600))
@@ -264,34 +267,39 @@ impl IndexerService {
264267
dispute_manager,
265268
);
266269

267-
let escrow_subgraph: &'static SubgraphClient = Box::leak(Box::new(SubgraphClient::new(
268-
http_client,
269-
options
270-
.config
271-
.subgraphs
272-
.escrow
273-
.config
274-
.deployment_id
275-
.map(|deployment| {
276-
DeploymentDetails::for_graph_node_url(
277-
options.config.graph_node.status_url.clone(),
278-
options.config.graph_node.query_url.clone(),
279-
deployment,
280-
)
281-
})
282-
.transpose()
283-
.expect("Failed to parse graph node query endpoint and escrow subgraph deployment"),
284-
DeploymentDetails::for_query_url_with_token(
285-
options.config.subgraphs.escrow.config.query_url.as_ref(),
270+
let escrow_subgraph: &'static SubgraphClient = Box::leak(Box::new(
271+
SubgraphClient::new(
272+
http_client,
286273
options
287274
.config
288275
.subgraphs
289276
.escrow
290277
.config
291-
.query_auth_token
292-
.clone(),
293-
)?,
294-
)));
278+
.deployment_id
279+
.map(|deployment| {
280+
DeploymentDetails::for_graph_node_url(
281+
options.config.graph_node.status_url.clone(),
282+
options.config.graph_node.query_url.clone(),
283+
deployment,
284+
)
285+
})
286+
.transpose()
287+
.expect(
288+
"Failed to parse graph node query endpoint and escrow subgraph deployment",
289+
),
290+
DeploymentDetails::for_query_url_with_token(
291+
options.config.subgraphs.escrow.config.query_url.as_ref(),
292+
options
293+
.config
294+
.subgraphs
295+
.escrow
296+
.config
297+
.query_auth_token
298+
.clone(),
299+
)?,
300+
)
301+
.await,
302+
));
295303

296304
let escrow_accounts = escrow_accounts(
297305
escrow_subgraph,

0 commit comments

Comments
 (0)