make etherscan tests serial
This commit is contained in:
parent
1d2746fdde
commit
20948d9fe5
|
@ -1075,6 +1075,7 @@ dependencies = [
|
|||
"serde",
|
||||
"serde-aux",
|
||||
"serde_json",
|
||||
"serial_test",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
]
|
||||
|
@ -1098,6 +1099,7 @@ dependencies = [
|
|||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serial_test",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tracing",
|
||||
|
@ -2794,6 +2796,28 @@ dependencies = [
|
|||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serial_test"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"parking_lot",
|
||||
"serial_test_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serial_test_derive"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha-1"
|
||||
version = "0.9.8"
|
||||
|
|
|
@ -23,6 +23,7 @@ thiserror = "1.0.29"
|
|||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.5", features = ["macros", "rt-multi-thread"] }
|
||||
serial_test = "0.5.1"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
|
|
@ -254,7 +254,10 @@ mod tests {
|
|||
use crate::{contract::VerifyContract, Client};
|
||||
use ethers_core::types::Chain;
|
||||
|
||||
use serial_test::serial;
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
#[ignore]
|
||||
async fn can_fetch_contract_abi() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
@ -266,6 +269,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
#[ignore]
|
||||
async fn can_fetch_contract_source_code() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
@ -277,6 +281,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
#[ignore]
|
||||
async fn can_verify_contract() {
|
||||
// TODO this needs further investigation
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
use std::{collections::HashMap, str::FromStr};
|
||||
|
||||
use ethers_core::types::U256;
|
||||
use serde::{de, Deserialize};
|
||||
use serde_aux::prelude::*;
|
||||
|
||||
use ethers_core::types::U256;
|
||||
|
||||
use crate::{Client, EtherscanError, Response, Result};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
@ -69,11 +70,14 @@ impl Client {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use serial_test::serial;
|
||||
|
||||
use ethers_core::types::Chain;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn gas_estimate_success() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
||||
|
@ -83,6 +87,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn gas_estimate_error() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
||||
|
@ -92,6 +97,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn gas_oracle_success() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
//! Bindings for [etherscan.io web api](https://docs.etherscan.io/)
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use reqwest::{header, Url};
|
||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||
|
||||
use errors::EtherscanError;
|
||||
use ethers_core::{abi::Address, types::Chain};
|
||||
|
||||
pub mod contract;
|
||||
pub mod errors;
|
||||
pub mod gas;
|
||||
pub mod transaction;
|
||||
|
||||
use errors::EtherscanError;
|
||||
use ethers_core::{abi::Address, types::Chain};
|
||||
use reqwest::{header, Url};
|
||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, EtherscanError>;
|
||||
|
||||
/// The Etherscan.io API client.
|
||||
|
@ -174,9 +176,10 @@ struct Query<'a, T: Serialize> {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{Client, EtherscanError};
|
||||
use ethers_core::types::Chain;
|
||||
|
||||
use crate::{Client, EtherscanError};
|
||||
|
||||
#[test]
|
||||
fn chain_not_supported() {
|
||||
let err = Client::new_from_env(Chain::XDai).unwrap_err();
|
||||
|
|
|
@ -52,10 +52,14 @@ impl Client {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use serial_test::serial;
|
||||
|
||||
use crate::Chain;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn check_contract_execution_status_success() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
||||
|
@ -69,6 +73,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn check_contract_execution_status_error() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
||||
|
@ -84,6 +89,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn check_transaction_receipt_status_success() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
||||
|
@ -97,6 +103,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn check_transaction_receipt_status_failed() {
|
||||
let client = Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ rand = { version = "0.8.4", default-features = false }
|
|||
ethers-providers = { version = "^0.6.0", path = "../ethers-providers", default-features = false, features = ["ws", "rustls"] }
|
||||
once_cell = "1.8.0"
|
||||
ethers-solc = { version = "^0.1.0", path = "../ethers-solc", default-features = false }
|
||||
serial_test = "0.5.1"
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
||||
tokio = { version = "1.5", default-features = false, features = ["rt", "macros", "time"] }
|
||||
|
|
|
@ -10,6 +10,7 @@ use ethers_middleware::gas_oracle::{
|
|||
GasOracleMiddleware,
|
||||
};
|
||||
use ethers_providers::{Http, Middleware, Provider};
|
||||
use serial_test::serial;
|
||||
|
||||
#[derive(Debug)]
|
||||
struct FakeGasOracle {
|
||||
|
@ -60,6 +61,7 @@ async fn eth_gas_station() {
|
|||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial]
|
||||
async fn etherscan() {
|
||||
let etherscan_client = ethers_etherscan::Client::new_from_env(Chain::Mainnet).unwrap();
|
||||
|
||||
|
|
Loading…
Reference in New Issue