Coverage Summary for Class: NetworkUpgrade (org.ethereum.config.blockchain.upgrades)

Class Class, % Method, % Line, %
NetworkUpgrade 100% (1/1) 100% (5/5) 94.4% (17/18)


1 /* 2  * This file is part of RskJ 3  * Copyright (C) 2019 RSK Labs Ltd. 4  * 5  * This program is free software: you can redistribute it and/or modify 6  * it under the terms of the GNU Lesser General Public License as published by 7  * the Free Software Foundation, either version 3 of the License, or 8  * (at your option) any later version. 9  * 10  * This program is distributed in the hope that it will be useful, 11  * but WITHOUT ANY WARRANTY; without even the implied warranty of 12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13  * GNU Lesser General Public License for more details. 14  * 15  * You should have received a copy of the GNU Lesser General Public License 16  * along with this program. If not, see <http://www.gnu.org/licenses/>. 17  */ 18  19 package org.ethereum.config.blockchain.upgrades; 20  21 public enum NetworkUpgrade { 22  GENESIS("genesis"), 23  BAHAMAS("bahamas"), 24  AFTER_BRIDGE_SYNC("afterBridgeSync"), 25  ORCHID("orchid"), 26  ORCHID_060("orchid060"), 27  WASABI_100("wasabi100"), 28  PAPYRUS_200("papyrus200"), 29  TWOTOTHREE("twoToThree"), 30  IRIS300("iris300"); 31  32  private String name; 33  34  NetworkUpgrade(String name) { 35  this.name = name; 36  } 37  38  public String getName() { 39  return name; 40  } 41  42  public static NetworkUpgrade named(String networkUpgradeName) { 43  for (NetworkUpgrade networkUpgrade : NetworkUpgrade.values()) { 44  if (networkUpgrade.name.equals(networkUpgradeName)) { 45  return networkUpgrade; 46  } 47  } 48  49  throw new IllegalArgumentException(String.format("Unknown network upgrade %s", networkUpgradeName)); 50  } 51 }