this works but i dont like it
This commit is contained in:
parent
3427f5eab9
commit
10cd52f19a
@ -131,6 +131,7 @@ impl Web3Connections {
|
|||||||
params: Option<Box<RawValue>>,
|
params: Option<Box<RawValue>>,
|
||||||
response_sender: flume::Sender<anyhow::Result<Box<RawValue>>>,
|
response_sender: flume::Sender<anyhow::Result<Box<RawValue>>>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
|
// TODO: if only 1 active_request_handles, do self.try_send_request
|
||||||
let mut unordered_futures = FuturesUnordered::new();
|
let mut unordered_futures = FuturesUnordered::new();
|
||||||
|
|
||||||
for connection in active_request_handles {
|
for connection in active_request_handles {
|
||||||
|
@ -9,6 +9,7 @@ pub struct JsonRpcRequest {
|
|||||||
// pub jsonrpc: Box<RawValue>,
|
// pub jsonrpc: Box<RawValue>,
|
||||||
pub id: Box<RawValue>,
|
pub id: Box<RawValue>,
|
||||||
pub method: String,
|
pub method: String,
|
||||||
|
// TODO: should we have the default of [] here instead?
|
||||||
pub params: Option<Box<RawValue>>,
|
pub params: Option<Box<RawValue>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +110,11 @@ impl<'de> Deserialize<'de> for JsonRpcRequestEnum {
|
|||||||
|
|
||||||
let id = id.ok_or_else(|| de::Error::missing_field("id"))?;
|
let id = id.ok_or_else(|| de::Error::missing_field("id"))?;
|
||||||
let method = method.ok_or_else(|| de::Error::missing_field("method"))?;
|
let method = method.ok_or_else(|| de::Error::missing_field("method"))?;
|
||||||
let params = params.ok_or_else(|| de::Error::missing_field("params"))?;
|
|
||||||
|
let params: Option<Box<RawValue>> = match params {
|
||||||
|
None => Some(RawValue::from_string("[]".to_string()).unwrap()),
|
||||||
|
Some(x) => Some(x),
|
||||||
|
};
|
||||||
|
|
||||||
let single = JsonRpcRequest { id, method, params };
|
let single = JsonRpcRequest { id, method, params };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user