Skip to content

Commit

Permalink
chore(deps): remove dependency on toolshed crate (#993)
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Delgado <[email protected]>
  • Loading branch information
LNSD authored Nov 26, 2024
1 parent 474e715 commit 3e8df7f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
23 changes: 0 additions & 23 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ tokio = { version = "1.38.0", features = [
"sync",
"time",
] }
toolshed = { git = "https://github.com/edgeandnode/toolshed", tag = "toolshed-v0.6.0" }
tower = "0.5.1"
tower-http = { version = "0.6.1", features = ["cors"] }
tracing = { version = "0.1", default-features = false }
Expand All @@ -81,6 +80,5 @@ url = "2.5.0"
assert_matches = "1.5.0"
http-body-util = "0.1.1"
hyper = "1.3.1"
test-with = { version = "0.14.0", default-features = false }
tokio-test = "0.4.4"
tower-test = "0.4.0"
14 changes: 14 additions & 0 deletions src/bytes.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// See https://doc.rust-lang.org/std/macro.concat_bytes.html
#[macro_export]
macro_rules! concat_bytes {
($len:expr, [$($slices:expr),* $(,)?]) => {
{
let mut cursor = std::io::Cursor::new([0_u8; $len]);
$(
std::io::Write::write(&mut cursor, $slices).unwrap();
)*
assert!(cursor.position() == $len);
cursor.into_inner()
}
}
}
2 changes: 1 addition & 1 deletion src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ mod tests {
rngs::SmallRng, seq::SliceRandom as _, thread_rng, Rng as _, RngCore as _, SeedableRng,
};
use thegraph_core::{Address, BlockHash, IndexerId};
use toolshed::concat_bytes;

use super::{Block, Chain, MAX_LEN};
use crate::concat_bytes;

#[test]
fn chain() {
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod auth;
mod block_constraints;
mod blocks;
mod budgets;
mod bytes;
mod chain;
mod chains;
mod client_query;
Expand Down
3 changes: 1 addition & 2 deletions src/reports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ use ordered_float::NotNan;
use prost::Message;
use thegraph_core::{Address, AllocationId, DeploymentId, IndexerId};
use tokio::sync::mpsc;
use toolshed::concat_bytes;

use crate::{errors, indexer_client::IndexerResponse, receipts::Receipt};
use crate::{concat_bytes, errors, indexer_client::IndexerResponse, receipts::Receipt};

pub struct ClientRequest {
pub id: String,
Expand Down

0 comments on commit 3e8df7f

Please sign in to comment.