(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func 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 | } |
nothing calls this directly
no test coverage detected