-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reduce epoch calculation time from 30 min to 20 sec.
- Loading branch information
1 parent
235f9d1
commit c5f90e7
Showing
42 changed files
with
803 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
src/main/java/org/cardanofoundation/rewards/calculation/DepositCalculation.java
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/main/java/org/cardanofoundation/rewards/calculation/DepositsCalculation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.cardanofoundation.rewards.calculation; | ||
|
||
import java.math.BigInteger; | ||
import static org.cardanofoundation.rewards.constants.RewardConstants.POOL_DEPOSIT_IN_LOVELACE; | ||
import static org.cardanofoundation.rewards.util.BigNumberUtils.multiply; | ||
|
||
public class DepositsCalculation { | ||
|
||
public static BigInteger calculateDepositsInEpoch(BigInteger depositsInPreviousEpoch, | ||
BigInteger transactionDepositsInEpoch, | ||
int retiredPoolsInEpoch) { | ||
BigInteger deposits = BigInteger.ZERO; | ||
deposits = deposits.add(transactionDepositsInEpoch); | ||
deposits = deposits.subtract( | ||
multiply(retiredPoolsInEpoch, POOL_DEPOSIT_IN_LOVELACE)); | ||
return depositsInPreviousEpoch.add(deposits); | ||
} | ||
} |
259 changes: 0 additions & 259 deletions
259
src/main/java/org/cardanofoundation/rewards/calculation/EpochCalculation.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.