From 026ce592f3b16bd771651dda12a013eb9b010dab Mon Sep 17 00:00:00 2001 From: Stan Kladko <13399135+kladkogex@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:49:58 +0000 Subject: [PATCH] 1767 Fixed test crash --- test/unittests/libweb3jsonrpc/jsonrpc.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index 2850d4661..3ca98572b 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -245,9 +245,14 @@ class TestIpcClient : public jsonrpc::IClientConnector { }; struct JsonRpcFixture : public TestOutputHelperFixture { + + // chain params needs to be a field of JsonRPCFixture + // since references to it are passed to the server + ChainParams chainParams; + JsonRpcFixture( const std::string& _config = "", bool _owner = true, bool _deploymentControl = true, bool _generation2 = false, bool _mtmEnabled = false ) { dev::p2p::NetworkPreferences nprefs; - ChainParams chainParams; + if ( _config != "" ) { if ( !_generation2 ) {