(contractManifest: Manifest, enabledContracts: readonly string[])
| 94 | describe('deployer insertion logic', () => { |
| 95 | // Simulate the deployer insertion logic from buildGenesis without the full pipeline. |
| 96 | const simulateDeployerInsertion = (contractManifest: Manifest, enabledContracts: readonly string[]) => { |
| 97 | const allocs: Record<string, GenesisAccountAlloc> = {} |
| 98 | |
| 99 | for (const contractName of enabledContracts) { |
| 100 | const entry = contractManifest[contractName] |
| 101 | if (entry?.type === 'one-time-address') { |
| 102 | const [addr, alloc] = buildAccountAlloc({ address: entry.deployer, balance: 0n, nonce: 1n }) |
| 103 | if (addr in allocs) { |
| 104 | throw new Error(`Duplicate deployer account: ${addr}`) |
| 105 | } |
| 106 | allocs[addr] = alloc |
| 107 | } |
| 108 | } |
| 109 | return allocs |
| 110 | } |
| 111 | |
| 112 | it('inserts deployer allocs for all one-time-address contracts', () => { |
| 113 | const allocs = simulateDeployerInsertion(typedManifest, externalContracts) |
no test coverage detected