Skip to content

Commit 82c10ca

Browse files
committed
test: removed get_grpc_url on subgraph endpoints
1 parent d5df0f9 commit 82c10ca

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,13 +625,14 @@ mod tests {
625625
INDEXER, SENDER_2, TAP_EIP712_DOMAIN_SEPARATOR,
626626
},
627627
};
628+
const DUMMY_URL: &str = "http://localhost:1234";
628629

629630
async fn get_subgraph_client() -> &'static SubgraphClient {
630631
Box::leak(Box::new(
631632
SubgraphClient::new(
632633
reqwest::Client::new(),
633634
None,
634-
DeploymentDetails::for_query_url(&get_grpc_url().await).unwrap(),
635+
DeploymentDetails::for_query_url(DUMMY_URL).unwrap(),
635636
)
636637
.await,
637638
))

crates/tap-agent/src/test.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub static PREFIX_ID: AtomicU32 = AtomicU32::new(0);
6262

6363
pub const TRIGGER_VALUE: u128 = 500;
6464
pub const RECEIPT_LIMIT: u64 = 10000;
65+
pub const DUMMY_URL: &str = "http://localhost:1234";
6566
const ESCROW_VALUE: u128 = 1000;
6667
const BUFFER_DURATION: Duration = Duration::from_millis(100);
6768
const RETRY_DURATION: Duration = Duration::from_millis(1000);
@@ -116,21 +117,17 @@ pub async fn create_sender_account(
116117
SubgraphClient::new(
117118
reqwest::Client::new(),
118119
None,
119-
DeploymentDetails::for_query_url(
120-
network_subgraph_endpoint.unwrap_or(&get_grpc_url().await),
121-
)
122-
.unwrap(),
120+
DeploymentDetails::for_query_url(network_subgraph_endpoint.unwrap_or(DUMMY_URL))
121+
.unwrap(),
123122
)
124123
.await,
125124
));
126125
let escrow_subgraph = Box::leak(Box::new(
127126
SubgraphClient::new(
128127
reqwest::Client::new(),
129128
None,
130-
DeploymentDetails::for_query_url(
131-
escrow_subgraph_endpoint.unwrap_or(&get_grpc_url().await),
132-
)
133-
.unwrap(),
129+
DeploymentDetails::for_query_url(escrow_subgraph_endpoint.unwrap_or(DUMMY_URL))
130+
.unwrap(),
134131
)
135132
.await,
136133
));
@@ -193,17 +190,15 @@ pub async fn create_sender_accounts_manager(
193190
SubgraphClient::new(
194191
reqwest::Client::new(),
195192
None,
196-
DeploymentDetails::for_query_url(escrow_subgraph.unwrap_or(&get_grpc_url().await))
197-
.unwrap(),
193+
DeploymentDetails::for_query_url(escrow_subgraph.unwrap_or(DUMMY_URL)).unwrap(),
198194
)
199195
.await,
200196
));
201197
let network_subgraph = Box::leak(Box::new(
202198
SubgraphClient::new(
203199
reqwest::Client::new(),
204200
None,
205-
DeploymentDetails::for_query_url(network_subgraph.unwrap_or(&get_grpc_url().await))
206-
.unwrap(),
201+
DeploymentDetails::for_query_url(network_subgraph.unwrap_or(DUMMY_URL)).unwrap(),
207202
)
208203
.await,
209204
));

0 commit comments

Comments
 (0)