mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
tests/difficulty_test_util: CalcDifficulty -> CalcDifficultyLegacy
This commit is contained in:
parent
a9c5e808a6
commit
c8394400c6
1 changed files with 4 additions and 4 deletions
|
|
@ -24,7 +24,7 @@ import (
|
||||||
"github.com/ubiq/go-ubiq/common"
|
"github.com/ubiq/go-ubiq/common"
|
||||||
"github.com/ubiq/go-ubiq/common/math"
|
"github.com/ubiq/go-ubiq/common/math"
|
||||||
"github.com/ubiq/go-ubiq/consensus/ubqhash"
|
"github.com/ubiq/go-ubiq/consensus/ubqhash"
|
||||||
"github.com/ubiq/go-ubiq/core/types"
|
//"github.com/ubiq/go-ubiq/core/types"
|
||||||
"github.com/ubiq/go-ubiq/params"
|
"github.com/ubiq/go-ubiq/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -50,14 +50,14 @@ type difficultyTestMarshaling struct {
|
||||||
|
|
||||||
func (test *DifficultyTest) Run(config *params.ChainConfig) error {
|
func (test *DifficultyTest) Run(config *params.ChainConfig) error {
|
||||||
parentNumber := big.NewInt(int64(test.CurrentBlockNumber - 1))
|
parentNumber := big.NewInt(int64(test.CurrentBlockNumber - 1))
|
||||||
parent := &types.Header{
|
/*parent := &types.Header{
|
||||||
Difficulty: test.ParentDifficulty,
|
Difficulty: test.ParentDifficulty,
|
||||||
Time: test.ParentTimestamp,
|
Time: test.ParentTimestamp,
|
||||||
Number: parentNumber,
|
Number: parentNumber,
|
||||||
UncleHash: test.UncleHash,
|
UncleHash: test.UncleHash,
|
||||||
}
|
}*/
|
||||||
|
|
||||||
actual := ubqhash.CalcDifficulty(config, test.CurrentTimestamp.Uint64(), parent)
|
actual := ubqhash.CalcDifficultyLegacy(test.CurrentTimestamp.Uint64(), test.ParentTimestamp.Uint64(), parentNumber, test.ParentDifficulty)
|
||||||
exp := test.CurrentDifficulty
|
exp := test.CurrentDifficulty
|
||||||
|
|
||||||
if actual.Cmp(exp) != 0 {
|
if actual.Cmp(exp) != 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue