5 func TestSubsidy(t *testing.T) {
6 ActiveNetParams = Params{
7 ProducerSubsidys: []ProducerSubsidy{
8 {BeginBlock: 0, EndBlock: 0, Subsidy: 24},
9 {BeginBlock: 1, EndBlock: 840000, Subsidy: 24},
10 {BeginBlock: 840001, EndBlock: 1680000, Subsidy: 12},
11 {BeginBlock: 1680001, EndBlock: 3360000, Subsidy: 6},
14 subsidyReductionInterval := uint64(840000)
25 height: subsidyReductionInterval - 1,
29 height: subsidyReductionInterval,
33 height: subsidyReductionInterval + 1,
37 height: subsidyReductionInterval * 10,
41 for _, c := range cases {
42 subsidy := BlockSubsidy(c.height)
43 if subsidy != c.subsidy {
44 t.Errorf("got subsidy %d, want %d", subsidy, c.subsidy)