@ledgerhq/coin-hedera
Version:
Ledger Hedera Coin integration
21 lines • 693 B
JavaScript
import { Client } from "@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.
*/
export const getMockedRpcClient = () => {
let client = null;
const getOrCreate = () => {
client ??= Client.forMainnet().setMaxNodesPerTransaction(1);
return client;
};
return {
getInstance: async () => getOrCreate(),
broadcastTransaction: async () => ({}),
_resetInstance: async () => {
client?.close();
client = null;
},
};
};
//# sourceMappingURL=rpc.fixture.js.map