Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

test: set nonce explicitly #1354

Merged
merged 1 commit into from
Jun 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: set nonce for tx stream explicitly
  • Loading branch information
mattsse committed Jun 7, 2022
commit 2432eb239b433d40521cb7280b9a2af0daca56f8
6 changes: 3 additions & 3 deletions ethers-providers/src/call_raw.rs
Original file line number Diff line number Diff line change
@@ -495,10 +495,10 @@ pub mod spoof {
#[cfg(test)]
mod tests {
use super::*;
use crate::{Http, Middleware, Provider};
use crate::{Http, Provider};
use ethers_core::{
types::TransactionRequest,
utils::{get_contract_address, keccak256, parse_ether, Anvil, Geth},
utils::{get_contract_address, keccak256, parse_ether, Geth},
};
use std::convert::TryFrom;

@@ -516,7 +516,7 @@ mod tests {
}

// Tests "roundtrip" serialization of calls: deserialize(serialize(call)) == call
fn test_encode<'a, P>(call: CallBuilder<'a, P>) {
fn test_encode<P>(call: CallBuilder<P>) {
let input = call.unwrap().input;
let ser = utils::serialize(&input).to_string();
let de: CallInputOwned = serde_json::from_str(&ser).unwrap();
2 changes: 1 addition & 1 deletion ethers-providers/src/pending_escalator.rs
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ where
poll_broadcast_fut!(cx, this, fut);
}
Sleeping(delay) => {
let _ready = futures_util::ready!(delay.as_mut().poll(cx));
futures_util::ready!(delay.as_mut().poll(cx));
// if broadcast timer has elapsed and if we have a TX to
// broadcast, broadcast it
if this.last.elapsed() > *this.broadcast_interval {
2 changes: 1 addition & 1 deletion ethers-providers/src/pending_transaction.rs
Original file line number Diff line number Diff line change
@@ -172,7 +172,7 @@ impl<'a, P: JsonRpcClient> Future for PendingTransaction<'a, P> {

match this.state {
PendingTxState::InitialDelay(fut) => {
let _ready = futures_util::ready!(fut.as_mut().poll(ctx));
futures_util::ready!(fut.as_mut().poll(ctx));
tracing::debug!("Starting to poll pending tx {:?}", *this.tx_hash);
let fut = Box::pin(this.provider.get_transaction(*this.tx_hash));
rewake_with_new_state!(ctx, this, PendingTxState::GettingTx(fut));
10 changes: 7 additions & 3 deletions ethers-providers/src/stream.rs
Original file line number Diff line number Diff line change
@@ -284,9 +284,13 @@ mod tests {
let tx = TransactionRequest::new().from(accounts[0]).to(accounts[0]).value(1e18 as u64);

let mut sending = futures_util::future::join_all(
std::iter::repeat(tx.clone()).take(num_txs).map(|tx| async {
provider.send_transaction(tx, None).await.unwrap().await.unwrap().unwrap()
}),
std::iter::repeat(tx.clone())
.take(num_txs)
.enumerate()
.map(|(nonce, tx)| tx.nonce(nonce))
.map(|tx| async {
provider.send_transaction(tx, None).await.unwrap().await.unwrap().unwrap()
}),
)
.fuse();