OSDN Git Service

mmerge zhouyasong-patch-1 to demo
[bytom/bytom.git] / consensus / general_test.go
1 package consensus
2
3 import (
4         "fmt"
5         "math/big"
6         "testing"
7 )
8
9 func TestCalcNextRequiredDifficulty(t *testing.T) {
10         //fmt.Println(CalcNextRequiredDifficulty())
11         x := big.NewInt(123)
12         y, _ := x.SetString("94847123945178081620347972471576132812524935594538618173381454864040345", 10)
13         fmt.Println(BigToCompact(y))
14 }
15
16 /*func TestSubsidy(t *testing.T) {
17         cases := []struct {
18                 bh      *BlockHeader
19                 subsidy uint64
20         }{
21                 {
22                         bh: &BlockHeader{
23                                 Height: 1,
24                         },
25                         subsidy: 624000000000,
26                 },
27                 {
28                         bh: &BlockHeader{
29                                 Height: 560640,
30                         },
31                         subsidy: 312000000000,
32                 },
33         }
34
35         for _, c := range cases {
36                 subsidy := c.bh.BlockSubsidy()
37
38                 if subsidy != c.subsidy {
39                         t.Errorf("got subsidy %s, want %s", subsidy, c.subsidy)
40                 }
41         }
42 }*/