Skip to content

Commit

Permalink
chore: Fall back to legacy config loading in migration startup (#17433)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Hess <matt.hess@swirldslabs.com>
  • Loading branch information
mhess-swl authored Jan 17, 2025
1 parent cf61d7c commit 0129e3a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public DiskStartupNetworks(@NonNull final ConfigProvider configProvider) {
public Network genesisNetworkOrThrow(@NonNull final Configuration platformConfig) {
requireNonNull(platformConfig);
return loadNetwork(AssetUse.GENESIS, configProvider.getConfiguration(), GENESIS_NETWORK_JSON)
.or(() -> genesisNetworkFromConfigTxt(platformConfig))
.or(() -> networkFromConfigTxt(platformConfig))
.orElseThrow(() -> new IllegalStateException("Genesis network not found"));
}

Expand Down Expand Up @@ -164,8 +164,8 @@ public void archiveStartupNetworks() {

@Override
public Network migrationNetworkOrThrow() {
// FUTURE - look into sourcing this from a config.txt and public.pfx to ease migration
return loadNetwork(AssetUse.MIGRATION, configProvider.getConfiguration(), OVERRIDE_NETWORK_JSON)
.or(() -> networkFromConfigTxt(configProvider.getConfiguration()))
.orElseThrow(() -> new IllegalStateException("Transplant network not found"));
}

Expand Down Expand Up @@ -294,7 +294,7 @@ public static Optional<Network> loadNetworkFrom(@NonNull final Path path) {
* @return the loaded genesis network, if it was found and successfully loaded
*/
@Deprecated(forRemoval = true)
private Optional<Network> genesisNetworkFromConfigTxt(@NonNull final Configuration platformConfig) {
private Optional<Network> networkFromConfigTxt(@NonNull final Configuration platformConfig) {
try {
log.info("No genesis-network.json detected, falling back to config.txt and initNodeSecurity()");
final AddressBook legacyBook;
Expand Down

0 comments on commit 0129e3a

Please sign in to comment.