We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe21477 commit e505fc0Copy full SHA for e505fc0
chain/ethereum/src/transport.rs
@@ -42,9 +42,17 @@ pub enum Transport {
42
43
impl Transport {
44
/// Creates an IPC transport.
45
+ ///
46
+ /// Accepts both a raw file path (`/tmp/geth.ipc`) and an `ipc://` URL
47
+ /// (`ipc:///tmp/geth.ipc`). When a URL is provided the file path is
48
+ /// extracted so that the underlying IPC connector receives a plain path.
49
#[cfg(unix)]
50
pub async fn new_ipc(ipc: &str) -> Self {
- let transport = IpcConnect::new(ipc.to_string());
51
+ let path = Url::parse(ipc)
52
+ .ok()
53
+ .map(|u| u.path().to_string())
54
+ .unwrap_or_else(|| ipc.to_string());
55
+ let transport = IpcConnect::new(path);
56
57
Transport::IPC(transport)
58
}
0 commit comments