-
Notifications
You must be signed in to change notification settings - Fork 54
/
mockNetworkInfoProvider.ts
30 lines (27 loc) · 1.04 KB
/
mockNetworkInfoProvider.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { genesisParameters, ledgerTip, protocolParameters } from './mockData';
import { testnetEraSummaries } from '../eraSummaries';
export const networkInfo = {
lovelaceSupply: {
circulating: 42_064_399_450_423_723n,
total: 40_267_211_394_073_980n
},
network: {
eraSummaries: testnetEraSummaries,
magic: 1_097_911_063
},
stake: {
active: 1_060_378_314_781_343n,
live: 15_001_884_895_856_815n
}
};
/** Provider stub for testing */
export const mockNetworkInfoProvider = () => ({
eraSummaries: jest.fn().mockResolvedValue(networkInfo.network.eraSummaries),
genesisParameters: jest.fn().mockResolvedValue(genesisParameters),
healthCheck: jest.fn().mockResolvedValue({ ok: true }),
ledgerTip: jest.fn().mockResolvedValue(ledgerTip),
lovelaceSupply: jest.fn().mockResolvedValue(networkInfo.lovelaceSupply),
protocolParameters: jest.fn().mockResolvedValue(protocolParameters),
stake: jest.fn().mockResolvedValue(networkInfo.stake)
});
export type NetworkInfoProviderStub = ReturnType<typeof mockNetworkInfoProvider>;