Apply go fmt changes
This commit is contained in:
parent
e3805807de
commit
7995c5ab9f
@ -1500,7 +1500,7 @@ func TestProcessingStateDiffs(t *testing.T) {
|
|||||||
numberOfBlocks := triesInMemory
|
numberOfBlocks := triesInMemory
|
||||||
engine := ethash.NewFaker()
|
engine := ethash.NewFaker()
|
||||||
blockchain, _ := NewBlockChain(db, cacheConfig, params.AllEthashProtocolChanges, engine, vm.Config{}, nil)
|
blockchain, _ := NewBlockChain(db, cacheConfig, params.AllEthashProtocolChanges, engine, vm.Config{}, nil)
|
||||||
blocks := makeBlockChain(genesis, numberOfBlocks + 1, engine, db, canonicalSeed)
|
blocks := makeBlockChain(genesis, numberOfBlocks+1, engine, db, canonicalSeed)
|
||||||
_, err := blockchain.InsertChain(blocks)
|
_, err := blockchain.InsertChain(blocks)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create pristine chain: %v", err)
|
t.Fatalf("failed to create pristine chain: %v", err)
|
||||||
@ -1527,7 +1527,7 @@ func TestProcessingStateDiffs(t *testing.T) {
|
|||||||
t.Error("state root count not correct", "want", 2, "got", value)
|
t.Error("state root count not correct", "want", 2, "got", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
moreBlocks := makeBlockChain(blocks[len(blocks) - 1], 1, engine, db, canonicalSeed)
|
moreBlocks := makeBlockChain(blocks[len(blocks)-1], 1, engine, db, canonicalSeed)
|
||||||
_, err = blockchain.InsertChain(moreBlocks)
|
_, err = blockchain.InsertChain(moreBlocks)
|
||||||
|
|
||||||
//a root hash can be dereferenced when it's state diff and it's child's state diff have been processed
|
//a root hash can be dereferenced when it's state diff and it's child's state diff have been processed
|
||||||
@ -1556,7 +1556,7 @@ func TestProcessingStateDiffs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func containsRootHash(collection []common.Hash, hash common.Hash) bool{
|
func containsRootHash(collection []common.Hash, hash common.Hash) bool {
|
||||||
for _, n := range collection {
|
for _, n := range collection {
|
||||||
if n == hash {
|
if n == hash {
|
||||||
return true
|
return true
|
||||||
|
@ -22,12 +22,12 @@ package builder
|
|||||||
import (
|
import (
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||||
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/state"
|
"github.com/ethereum/go-ethereum/core/state"
|
||||||
"github.com/ethereum/go-ethereum/ethdb"
|
"github.com/ethereum/go-ethereum/ethdb"
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
"github.com/ethereum/go-ethereum/trie"
|
"github.com/ethereum/go-ethereum/trie"
|
||||||
"github.com/ethereum/go-ethereum/core"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Builder interface {
|
type Builder interface {
|
||||||
|
@ -10,11 +10,11 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/consensus/ethash"
|
"github.com/ethereum/go-ethereum/consensus/ethash"
|
||||||
"github.com/ethereum/go-ethereum/core"
|
"github.com/ethereum/go-ethereum/core"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
"github.com/ethereum/go-ethereum/core/vm"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/ethdb"
|
"github.com/ethereum/go-ethereum/ethdb"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
b "github.com/ethereum/go-ethereum/statediff/builder"
|
b "github.com/ethereum/go-ethereum/statediff/builder"
|
||||||
"github.com/ethereum/go-ethereum/core/vm"
|
|
||||||
"github.com/ethereum/go-ethereum/statediff/testhelpers"
|
"github.com/ethereum/go-ethereum/statediff/testhelpers"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,11 +5,10 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/statediff/builder"
|
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
"github.com/ethereum/go-ethereum/statediff/builder"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
func AddressToLeafKey(address common.Address) common.Hash {
|
func AddressToLeafKey(address common.Address) common.Hash {
|
||||||
return common.BytesToHash(crypto.Keccak256(address[:]))
|
return common.BytesToHash(crypto.Keccak256(address[:]))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user