Coverage Summary for Class: BridgeConstants (co.rsk.config)

Class Class, % Method, % Line, %
BridgeConstants 100% (1/1) 6.1% (2/33) 6.1% (2/33)


1 /* 2  * This file is part of RskJ 3  * Copyright (C) 2017 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 co.rsk.config; 20  21 import co.rsk.bitcoinj.core.BtcECKey; 22 import co.rsk.bitcoinj.core.Coin; 23 import co.rsk.bitcoinj.core.NetworkParameters; 24 import co.rsk.peg.AddressBasedAuthorizer; 25 import co.rsk.peg.Federation; 26 import java.util.List; 27  28 public class BridgeConstants { 29  protected String btcParamsString; 30  31  protected Federation genesisFederation; 32  33  protected int btc2RskMinimumAcceptableConfirmations; 34  protected int btc2RskMinimumAcceptableConfirmationsOnRsk; 35  protected int rsk2BtcMinimumAcceptableConfirmations; 36  37  protected int updateBridgeExecutionPeriod; 38  39  protected int maxBtcHeadersPerRskBlock; 40  41  protected Coin legacyMinimumPeginTxValueInSatoshis; 42  protected Coin minimumPeginTxValueInSatoshis; 43  protected Coin legacyMinimumPegoutTxValueInSatoshis; 44  protected Coin minimumPegoutTxValueInSatoshis; 45  46  protected long federationActivationAge; 47  48  protected long fundsMigrationAgeSinceActivationBegin; 49  protected long fundsMigrationAgeSinceActivationEnd; 50  51  protected AddressBasedAuthorizer federationChangeAuthorizer; 52  53  protected AddressBasedAuthorizer lockWhitelistChangeAuthorizer; 54  55  protected AddressBasedAuthorizer feePerKbChangeAuthorizer; 56  57  protected Coin genesisFeePerKb; 58  59  protected Coin maxFeePerKb; 60  61  protected AddressBasedAuthorizer increaseLockingCapAuthorizer; 62  63  protected Coin initialLockingCap; 64  65  protected int lockingCapIncrementsMultiplier; 66  67  protected int btcHeightWhenBlockIndexActivates; 68  protected int maxDepthToSearchBlocksBelowIndexActivation; 69  protected long minSecondsBetweenCallsReceiveHeader; // (seconds) 70  71  protected int maxDepthBlockchainAccepted; 72  73  protected long erpFedActivationDelay; 74  75  protected List<BtcECKey> erpFedPubKeysList; 76  77  protected String oldFederationAddress; 78  79  protected int minimumPegoutValuePercentageToReceiveAfterFee; 80  81  public NetworkParameters getBtcParams() { 82  return NetworkParameters.fromID(btcParamsString); 83  } 84  85  public String getBtcParamsString() { 86  return btcParamsString; 87  } 88  89  public Federation getGenesisFederation() { return genesisFederation; } 90  91  public int getBtc2RskMinimumAcceptableConfirmations() { 92  return btc2RskMinimumAcceptableConfirmations; 93  } 94  95  public int getBtc2RskMinimumAcceptableConfirmationsOnRsk() { 96  return btc2RskMinimumAcceptableConfirmationsOnRsk; 97  } 98  99  public int getRsk2BtcMinimumAcceptableConfirmations() { 100  return rsk2BtcMinimumAcceptableConfirmations; 101  } 102  103  public int getUpdateBridgeExecutionPeriod() { return updateBridgeExecutionPeriod; } 104  105  public int getMaxBtcHeadersPerRskBlock() { return maxBtcHeadersPerRskBlock; } 106  107  public Coin getLegacyMinimumPeginTxValueInSatoshis() { return legacyMinimumPeginTxValueInSatoshis; } 108  109  public Coin getMinimumPeginTxValueInSatoshis() { return minimumPeginTxValueInSatoshis; } 110  111  public Coin getLegacyMinimumPegoutTxValueInSatoshis() { return legacyMinimumPegoutTxValueInSatoshis; } 112  113  public Coin getMinimumPegoutTxValueInSatoshis() { return minimumPegoutTxValueInSatoshis; } 114  115  public long getFederationActivationAge() { return federationActivationAge; } 116  117  public long getFundsMigrationAgeSinceActivationBegin() { 118  return fundsMigrationAgeSinceActivationBegin; 119  } 120  121  public long getFundsMigrationAgeSinceActivationEnd() { 122  return fundsMigrationAgeSinceActivationEnd; 123  } 124  125  public AddressBasedAuthorizer getFederationChangeAuthorizer() { return federationChangeAuthorizer; } 126  127  public AddressBasedAuthorizer getLockWhitelistChangeAuthorizer() { return lockWhitelistChangeAuthorizer; } 128  129  public AddressBasedAuthorizer getFeePerKbChangeAuthorizer() { return feePerKbChangeAuthorizer; } 130  131  public AddressBasedAuthorizer getIncreaseLockingCapAuthorizer() { return increaseLockingCapAuthorizer; } 132  133  public int getLockingCapIncrementsMultiplier() { return lockingCapIncrementsMultiplier; } 134  135  public Coin getInitialLockingCap() { return initialLockingCap; } 136  137  public Coin getGenesisFeePerKb() { return genesisFeePerKb; } 138  139  public Coin getMaxFeePerKb() { return maxFeePerKb; } 140  141  public Coin getMaxRbtc() { return Coin.valueOf(21_000_000, 0); } 142  143  public int getBtcHeightWhenBlockIndexActivates() { return btcHeightWhenBlockIndexActivates; } 144  145  public int getMaxDepthToSearchBlocksBelowIndexActivation() { return maxDepthToSearchBlocksBelowIndexActivation; } 146  147  public long getErpFedActivationDelay() { 148  return erpFedActivationDelay; 149  } 150  151  public List<BtcECKey> getErpFedPubKeysList() { 152  return erpFedPubKeysList; 153  } 154  155  public String getOldFederationAddress() { 156  return oldFederationAddress; 157  } 158  159  public long getMinSecondsBetweenCallsToReceiveHeader() { return minSecondsBetweenCallsReceiveHeader; } 160  161  public int getMaxDepthBlockchainAccepted() { return maxDepthBlockchainAccepted; } 162  163  public int getMinimumPegoutValuePercentageToReceiveAfterFee() { 164  return minimumPegoutValuePercentageToReceiveAfterFee; 165  } 166 }