• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hicommonwealth / commonwealth / 21362370418

26 Jan 2026 03:01PM UTC coverage: 37.569% (-0.2%) from 37.791%
21362370418

Pull #13239

github

web-flow
Merge e4c1aa5b3 into f0b8d6d44
Pull Request #13239: Fixes scripts to run macos containers

2054 of 5897 branches covered (34.83%)

Branch coverage included in aggregate %.

3605 of 9166 relevant lines covered (39.33%)

46.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.44
/libs/model/src/utils/testChainNodeUtils.ts
1
import { ValidChains } from '@hicommonwealth/evm-protocols';
2
import { BalanceType } from '@hicommonwealth/shared';
3
import { models } from '../database';
4
import { ChainNodeInstance } from '../models';
5
import { buildChainNodeUrl } from './utils';
6

7
export function createTestRpc(
8
  ethChainId: ValidChains,
9
  scope: 'private' | 'public' = 'public',
13✔
10
): string {
11
  switch (ethChainId) {
26!
12
    case ValidChains.Arbitrum:
13
      return buildChainNodeUrl('https://arb-mainnet.g.alchemy.com/v2/', scope);
2✔
14
    case ValidChains.Mainnet:
15
      return buildChainNodeUrl('https://eth-mainnet.g.alchemy.com/v2/', scope);
2✔
16
    case ValidChains.Optimism:
17
      return buildChainNodeUrl('https://opt-mainnet.g.alchemy.com/v2/', scope);
2✔
18
    case ValidChains.Linea:
19
      return buildChainNodeUrl(
2✔
20
        'https://linea-mainnet.g.alchemy.com/v2/',
21
        scope,
22
      );
23
    case ValidChains.Blast:
24
      return buildChainNodeUrl(
2✔
25
        'https://blast-mainnet.g.alchemy.com/v2/',
26
        scope,
27
      );
28
    case ValidChains.Sepolia:
29
      return buildChainNodeUrl('https://eth-sepolia.g.alchemy.com/v2/', scope);
4✔
30
    case ValidChains.SepoliaBase:
31
      return buildChainNodeUrl('https://base-sepolia.g.alchemy.com/v2/', scope);
2✔
32
    case ValidChains.Base:
33
      return buildChainNodeUrl('https://base-mainnet.g.alchemy.com/v2/', scope);
2✔
34
    case ValidChains.BSC:
35
      return buildChainNodeUrl('https://bnb-mainnet.g.alchemy.com/v2/', scope);
2✔
36
    case ValidChains.SKALE_TEST:
37
      return 'https://testnet.skalenodes.com/v1/giant-half-dual-testnet';
2✔
38
    case ValidChains.Anvil:
39
      return 'http://localhost:5502';
2✔
40
    case ValidChains.Soneium:
41
      return buildChainNodeUrl('https://rpc.soneium.com/', scope);
2✔
42
    default:
43
      throw new Error(`Eth chain id ${ethChainId} not supported`);
×
44
  }
45
}
46

47
export async function createEventRegistryChainNodes() {
48
  const promises: Array<Promise<[ChainNodeInstance, boolean]>> = [];
1✔
49
  for (const ethChainId of Object.values(ValidChains)) {
1✔
50
    if (typeof ethChainId === 'number') {
24✔
51
      promises.push(
12✔
52
        models.ChainNode.findOrCreate({
53
          where: {
54
            eth_chain_id: ethChainId,
55
          },
56
          defaults: {
57
            url: createTestRpc(ethChainId),
58
            private_url: createTestRpc(ethChainId, 'private'),
59
            balance_type: BalanceType.Ethereum,
60
            name: `${ethChainId} Node`,
61
          },
62
        }),
63
      );
64
    }
65
  }
66
  const chainNodes = await Promise.all(promises);
1✔
67
  return chainNodes.map((c) => c[0]);
12✔
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc