Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consensus: change the block rewards #151

Merged
merged 2 commits into from
Apr 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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