mirror of
https://github.com/status-im/ethereumj-personal.git
synced 2025-02-16 21:56:22 +00:00
Use attribute for static final genesis premine amount
This commit is contained in:
parent
72823df2f2
commit
9ec7e20191
@ -29,6 +29,8 @@ import java.math.BigInteger;
|
|||||||
*/
|
*/
|
||||||
public class Genesis extends Block {
|
public class Genesis extends Block {
|
||||||
|
|
||||||
|
public final static BigInteger PREMINE_AMOUNT = BigInteger.valueOf(2).pow(200);
|
||||||
|
|
||||||
private static String[] premine = new String[] {
|
private static String[] premine = new String[] {
|
||||||
"51ba59315b3a95761d0863b05ccc7a7f54703d99",
|
"51ba59315b3a95761d0863b05ccc7a7f54703d99",
|
||||||
"e4157b34ea9615cfbde6b4fda419828124b70c78", // # (CH)
|
"e4157b34ea9615cfbde6b4fda419828124b70c78", // # (CH)
|
||||||
@ -70,7 +72,7 @@ public class Genesis extends Block {
|
|||||||
// some value stateRoot. The latest documentation should be consulted for the value of the state root.
|
// some value stateRoot. The latest documentation should be consulted for the value of the state root.
|
||||||
for (String address : premine) {
|
for (String address : premine) {
|
||||||
AccountState acctState = new AccountState();
|
AccountState acctState = new AccountState();
|
||||||
acctState.addToBalance(getPremineAmount());
|
acctState.addToBalance(PREMINE_AMOUNT);
|
||||||
state.update(Hex.decode(address), acctState.getEncoded());
|
state.update(Hex.decode(address), acctState.getEncoded());
|
||||||
}
|
}
|
||||||
setStateRoot(state.getRootHash());
|
setStateRoot(state.getRootHash());
|
||||||
@ -89,8 +91,4 @@ public class Genesis extends Block {
|
|||||||
public final static String[] getPremine() {
|
public final static String[] getPremine() {
|
||||||
return premine;
|
return premine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final static BigInteger getPremineAmount() {
|
|
||||||
return BigInteger.valueOf(2).pow(200);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ public class RepositoryImpl implements Repository {
|
|||||||
logger.info("DB is empty - adding Genesis");
|
logger.info("DB is empty - adding Genesis");
|
||||||
for (String address : Genesis.getPremine()) {
|
for (String address : Genesis.getPremine()) {
|
||||||
this.createAccount(Hex.decode(address));
|
this.createAccount(Hex.decode(address));
|
||||||
this.addBalance (Hex.decode(address), Genesis.getPremineAmount());
|
this.addBalance (Hex.decode(address), Genesis.PREMINE_AMOUNT);
|
||||||
}
|
}
|
||||||
blockchain.storeBlock(Genesis.getInstance());
|
blockchain.storeBlock(Genesis.getInstance());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user