@@ -11,21 +11,26 @@ public class ApiRunner extends Assert {
11
11
private static final EtherScanApi apiRopsten ;
12
12
private static final EtherScanApi apiRinkeby ;
13
13
private static final EtherScanApi apiKovan ;
14
+ private static final String key ;
14
15
15
16
static {
16
17
final String apiKey = System .getenv ("API_KEY" );
17
- final String keyOrDefault = (apiKey == null || apiKey .isEmpty ())
18
+ key = (apiKey == null || apiKey .isEmpty ())
18
19
? EtherScanApi .DEFAULT_KEY
19
20
: apiKey ;
20
21
21
- final QueueManager queue = keyOrDefault .equals (EtherScanApi .DEFAULT_KEY )
22
+ final QueueManager queue = key .equals (EtherScanApi .DEFAULT_KEY )
22
23
? QueueManager .DEFAULT_KEY_QUEUE
23
24
: new QueueManager (1 , 2 );
24
25
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 ;
29
34
}
30
35
31
36
public static EtherScanApi getApi () {
0 commit comments