Skip to content

Commit

Permalink
primitives: Add subsidy calcs.
Browse files Browse the repository at this point in the history
This implements a subsidy cache with funcs to calculate subsidies for
proof-of-work, votes, and the treasury and includes a full suite of
tests.

It consists of ports of the related code in blockchain/standalone with
the following modifications:

- Removes the subsidy split parameters from SubsidyParams since the
  chaincfg implementations are deprecated
  - Uses hard-coded constants for the PoW, PoS, and treasury splits both
    prior to and after the activation of DCP0010
- Removes the version 1 methods and renames the version 2 variants to
  take their place:
  - CalcWorkSubsidyV2 -> CalcWorkSubsidy
  - CalcStakeVoteSubsidyV2 -> CalcStakeVoteSubsidy
- Consolidates the tests specific to the decentralized treasury agenda
  into their counterparts
- Includes additional maintainer notes with the expected way to update
  the code without needing a major module bump should it ever be
  necessary
  • Loading branch information
davecgh committed Apr 12, 2022
1 parent 9ec3acc commit f102578
Show file tree
Hide file tree
Showing 2 changed files with 1,194 additions and 0 deletions.
Loading

0 comments on commit f102578

Please sign in to comment.