MCPcopy Create free account
hub / github.com/ethstorage/es-node / Test_expectedDiff

Function Test_expectedDiff

ethstorage/miner/algorithm_test.go:12–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func Test_expectedDiff(t *testing.T) {
13 type args struct {
14 interval uint64
15 difficulty *big.Int
16 cutoff *big.Int
17 diffAdjDivisor *big.Int
18 minDiff *big.Int
19 }
20 tests := []struct {
21 name string
22 args args
23 want *big.Int
24 }{
25 {
26 "decrease: diff not match case 1",
27 args{
28 1724219196 - 1724218692,
29 big.NewInt(16933920),
30 big.NewInt(7200),
31 big.NewInt(32),
32 big.NewInt(9437184),
33 },
34 big.NewInt(17463105),
35 },
36 {
37 "decrease: diff not match case 2",
38 args{
39 1724243184 - 1724242128,
40 big.NewInt(71922272),
41 big.NewInt(7200),
42 big.NewInt(32),
43 big.NewInt(9437184),
44 },
45 big.NewInt(74169843),
46 },
47 {
48 "no change",
49 args{
50 1723277844 - 1723267236,
51 big.NewInt(25034417035),
52 big.NewInt(7200),
53 big.NewInt(32),
54 big.NewInt(4718592000),
55 },
56 big.NewInt(25034417035),
57 },
58 {
59 "increase",
60 args{
61 1724507676 - 1724507412,
62 big.NewInt(18788404245),
63 big.NewInt(7200),
64 big.NewInt(32),
65 big.NewInt(4718592000),
66 },
67 big.NewInt(19375541877),
68 },
69 }

Callers

nothing calls this directly

Calls 1

expectedDiffFunction · 0.85

Tested by

no test coverage detected