@Test public void shouldLoadDevelopmentConfigFile() { final GenesisConfigFile config = GenesisConfigFile.development(); // Sanity check some basic properties to confirm this is the dev file. assertThat(config.getConfigOptions().isEthHash()).isTrue(); assertThat(config.getConfigOptions().getChainId()).hasValue(DEVELOPMENT_CHAIN_ID); assertThat(config.getAllocations().map(GenesisAllocation::getAddress)) .contains( "fe3b557e8fb62b89f4916b721be55ceb828dbd73", "627306090abab3a6e1400e9345bc60c78a8bef57", "f17f52151ebef6c7334fad080c5704d77216b732"); }
@Test public void shouldLoadMainnetConfigFile() { final GenesisConfigFile config = GenesisConfigFile.mainnet(); // Sanity check some basic properties to confirm this is the mainnet file. assertThat(config.getConfigOptions().isEthHash()).isTrue(); assertThat(config.getConfigOptions().getChainId()).hasValue(MAINNET_CHAIN_ID); assertThat(config.getAllocations().map(GenesisAllocation::getAddress)) .contains( "000d836201318ec6899a67540690382780743280", "001762430ea9c3a26e5749afdb70da5f78ddbb8c", "001d14804b399c6ef80e64576f657660804fec0b"); }
@Test public void shouldGetAllocations() { final GenesisConfigFile config = GenesisConfigFile.fromConfig( "{" + " \"alloc\": {" + " \"fe3b557e8fb62b89f4916b721be55ceb828dbd73\": {" + " \"balance\": \"0xad78ebc5ac6200000\"" + " }," + " \"627306090abaB3A6e1400e9345bC60c78a8BEf57\": {" + " \"balance\": \"1000\"" + " }," + " \"f17f52151EbEF6C7334FAD080c5704D77216b732\": {" + " \"balance\": \"90000000000000000000000\"" + " }" + " }" + "}"); final Map<String, String> allocations = config .getAllocations() .collect( Collectors.toMap(GenesisAllocation::getAddress, GenesisAllocation::getBalance)); assertThat(allocations) .containsOnly( entry("fe3b557e8fb62b89f4916b721be55ceb828dbd73", "0xad78ebc5ac6200000"), entry("627306090abab3a6e1400e9345bc60c78a8bef57", "1000"), entry("f17f52151ebef6c7334fad080c5704d77216b732", "90000000000000000000000")); }