@@ -11,21 +11,26 @@ public class ApiRunner extends Assert {
1111 private static final EtherScanApi apiRopsten ;
1212 private static final EtherScanApi apiRinkeby ;
1313 private static final EtherScanApi apiKovan ;
14+ private static final String key ;
1415
1516 static {
1617 final String apiKey = System .getenv ("API_KEY" );
17- final String keyOrDefault = (apiKey == null || apiKey .isEmpty ())
18+ key = (apiKey == null || apiKey .isEmpty ())
1819 ? EtherScanApi .DEFAULT_KEY
1920 : apiKey ;
2021
21- final QueueManager queue = keyOrDefault .equals (EtherScanApi .DEFAULT_KEY )
22+ final QueueManager queue = key .equals (EtherScanApi .DEFAULT_KEY )
2223 ? QueueManager .DEFAULT_KEY_QUEUE
2324 : new QueueManager (1 , 2 );
2425
25- api = new EtherScanApi (keyOrDefault , EthNetwork .MAINNET , queue );
26- apiRopsten = new EtherScanApi (keyOrDefault , EthNetwork .ROPSTEN , queue );
27- apiRinkeby = new EtherScanApi (keyOrDefault , EthNetwork .RINKEBY , queue );
28- apiKovan = new EtherScanApi (keyOrDefault , EthNetwork .KOVAN , queue );
26+ api = new EtherScanApi (key , EthNetwork .MAINNET , queue );
27+ apiRopsten = new EtherScanApi (key , EthNetwork .ROPSTEN , queue );
28+ apiRinkeby = new EtherScanApi (key , EthNetwork .RINKEBY , queue );
29+ apiKovan = new EtherScanApi (key , EthNetwork .KOVAN , queue );
30+ }
31+
32+ public static String getKey () {
33+ return key ;
2934 }
3035
3136 public static EtherScanApi getApi () {
0 commit comments