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 ) {