Reformatting due to go fmt

This commit is contained in:
Elizabeth Engelman 2018-12-13 16:49:10 -06:00
parent 8578fc20a3
commit 4d4c229594
11 changed files with 69 additions and 70 deletions

View File

@ -20,20 +20,19 @@
package builder_test
import (
"github.com/onsi/ginkgo"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/ethash"
"math/big"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/onsi/gomega"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/params"
b "github.com/ethereum/go-ethereum/statediff/builder"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"math/big"
)
var (
testdb = ethdb.NewMemDatabase()
@ -53,6 +52,7 @@ var (
emptyAccountDiffEventualMap = make(map[common.Address]b.AccountDiffEventual)
emptyAccountDiffIncrementalMap = make(map[common.Address]b.AccountDiffIncremental)
)
/*
contract test {
@ -68,7 +68,6 @@ contract test {
}
*/
// makeChain creates a chain of n blocks starting at and including parent.
// the returned hash chain is ordered head->parent. In addition, every 3rd block
// contains a transaction and every 5th an uncle to allow testing correct block
@ -86,7 +85,6 @@ func makeChain(n int, seed byte, parent *types.Block) ([]common.Hash, map[common
return hashes, blockm
}
func testChainGen(i int, block *core.BlockGen) {
signer := types.HomesteadSigner{}
switch i {
@ -117,6 +115,7 @@ func testChainGen(i int, block *core.BlockGen) {
block.AddTx(tx)
}
}
var _ = ginkgo.FDescribe("", func() {
var (
block0Hash, block1Hash, block2Hash, block3Hash common.Hash

View File

@ -20,15 +20,16 @@
package extractor_test
import (
"github.com/ethereum/go-ethereum/core/types"
b "github.com/ethereum/go-ethereum/statediff/builder"
e "github.com/ethereum/go-ethereum/statediff/extractor"
"github.com/ethereum/go-ethereum/statediff/testhelpers"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"github.com/ethereum/go-ethereum/core/types"
"math/rand"
"github.com/ethereum/go-ethereum/statediff/testhelpers"
"math/big"
e "github.com/ethereum/go-ethereum/statediff/extractor"
b "github.com/ethereum/go-ethereum/statediff/builder"
"math/rand"
)
var _ = ginkgo.Describe("Extractor", func() {
var publisher testhelpers.MockPublisher
var builder testhelpers.MockBuilder

View File

@ -1,13 +1,13 @@
package publisher
import (
"github.com/ethereum/go-ethereum/statediff/builder"
"time"
"os"
"encoding/csv"
"github.com/ethereum/go-ethereum/statediff/builder"
"os"
"path/filepath"
"strconv"
"strings"
"path/filepath"
"time"
)
var (
@ -59,7 +59,7 @@ func (p *publisher) publishStateDiffToCSV(sd builder.StateDiff) error {
data = append(data, row)
}
for _, value := range data{
for _, value := range data {
err := writer.Write(value)
if err != nil {
return err
@ -149,4 +149,3 @@ func formatAccountDiffIncremental(accountDiff builder.AccountDiffIncremental, sd
}
return formattedAccountData
}

View File

@ -20,8 +20,8 @@
package publisher
import (
"github.com/ethereum/go-ethereum/statediff/builder"
"github.com/ethereum/go-ethereum/statediff"
"github.com/ethereum/go-ethereum/statediff/builder"
)
type Publisher interface {

View File

@ -1,17 +1,17 @@
package publisher_test
import (
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"os"
"encoding/csv"
"path/filepath"
"strconv"
"github.com/ethereum/go-ethereum/statediff"
"github.com/ethereum/go-ethereum/statediff/builder"
p "github.com/ethereum/go-ethereum/statediff/publisher"
"github.com/ethereum/go-ethereum/statediff/testhelpers"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"io/ioutil"
"github.com/ethereum/go-ethereum/statediff/builder"
"github.com/ethereum/go-ethereum/statediff"
"os"
"path/filepath"
"strconv"
)
var _ = ginkgo.Describe("Publisher", func() {

View File

@ -3,14 +3,14 @@ package service
import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/event"
"log"
e "github.com/ethereum/go-ethereum/statediff/extractor"
b "github.com/ethereum/go-ethereum/statediff/builder"
"github.com/ethereum/go-ethereum/statediff"
b "github.com/ethereum/go-ethereum/statediff/builder"
e "github.com/ethereum/go-ethereum/statediff/extractor"
p "github.com/ethereum/go-ethereum/statediff/publisher"
"log"
)
type StateDiffService struct {
@ -43,7 +43,7 @@ func (StateDiffService) APIs() []rpc.API {
return []rpc.API{}
}
func (sds *StateDiffService) loop (sub event.Subscription, events chan core.ChainHeadEvent) {
func (sds *StateDiffService) loop(sub event.Subscription, events chan core.ChainHeadEvent) {
defer sub.Unsubscribe()
for {

View File

@ -1,8 +1,8 @@
package testhelpers
import (
"github.com/ethereum/go-ethereum/common"
"errors"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/statediff/builder"
)
@ -34,7 +34,7 @@ func (builder *MockBuilder) SetBuilderError(err error) {
builder.builderError = err
}
type MockPublisher struct{
type MockPublisher struct {
StateDiff *builder.StateDiff
publisherError error
}

View File

@ -1,9 +1,9 @@
package testhelpers
import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/statediff/builder"
"math/big"
"github.com/ethereum/go-ethereum/common"
"math/rand"
)