Skip to content

Commit

Permalink
Merge pull request #151 from semuxgo/fork-block-rewards
Browse files Browse the repository at this point in the history
Consensus: change the block rewards
  • Loading branch information
semuxgo authored Apr 21, 2019
2 parents d5f89fa + fe868b9 commit 8b8b641
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/semux/config/AbstractConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ public File getFile() {

@Override
public Amount getBlockReward(long number) {
if (number <= 10_000_000L) {
if (number <= 2_000_000L) { // ~2 years
return SEM.of(3);
} else if (number <= 25_000_000L) {
} else if (number <= 6_000_000L) { // ~4 years
return SEM.of(2);
} else if (number <= 40_000_000L) {
} else if (number <= 14_000_000L) { // ~8 years
return SEM.of(1);
} else {
return ZERO;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/semux/config/MainnetConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public void testLoad() {
@Test
public void testBlockReward() {
Amount total = LongStream
.rangeClosed(1, 100_000_000)
.rangeClosed(1, 20_000_000)
.mapToObj(config::getBlockReward)
.reduce(ZERO, Amount::sum);

assertEquals(SEM.of(75_000_000), total);
assertEquals(SEM.of(22_000_000), total);
}

@Test
Expand Down

0 comments on commit 8b8b641

Please sign in to comment.