Skip to content

Commit d41ee32

Browse files
silence RPC warning when there is no RPC configured
1 parent 987627d commit d41ee32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Echidna/Onchain.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ saveRpcCache env = do
4343
(Just dir, Just n) -> do
4444
cache <- readMVar (env.fetchSession.sharedCache)
4545
EVM.Fetch.saveCache dir (fromIntegral n) cache
46-
(_, Nothing) -> putStrLn "Warning: cannot save RPC cache without a specified block number."
46+
(_, Nothing) -> if (env.cfg.rpcUrl /= Nothing)
47+
then putStrLn "Warning: cannot save RPC cache without a specified block number."
48+
else pure ()
4749
(Nothing, _) -> pure ()
4850

4951
rpcUrlEnv :: IO (Maybe Text)

0 commit comments

Comments
 (0)