From ff061858a897cb374db22f7c80e8b6f2bd0e06b5 Mon Sep 17 00:00:00 2001 From: ryardley Date: Sat, 7 Dec 2024 18:14:05 +1100 Subject: [PATCH] Fix tests --- packages/ciphernode/evm/src/helpers.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/ciphernode/evm/src/helpers.rs b/packages/ciphernode/evm/src/helpers.rs index 168cea26..08a5921f 100644 --- a/packages/ciphernode/evm/src/helpers.rs +++ b/packages/ciphernode/evm/src/helpers.rs @@ -225,30 +225,32 @@ mod test { use super::*; #[test] - fn test_rpc_type_conversion() { + fn test_rpc_type_conversion() -> Result<()> { // Test HTTP URLs let http = RPC::from_url("http://localhost:8545/").unwrap(); assert!(matches!(http, RPC::Http(_))); - assert_eq!(http.as_http_url(), "http://localhost:8545/"); - assert_eq!(http.as_ws_url(), "ws://localhost:8545/"); + assert_eq!(http.as_http_url()?, "http://localhost:8545/"); + assert_eq!(http.as_ws_url()?, "ws://localhost:8545/"); // Test HTTPS URLs let https = RPC::from_url("https://example.com/").unwrap(); assert!(matches!(https, RPC::Https(_))); - assert_eq!(https.as_http_url(), "https://example.com/"); - assert_eq!(https.as_ws_url(), "wss://example.com/"); + assert_eq!(https.as_http_url()?, "https://example.com/"); + assert_eq!(https.as_ws_url()?, "wss://example.com/"); // Test WS URLs let ws = RPC::from_url("ws://localhost:8545/").unwrap(); assert!(matches!(ws, RPC::Ws(_))); - assert_eq!(ws.as_http_url(), "http://localhost:8545/"); - assert_eq!(ws.as_ws_url(), "ws://localhost:8545/"); + assert_eq!(ws.as_http_url()?, "http://localhost:8545/"); + assert_eq!(ws.as_ws_url()?, "ws://localhost:8545/"); // Test WSS URLs let wss = RPC::from_url("wss://example.com/").unwrap(); assert!(matches!(wss, RPC::Wss(_))); - assert_eq!(wss.as_http_url(), "https://example.com/"); - assert_eq!(wss.as_ws_url(), "wss://example.com/"); + assert_eq!(wss.as_http_url()?, "https://example.com/"); + assert_eq!(wss.as_ws_url()?, "wss://example.com/"); + + Ok(()) } #[test]