tests: Unexport fields + formatting

This commit is contained in:
Martin Holst Swende 2017-09-27 13:40:18 +02:00
parent 734ca0c10a
commit ae8cf1fe73
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0
3 changed files with 7 additions and 8 deletions

View file

@ -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 (

View file

@ -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,

View file

@ -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 {