diff --git a/ethereumj-core/src/main/java/org/ethereum/config/Constants.java b/ethereumj-core/src/main/java/org/ethereum/config/Constants.java index 0379771a22..bc477d8510 100644 --- a/ethereumj-core/src/main/java/org/ethereum/config/Constants.java +++ b/ethereumj-core/src/main/java/org/ethereum/config/Constants.java @@ -17,6 +17,8 @@ */ package org.ethereum.config; +import org.ethereum.util.blockchain.EtherUtil; + import java.math.BigInteger; /** @@ -37,7 +39,7 @@ public class Constants { private static final int BEST_NUMBER_DIFF_LIMIT = 100; - private static final BigInteger BLOCK_REWARD = new BigInteger("1500000000000000000"); + private static final BigInteger BLOCK_REWARD = EtherUtil.convert(1500, EtherUtil.Unit.FINNEY); // 1.5 ETH private static final BigInteger SECP256K1N = new BigInteger("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16); diff --git a/ethereumj-core/src/main/java/org/ethereum/config/blockchain/ByzantiumConfig.java b/ethereumj-core/src/main/java/org/ethereum/config/blockchain/ByzantiumConfig.java index 5d103c1695..2de35dd954 100644 --- a/ethereumj-core/src/main/java/org/ethereum/config/blockchain/ByzantiumConfig.java +++ b/ethereumj-core/src/main/java/org/ethereum/config/blockchain/ByzantiumConfig.java @@ -20,9 +20,8 @@ import org.ethereum.config.BlockchainConfig; import org.ethereum.config.Constants; import org.ethereum.config.ConstantsAdapter; -import org.ethereum.core.Block; import org.ethereum.core.BlockHeader; -import org.ethereum.core.Repository; +import org.ethereum.util.blockchain.EtherUtil; import java.math.BigInteger; @@ -51,7 +50,7 @@ public class ByzantiumConfig extends Eip160HFConfig { public ByzantiumConfig(BlockchainConfig parent) { super(parent); constants = new ConstantsAdapter(super.getConstants()) { - private final BigInteger BLOCK_REWARD = new BigInteger("3000000000000000000"); + private final BigInteger BLOCK_REWARD = EtherUtil.convert(3, EtherUtil.Unit.ETHER); @Override public BigInteger getBLOCK_REWARD() { diff --git a/ethereumj-core/src/main/java/org/ethereum/config/blockchain/ConstantinopleConfig.java b/ethereumj-core/src/main/java/org/ethereum/config/blockchain/ConstantinopleConfig.java index 84068ecbef..9198ce3cfa 100644 --- a/ethereumj-core/src/main/java/org/ethereum/config/blockchain/ConstantinopleConfig.java +++ b/ethereumj-core/src/main/java/org/ethereum/config/blockchain/ConstantinopleConfig.java @@ -18,10 +18,17 @@ package org.ethereum.config.blockchain; import org.ethereum.config.BlockchainConfig; +import org.ethereum.config.Constants; +import org.ethereum.config.ConstantsAdapter; +import org.ethereum.core.BlockHeader; +import org.ethereum.util.blockchain.EtherUtil; + +import java.math.BigInteger; /** * EIPs included in the Constantinople Hard Fork: *