Skip to content

Commit

Permalink
Changes to devnet config to avoid depending on testnet config
Browse files Browse the repository at this point in the history
  • Loading branch information
lsebrie committed Oct 9, 2018
1 parent ccc77d1 commit 8d58049
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,22 @@

import co.rsk.config.BridgeConstants;
import co.rsk.config.BridgeDevNetConstants;
import org.ethereum.config.blockchain.testnet.TestNetAfterBridgeSyncConfig;
import org.ethereum.config.blockchain.testnet.TestNetBeforeBridgeSyncConfig;
import co.rsk.core.BlockDifficulty;
import org.ethereum.config.blockchain.GenesisConfig;

import java.math.BigInteger;

/**
* Created by Oscar Guindzberg on 25.10.2016.
*/
public class DevNetGenesisConfig extends TestNetBeforeBridgeSyncConfig {
public class DevNetGenesisConfig extends GenesisConfig {

public static class DevNetConstants extends GenesisConstants {

public static class DevNetConstants extends TestNetConstants {
private static final byte CHAIN_ID = 32;
private static final BigInteger DIFFICULTY_BOUND_DIVISOR = BigInteger.valueOf(50);
private final BlockDifficulty minimumDifficulty = new BlockDifficulty(BigInteger.valueOf(131072));

@Override
public BridgeConstants getBridgeConstants() {
return BridgeDevNetConstants.getInstance();
Expand All @@ -40,6 +46,21 @@ public BridgeConstants getBridgeConstants() {
public byte getChainId() {
return DevNetConstants.CHAIN_ID;
}

@Override
public BlockDifficulty getMinimumDifficulty() {
return minimumDifficulty;
}

@Override
public int getDurationLimit() {
return 14;
}

@Override
public BigInteger getDifficultyBoundDivisor() {
return DIFFICULTY_BOUND_DIVISOR;
}
}

public DevNetGenesisConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ public TestNetBeforeBridgeSyncConfig() {
super(new TestNetConstants());
}

protected TestNetBeforeBridgeSyncConfig(Constants constants) {
super(constants);
}

@Override
public boolean areBridgeTxsFree() {
return true;
Expand Down

0 comments on commit 8d58049

Please sign in to comment.