fix: failing CI (#1847)

* fix gasprice

* fmt

* docs

* fix examples typo

* fix examples

* clippy
This commit is contained in:
DaniPopes 2022-11-09 17:09:03 +01:00 committed by GitHub
parent 5c9a048f73
commit 64a70cfd57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 16 deletions

View File

@ -174,3 +174,13 @@ required-features = ["yubi"]
name = "paginated_logs"
path = "examples/paginated_logs.rs"
required-features = ["rustls"]
[[example]]
name = "subscribe_contract_events"
path = "examples/subscribe_contract_events.rs"
required-features = ["rustls", "ws"]
[[example]]
name = "subscribe_contract_events_with_meta"
path = "examples/subscribe_contract_events_with_meta.rs"
required-features = ["rustls", "ws"]

View File

@ -28,7 +28,7 @@ pub const MULTICALL_ADDRESS: Address = H160([
]);
/// The chain IDs that [`MULTICALL_ADDRESS`] has been deployed to.
/// Taken from: https://github.com/mds1/multicall#multicall3-contract-addresses
/// Taken from: <https://github.com/mds1/multicall#multicall3-contract-addresses>
pub static MULTICALL_SUPPORTED_CHAIN_IDS: Lazy<[U256; 48]> = Lazy::new(|| {
use Chain::*;
[
@ -42,7 +42,7 @@ pub static MULTICALL_SUPPORTED_CHAIN_IDS: Lazy<[U256; 48]> = Lazy::new(|| {
U256::from(OptimismGoerli), // OptimismGoerli
U256::from(OptimismKovan), // OptimismKovan
U256::from(Arbitrum), // Arbitrum
U256::from(421613), // ArbitrumGoerli,
U256::from(ArbitrumGoerli), // ArbitrumGoerli,
U256::from(ArbitrumTestnet), // Arbitrum Rinkeby
U256::from(Polygon), // Polygon
U256::from(PolygonMumbai), // PolygonMumbai

View File

@ -6,7 +6,7 @@ pub type Selector = [u8; 4];
pub use ethabi::ethereum_types::H256 as TxHash;
pub use ethabi::ethereum_types::{
Address, BigEndianHash, Bloom, H128, H160, H256, H32, H512, H64, U128, U256, U64, U512,
Address, BigEndianHash, Bloom, H128, H160, H256, H32, H512, H64, U128, U256, U512, U64,
};
pub mod transaction;

View File

@ -156,7 +156,7 @@ where
K: TryInto<Units, Error = ConversionError> + Copy,
{
let exponent: u32 = units.try_into()?.as_num();
let mut amount_str = amount.to_string().replace("_", "");
let mut amount_str = amount.to_string().replace('_', "");
let dec_len = if let Some(di) = amount_str.find('.') {
amount_str.remove(di);
amount_str[di..].len() as u32

View File

@ -147,18 +147,22 @@ async fn typed_txs() {
assert_eq!(tx.transaction_type, Some(expected.into()));
}
let mut nonce = provider.get_transaction_count(address, None).await.unwrap();
let tx = TransactionRequest::new().from(address).to(address).nonce(nonce);
nonce += 1.into();
let tx1 =
provider.send_transaction(tx.clone(), Some(BlockNumber::Pending.into())).await.unwrap();
let nonce = provider.get_transaction_count(address, None).await.unwrap();
let bn = Some(BlockNumber::Pending.into());
let gas_price = provider.get_gas_price().await.unwrap() * 125 / 100;
let tx = tx.clone().nonce(nonce).from(address).to(address).with_access_list(vec![]);
nonce += 1.into();
let tx2 = provider.send_transaction(tx, Some(BlockNumber::Pending.into())).await.unwrap();
let tx = TransactionRequest::new().from(address).to(address).nonce(nonce).gas_price(gas_price);
let tx1 = provider.send_transaction(tx.clone(), bn).await.unwrap();
let tx = Eip1559TransactionRequest::new().from(address).to(address).nonce(nonce);
let tx3 = provider.send_transaction(tx, Some(BlockNumber::Pending.into())).await.unwrap();
let tx = tx.clone().from(address).to(address).nonce(nonce + 1).with_access_list(vec![]);
let tx2 = provider.send_transaction(tx, bn).await.unwrap();
let tx = Eip1559TransactionRequest::new()
.from(address)
.to(address)
.nonce(nonce + 2)
.max_fee_per_gas(gas_price);
let tx3 = provider.send_transaction(tx, bn).await.unwrap();
futures_util::join!(check_tx(tx1, 0), check_tx(tx2, 1), check_tx(tx3, 2),);
}

View File

@ -10,7 +10,7 @@ ignored=(
"subscribe_logs"
"trezor"
"yubi"
"remove_liquidty"
"remove_liquidity"
)
# run all examples
@ -21,5 +21,5 @@ for file in examples/*.rs; do
continue
fi
echo "running: $file"
cargo r -p ethers --example "$(basename "$name")" --features "ethers-solc"
cargo r -p ethers --example "$(basename "$name")" --features "ethers-solc rustls ws"
done