// QA only, loaded with node --require by qa/netconv.test.mjs: chain.js talks https to its RPC; a local mock RPC speaks plain http. const https = require('https'), http = require('http'); const PORT = Number(process.env.QA_RPC_PORT); const real = https.request; https.request = function (opts, cb) { if (opts && opts.hostname === '127.0.0.1') return http.request(Object.assign({}, opts, { port: PORT }), cb); return real.apply(https, arguments); };