X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=consensus%2Fgeneral_test.go;h=6ef4f9afe8ccc2bca7580382c162e1c2bf27a483;hb=9583624d58e17c64bf6f610ec79c99e7bd493535;hp=5006743f8d260068a1f4c2d0009ab74477e1590c;hpb=08281341c2cb02ba11d4218576256688854790fc;p=bytom%2Fvapor.git diff --git a/consensus/general_test.go b/consensus/general_test.go index 5006743f..6ef4f9af 100644 --- a/consensus/general_test.go +++ b/consensus/general_test.go @@ -3,28 +3,37 @@ package consensus import "testing" func TestSubsidy(t *testing.T) { + ActiveNetParams = Params{ + ProducerSubsidys: []ProducerSubsidy{ + {BeginBlock: 0, EndBlock: 0, Subsidy: 24}, + {BeginBlock: 1, EndBlock: 840000, Subsidy: 24}, + {BeginBlock: 840001, EndBlock: 1680000, Subsidy: 12}, + {BeginBlock: 1680001, EndBlock: 3360000, Subsidy: 6}, + }, + } + subsidyReductionInterval := uint64(840000) cases := []struct { subsidy uint64 height uint64 }{ { - subsidy: baseSubsidy, + subsidy: 24, height: 1, }, { - subsidy: baseSubsidy, + subsidy: 24, height: subsidyReductionInterval - 1, }, { - subsidy: baseSubsidy / 2, + subsidy: 24, height: subsidyReductionInterval, }, { - subsidy: baseSubsidy / 2, + subsidy: 12, height: subsidyReductionInterval + 1, }, { - subsidy: baseSubsidy / 1024, + subsidy: 0, height: subsidyReductionInterval * 10, }, }