Skip to content

Commit

Permalink
Remove federation public keys param from BridgeDevNetConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-iov committed Aug 20, 2024
1 parent 1b9b7dc commit c04b77f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,11 @@

package co.rsk.peg.constants;

import co.rsk.bitcoinj.core.BtcECKey;
import co.rsk.bitcoinj.core.Coin;
import co.rsk.bitcoinj.core.NetworkParameters;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.bouncycastle.util.encoders.Hex;

public class BridgeDevNetConstants extends BridgeConstants {
// IMPORTANT: BTC, RSK and MST keys are the same.
// Change upon implementation of the <INSERT FORK NAME HERE> fork.
public static final List<BtcECKey> DEVNET_FEDERATION_PUBLIC_KEYS = Collections.unmodifiableList(Arrays.asList(
BtcECKey.fromPublicOnly(
Hex.decode("03d68975ab0f6ab782febc37aaa486ae19cc5e72c6900e34e21317285c88915ed6")
),
BtcECKey.fromPublicOnly(
Hex.decode("02914c05df0b11862ac6931c226ad40ebc4f5624ee6dca34278d3bbfa73b914cbd")
),
BtcECKey.fromPublicOnly(
Hex.decode("0309d9df35855aa45235a04e30d228889eb03e462874588e631359d5f9cdea6519")
)
));
private static final BridgeDevNetConstants instance = new BridgeDevNetConstants(DEVNET_FEDERATION_PUBLIC_KEYS);

public BridgeDevNetConstants(List<BtcECKey> federationPublicKeys) {
public BridgeDevNetConstants() {
btcParamsString = NetworkParameters.ID_TESTNET;

btc2RskMinimumAcceptableConfirmations = 1;
Expand Down Expand Up @@ -74,8 +54,4 @@ public BridgeDevNetConstants(List<BtcECKey> federationPublicKeys) {
btcHeightWhenPegoutTxIndexActivates = 1_000_000;
pegoutTxIndexGracePeriodInBtcBlocks = 4_320; // 30 days in BTC blocks (considering 1 block every 10 minutes)
}

public static BridgeDevNetConstants getInstance() {
return instance;
}
}
20 changes: 10 additions & 10 deletions rskj-core/src/main/java/org/ethereum/config/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,17 @@ public static Constants mainnet() {
);
}

public static Constants devnetWithFederation(List<BtcECKey> federationPublicKeys) {
public static Constants devnetWithFederation() {
return new Constants(
DEVNET_CHAIN_ID,
false,
14,
new BlockDifficulty(BigInteger.valueOf(131072)),
new BlockDifficulty(BigInteger.valueOf((long) 14E15)),
BigInteger.valueOf(50),
540,
new BridgeDevNetConstants(federationPublicKeys),
new BlockDifficulty(new BigInteger("550000000"))
DEVNET_CHAIN_ID,
false,
14,
new BlockDifficulty(BigInteger.valueOf(131072)),
new BlockDifficulty(BigInteger.valueOf((long) 14E15)),
BigInteger.valueOf(50),
540,
new BridgeDevNetConstants(),
new BlockDifficulty(new BigInteger("550000000"))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,7 @@ public Constants getNetworkConstants() {
constants = Constants.testnet(getActivationConfig());
break;
case "devnet":
constants = Constants.devnetWithFederation(
getGenesisFederationPublicKeys().orElse(BridgeDevNetConstants.DEVNET_FEDERATION_PUBLIC_KEYS)
);
constants = Constants.devnetWithFederation();
break;
case "regtest":
constants = getGenesisFederationPublicKeys()
Expand Down

0 comments on commit c04b77f

Please sign in to comment.