From a6ca0a7c45bbc32f39438997f98f8e698d67c861 Mon Sep 17 00:00:00 2001 From: Mauro Medda Date: Thu, 30 May 2024 10:44:29 +0200 Subject: [PATCH] (fix): remove the noncemaanger from eth-spout (#698) --- products/eth-spout/src/main.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/products/eth-spout/src/main.rs b/products/eth-spout/src/main.rs index b63b61d45..0e422ff44 100644 --- a/products/eth-spout/src/main.rs +++ b/products/eth-spout/src/main.rs @@ -11,7 +11,7 @@ use askama::Template; use axum::{extract::State, routing::get, Form, Router}; use bech32::Hrp; use ethers::{ - middleware::{nonce_manager::NonceManagerError, NonceManagerMiddleware, SignerMiddleware}, + middleware::{signer::SignerMiddlewareError, SignerMiddleware}, providers::{Http, Middleware, Provider}, signers::LocalWallet, types::{Address, TransactionRequest, H256}, @@ -34,13 +34,13 @@ struct Home { enum RequestStatus { Sent(H256), AddrErr(anyhow::Error), - SendErr(NonceManagerError, LocalWallet>>), + SendErr(SignerMiddlewareError, LocalWallet>), RateLimitErr(Duration), } async fn home_inner(State(state): State>, status: Option) -> Home { Home { - from_addr: to_checksum(&state.provider.inner().address(), None), + from_addr: to_checksum(&state.provider.address(), None), native_token_symbol: state.config.native_token_symbol.clone(), amount: state.config.eth_amount.clone(), explorer_url: state.config.explorer_url.clone(), @@ -210,7 +210,7 @@ impl Config { } struct AppState { - provider: NonceManagerMiddleware, LocalWallet>>, + provider: SignerMiddleware, LocalWallet>, config: Config, last_request: Mutex>, } @@ -222,8 +222,6 @@ async fn main() -> Result<()> { let provider = Provider::try_from(&config.rpc_url)?; let wallet: LocalWallet = config.private_key.parse()?; let provider = SignerMiddleware::new_with_provider_chain(provider, wallet).await?; - let address = provider.address(); - let provider = NonceManagerMiddleware::new(provider, address); let addr = ("0.0.0.0".parse::()?, config.http_port); let state = Arc::new(AppState {