use to_raw_value instead of to_string

This commit is contained in:
Bryan Stitt 2023-10-17 10:03:52 -07:00
parent 1e707251ef
commit 5071e8b298

@ -11,7 +11,7 @@ use ethers::{
};
use hashbrown::hash_map::DefaultHashBuilder;
use moka::future::Cache;
use serde_json::value::RawValue;
use serde_json::value::{to_raw_value, RawValue};
use std::{
hash::{BuildHasher, Hash, Hasher},
sync::Arc,
@ -184,7 +184,7 @@ impl TryFrom<Web3ProxyResult<jsonrpc::SingleResponse>> for ForwardedResponse<Arc
impl From<serde_json::Value> for ForwardedResponse<Arc<RawValue>> {
fn from(value: serde_json::Value) -> Self {
let value = RawValue::from_string(value.to_string()).unwrap();
let value = to_raw_value(&value).unwrap();
value.into()
}