@ledgerhq/coin-hedera
Version:
Ledger Hedera Coin integration
25 lines • 855 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMockedRpcClient = void 0;
const sdk_1 = require("@hashgraph/sdk");
/**
* Returns a minimal rpcClient for use in jest.mock("../network/rpc") factories.
* Client.forMainnet() uses a static node list — unlike forMainnetAsync(), it makes no network calls.
*/
const getMockedRpcClient = () => {
let client = null;
const getOrCreate = () => {
client ??= sdk_1.Client.forMainnet().setMaxNodesPerTransaction(1);
return client;
};
return {
getInstance: async () => getOrCreate(),
broadcastTransaction: async () => ({}),
_resetInstance: async () => {
client?.close();
client = null;
},
};
};
exports.getMockedRpcClient = getMockedRpcClient;
//# sourceMappingURL=rpc.fixture.js.map