Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Asseman <alexis@semiotic.ai>
  • Loading branch information
aasseman committed Oct 25, 2023
1 parent 46d89d7 commit 4aca651
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 89 deletions.
80 changes: 2 additions & 78 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions tap_agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ eventuals = "0.6.7"
indexer-common = { version = "0.1.0", path = "../common" }
jsonrpsee = { version = "0.20.2", features = ["http-client", "macros"] }
lazy_static = "1.4.0"
log = "0.4.19"
reqwest = "0.11.20"
serde = "1.0.188"
serde_json = "1.0.104"
Expand All @@ -32,8 +31,6 @@ tap_core = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol
thiserror = "1.0.44"
tokio = { version = "1.33.0" }
toolshed = { git = "https://github.com/edgeandnode/toolshed", branch = "main", features = ["graphql"] }
tower = "0.4.13"
tower-http = { version = "0.4.4", features = ["compression-full", "decompression-full", "set-header"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3", features = [
"env-filter",
Expand Down
2 changes: 1 addition & 1 deletion tap_agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use anyhow::Result;
use lazy_static::lazy_static;
use log::{debug, info};
use tokio::signal::unix::{signal, SignalKind};
use tracing::{debug, info};

use crate::config::Cli;

Expand Down
5 changes: 3 additions & 2 deletions tap_agent/src/tap/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use ethereum_types::U256;
use eventuals::Eventual;
use indexer_common::subgraph_client::SubgraphClient;
use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_params};
use log::{error, warn};
use sqlx::PgPool;
use tap_aggregator::jsonrpsee_helpers::JsonRpcResponse;
use tap_core::{
Expand All @@ -22,6 +21,7 @@ use tokio::{
sync::{Mutex, MutexGuard},
task::JoinHandle,
};
use tracing::{error, warn};

use super::managers::NewReceiptNotification;
use crate::{
Expand Down Expand Up @@ -555,7 +555,8 @@ mod tests {
);

// Send a new receipt notification that has a lower ID than the last loaded from the DB.
// The last ID in the DB should be 10, since we added 10 receipts to the empty receipts table,
// The last ID in the DB should be 10, since we added 10 receipts to the empty receipts
// table
let new_receipt_notification = NewReceiptNotification {
allocation_id: *ALLOCATION_ID,
sender_address: SENDER.1,
Expand Down
2 changes: 1 addition & 1 deletion tap_agent/src/tap/managers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ use anyhow::Result;
use ethereum_types::U256;
use eventuals::{Eventual, EventualExt, PipeHandle};
use indexer_common::prelude::{Allocation, SubgraphClient};
use log::{error, warn};
use serde::Deserialize;
use sqlx::{postgres::PgListener, PgPool};
use tokio::sync::RwLock;
use tracing::{error, warn};

use super::manager::Manager;
use crate::config;
Expand Down
7 changes: 3 additions & 4 deletions tap_agent/src/tap/receipt_checks_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use tap_core::adapters::receipt_checks_adapter::ReceiptChecksAdapter as ReceiptC
use tap_core::{eip_712_signed_message::EIP712SignedMessage, tap_receipt::Receipt};
use thiserror::Error;
use tokio::{sync::RwLock, time::sleep};
use tracing::error;

use crate::config;

Expand Down Expand Up @@ -213,11 +214,9 @@ impl ReceiptChecksAdapter {
Ok(!response.transactions.is_empty())
},
move |error: String| {
log::error!(
error!(
"Failed to check the escrow redeem status for allocation {} and sender {}: {}",
allocation_id,
sender_address,
error
allocation_id, sender_address, error
);
sleep(Duration::from_secs(escrow_subgraph_polling_interval).div_f32(2.))
},
Expand Down

0 comments on commit 4aca651

Please sign in to comment.