diff --git a/src/auth.rs b/src/auth.rs index b8ce4bb9..1cbea27a 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -7,13 +7,13 @@ use anyhow::{anyhow, bail, ensure}; use ordered_float::NotNan; use serde::Deserialize; use serde_with::serde_as; -use thegraph_core::{Address, SubgraphId}; +use thegraph_core::SubgraphId; use tokio::sync::watch; #[derive(Clone, Debug, Default)] pub struct AuthSettings { pub key: String, - pub user: Address, + pub user: String, pub authorized_subgraphs: Vec, pub budget_usd: Option>, } @@ -36,7 +36,7 @@ impl AuthSettings { #[derive(Clone, Debug, Default, Deserialize)] pub struct APIKey { pub key: String, - pub user_address: Address, + pub user_address: String, pub query_status: QueryStatus, #[serde_as(as = "Option>")] #[serde(rename = "max_budget")] @@ -75,7 +75,7 @@ impl AuthContext { if self.special_api_keys.contains(token) { return Ok(AuthSettings { key: token.to_string(), - user: Address::default(), + user: String::new(), authorized_subgraphs: vec![], budget_usd: None, }); @@ -105,7 +105,7 @@ impl AuthContext { Ok(AuthSettings { key: api_key.key.clone(), - user: api_key.user_address, + user: api_key.user_address.clone(), authorized_subgraphs: api_key.subgraphs.clone(), budget_usd: api_key.max_budget_usd, }) diff --git a/src/reports.rs b/src/reports.rs index 7d2a1008..6bd630f8 100644 --- a/src/reports.rs +++ b/src/reports.rs @@ -13,7 +13,7 @@ pub struct ClientRequest { pub response_time_ms: u16, pub result: Result<(), errors::Error>, pub api_key: String, - pub user_address: Address, + pub user_address: String, pub grt_per_usd: NotNan, pub indexer_requests: Vec, pub request_bytes: u32, diff --git a/src/subgraph_studio.rs b/src/subgraph_studio.rs index 2bb5c7ac..57278224 100644 --- a/src/subgraph_studio.rs +++ b/src/subgraph_studio.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use serde::Deserialize; -use thegraph_core::Address; use tokio::{ sync::watch, time::{interval, Duration, MissedTickBehavior}, @@ -53,7 +52,7 @@ impl Client { #[derive(Deserialize, Debug)] struct _ApiKey { key: String, - user_address: Address, + user_address: String, query_status: QueryStatus, max_budget: Option, #[serde(default)]