test: enable ignored tests with geth (#306)

* test: enable ignored tests with geth

* chore: enable celo

* test: ignore for celo
This commit is contained in:
Matthias Seitz 2021-06-05 19:09:12 +02:00 committed by GitHub
parent 57163a4d06
commit 73020af0a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 11 deletions

View File

@ -49,6 +49,6 @@ tempfile = "3.2.0"
[features] [features]
default = ["ws", "ipc"] default = ["ws", "ipc"]
celo = ["ethers-core/celo"] celo = ["ethers-core/celo", "ethers/celo"]
ws = ["tokio", "tokio-tungstenite"] ws = ["tokio", "tokio-tungstenite"]
ipc = ["tokio", "tokio/io-util", "tokio-util", "bytes"] ipc = ["tokio", "tokio/io-util", "tokio-util", "bytes"]

View File

@ -847,18 +847,18 @@ mod tests {
use super::*; use super::*;
use crate::Http; use crate::Http;
use ethers_core::types::H256; use ethers_core::types::H256;
use ethers_core::utils::Geth;
use futures_util::StreamExt; use futures_util::StreamExt;
#[tokio::test] #[tokio::test]
#[ignore] #[cfg_attr(feature = "celo", ignore)]
// Ganache new block filters are super buggy! This test must be run with
// geth or parity running e.g. `geth --dev --rpc --dev.period 1`
async fn test_new_block_filter() { async fn test_new_block_filter() {
let num_blocks = 3; let num_blocks = 3;
let geth = Geth::new().block_time(2u64).spawn();
let provider = Provider::<HttpProvider>::try_from("http://localhost:8545") let provider = Provider::<Http>::try_from(geth.endpoint())
.unwrap() .unwrap()
.interval(Duration::from_millis(1000)); .interval(Duration::from_millis(1000));
let start_block = provider.get_block_number().await.unwrap(); let start_block = provider.get_block_number().await.unwrap();
let stream = provider.watch_blocks().await.unwrap().stream(); let stream = provider.watch_blocks().await.unwrap().stream();
@ -898,15 +898,12 @@ mod tests {
assert_eq!(provider.is_signer().await, false); assert_eq!(provider.is_signer().await, false);
} }
// this must be run with geth or parity since ganache-core still does not support
// eth_pendingTransactions, https://github.com/trufflesuite/ganache-core/issues/405
// example command: `geth --dev --rpc --dev.period 1`
#[tokio::test] #[tokio::test]
#[ignore]
async fn test_new_pending_txs_filter() { async fn test_new_pending_txs_filter() {
let num_txs = 5; let num_txs = 5;
let provider = Provider::<HttpProvider>::try_from("http://localhost:8545") let geth = Geth::new().block_time(2u64).spawn();
let provider = Provider::<Http>::try_from(geth.endpoint())
.unwrap() .unwrap()
.interval(Duration::from_millis(1000)); .interval(Duration::from_millis(1000));
let accounts = provider.get_accounts().await.unwrap(); let accounts = provider.get_accounts().await.unwrap();