Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7a4921

Browse files
committed
graph: Remove use of extern crate
1 parent 7fad28f commit c7a4921

File tree

50 files changed

+93
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+93
-121
lines changed

core/src/link_resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::sync::{Arc, Mutex};
99
use std::time::Duration;
1010

1111
use graph::prelude::{LinkResolver as LinkResolverTrait, *};
12-
use graph::serde_json::Value;
12+
use serde_json::Value;
1313

1414
// Environment variable for limiting the `ipfs.map` file size limit.
1515
const MAX_IPFS_MAP_FILE_SIZE_VAR: &'static str = "GRAPH_MAX_IPFS_MAP_FILE_SIZE";

core/src/subgraph/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::env;
33
use std::str::FromStr;
44

55
use graph::prelude::{SubgraphInstance as SubgraphInstanceTrait, *};
6-
use graph::web3::types::Log;
6+
use web3::types::Log;
77

88
lazy_static! {
99
static ref MAX_DATA_SOURCES: Option<usize> = env::var("GRAPH_SUBGRAPH_MAX_DATA_SOURCES")

core/tests/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ use std::time::Instant;
1919

2020
use graph::components::ethereum::*;
2121
use graph::prelude::*;
22-
use graph::web3::types::*;
2322
use graph_core::{LinkResolver, SubgraphInstanceManager};
2423
use graph_mock::{FakeStore, MockBlockStreamBuilder, MockStore};
24+
use web3::types::*;
2525

2626
use crate::tokio::timer::Delay;
2727

datasource/ethereum/src/block_ingestor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::time::Duration;
22
use std::time::Instant;
33

44
use graph::prelude::*;
5-
use graph::web3::types::*;
5+
use web3::types::*;
66

77
pub struct BlockIngestor<S, E>
88
where

datasource/ethereum/src/block_stream.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ use std::mem;
66
use std::sync::Mutex;
77
use std::time::{Duration, Instant};
88

9-
use futures::prelude::*;
10-
use graph::tokio::timer::Delay;
11-
129
use graph::data::subgraph::schema::{
1310
SubgraphDeploymentEntity, SubgraphEntity, SubgraphVersionEntity,
1411
};
1512
use graph::prelude::{
1613
BlockStream as BlockStreamTrait, BlockStreamBuilder as BlockStreamBuilderTrait, *,
1714
};
18-
use graph::web3::types::*;
15+
use tokio::timer::Delay;
16+
use web3::types::*;
1917

2018
const FAST_SCAN_SPEEDUP: u64 = 10;
2119

datasource/ethereum/src/ethereum_adapter.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1+
use ethabi::Token;
12
use futures::future;
23
use futures::prelude::*;
3-
use graph::ethabi::Token;
44
use lazy_static::lazy_static;
55
use std::collections::HashSet;
66
use std::sync::Arc;
77

88
use graph::components::ethereum::{EthereumAdapter as EthereumAdapterTrait, *};
99
use graph::prelude::*;
10-
use graph::web3;
11-
use graph::web3::api::Web3;
12-
use graph::web3::transports::batch::Batch;
13-
use graph::web3::types::{Filter, *};
10+
use web3;
11+
use web3::api::Web3;
12+
use web3::transports::batch::Batch;
13+
use web3::types::{Filter, *};
1414

1515
#[derive(Clone)]
1616
pub struct EthereumAdapter<T: web3::Transport> {
@@ -130,8 +130,7 @@ where
130130
addresses: Vec<H160>,
131131
event_signatures: Vec<H256>,
132132
too_many_logs_fingerprint: &'static str,
133-
) -> impl Future<Item = Vec<Log>, Error = graph::tokio_timer::timeout::Error<web3::error::Error>>
134-
{
133+
) -> impl Future<Item = Vec<Log>, Error = tokio_timer::timeout::Error<web3::error::Error>> {
135134
let eth_adapter = self.clone();
136135

137136
retry("eth_getLogs RPC call", &logger)

datasource/ethereum/src/transport.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
use futures::prelude::*;
2-
use graph::serde_json::Value;
1+
use graph::prelude::*;
32
use jsonrpc_core::types::Call;
3+
use serde_json::Value;
44
use std::env;
55

6-
use graph::web3;
7-
use graph::web3::transports::{http, ipc, ws};
8-
use graph::web3::RequestId;
6+
use web3::transports::{http, ipc, ws};
7+
use web3::RequestId;
98

10-
pub use graph::web3::transports::EventLoopHandle;
9+
pub use web3::transports::EventLoopHandle;
1110

1211
/// Abstraction over the different web3 transports.
1312
#[derive(Clone, Debug)]

datasource/ethereum/tests/adapter.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ use std::collections::VecDeque;
55
use std::str::FromStr;
66
use std::sync::{Arc, Mutex};
77

8+
use ethabi::{Function, Param, ParamType, Token};
89
use graph::components::ethereum::EthereumContractCall;
9-
use graph::ethabi::{Function, Param, ParamType, Token};
1010
use graph::prelude::EthereumAdapter as EthereumAdapterTrait;
1111
use graph::prelude::*;
12-
use graph::serde_json;
13-
use graph::web3::error::Error;
14-
use graph::web3::helpers::*;
15-
use graph::web3::types::*;
16-
use graph::web3::{BatchTransport, RequestId, Transport};
1712
use graph_datasource_ethereum::EthereumAdapter;
13+
use web3::error::Error;
14+
use web3::helpers::*;
15+
use web3::types::*;
16+
use web3::{BatchTransport, RequestId, Transport};
1817

1918
pub type Result<T> = Box<Future<Item = T, Error = Error> + Send + 'static>;
2019

graph/src/components/ethereum/adapter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ use web3::error::Error as Web3Error;
99
use web3::types::*;
1010

1111
use super::types::*;
12-
use crate::prelude::BlockHandlerFilter;
13-
use crate::prelude::DataSource;
12+
use crate::prelude::*;
1413
use crate::util::extend::Extend;
1514

1615
/// A collection of attributes that (kind of) uniquely identify an Ethereum blockchain.

graph/src/components/ethereum/listener.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use futures::Stream;
2-
use serde::de::{Deserialize, Deserializer, Error as DeserializerError};
2+
use serde::de::{Deserializer, Error as DeserializerError};
3+
use serde::{Deserialize, Serialize};
34
use std::str::FromStr;
45
use web3::types::H256;
56

0 commit comments

Comments
 (0)