Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiekat committed Jan 10, 2023
1 parent 0bf27d1 commit a05785b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ethers-providers/src/transports/quorum.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::{
convert::{TryFrom, TryInto},
fmt::Debug,
future::Future,
pin::Pin,
Expand Down Expand Up @@ -512,7 +511,7 @@ where
method: &str,
params: T,
) -> Result<R, Self::Error> {
let mut params = params.try_into()?;
let mut params = WrappedParams::new(params)?;
self.normalize_request(method, &mut params).await;

match method {
Expand Down Expand Up @@ -700,10 +699,8 @@ pub enum WrappedParams {
Zst,
}

impl<T: Serialize> TryFrom<T> for WrappedParams {
type Error = serde_json::Error;

fn try_from(value: T) -> Result<Self, Self::Error> {
impl WrappedParams {
fn new<T: Serialize>(params: T) -> Result<Self, serde_json::Error> {
Ok(if std::mem::size_of::<T>() == 0 {
// we don't want `()` to become `"null"`.
WrappedParams::Zst
Expand Down

0 comments on commit a05785b

Please sign in to comment.