mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
tests: Unexport fields + formatting
This commit is contained in:
parent
734ca0c10a
commit
ae8cf1fe73
3 changed files with 7 additions and 8 deletions
|
|
@ -20,9 +20,10 @@ package tests
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"math/big"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
"math/big"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -19,17 +19,16 @@ package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math/big"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/math"
|
"github.com/ethereum/go-ethereum/common/math"
|
||||||
"github.com/ethereum/go-ethereum/consensus/ethash"
|
"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
"math/big"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type DifficultyTests map[string]DifficultyTest
|
//go:generate gencodec -type DifficultyTest -field-override difficultyTestMarshaling -out gen_difficultytest.go
|
||||||
|
|
||||||
//go:generate gencodec -type DifficultyTest -field-override DifficultyTestMarshaling -out gen_difficultytest.go
|
|
||||||
|
|
||||||
type DifficultyTest struct {
|
type DifficultyTest struct {
|
||||||
ParentTimestamp *big.Int `json:"parentTimestamp"`
|
ParentTimestamp *big.Int `json:"parentTimestamp"`
|
||||||
|
|
@ -40,7 +39,7 @@ type DifficultyTest struct {
|
||||||
CurrentDifficulty *big.Int `json:"currentDifficulty"`
|
CurrentDifficulty *big.Int `json:"currentDifficulty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DifficultyTestMarshaling struct {
|
type difficultyTestMarshaling struct {
|
||||||
ParentTimestamp *math.HexOrDecimal256
|
ParentTimestamp *math.HexOrDecimal256
|
||||||
ParentDifficulty *math.HexOrDecimal256
|
ParentDifficulty *math.HexOrDecimal256
|
||||||
CurrentTimestamp *math.HexOrDecimal256
|
CurrentTimestamp *math.HexOrDecimal256
|
||||||
|
|
@ -50,7 +49,6 @@ 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,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common/math"
|
"github.com/ethereum/go-ethereum/common/math"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = (*DifficultyTestMarshaling)(nil)
|
var _ = (*difficultyTestMarshaling)(nil)
|
||||||
|
|
||||||
func (d DifficultyTest) MarshalJSON() ([]byte, error) {
|
func (d DifficultyTest) MarshalJSON() ([]byte, error) {
|
||||||
type DifficultyTest struct {
|
type DifficultyTest struct {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue