mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
trie/bintrie: gofmt
Fix goimports alignment in struct literals, const block, and var block so the CI Lint job passes.
This commit is contained in:
parent
957f85fa58
commit
16b0f9d2d9
4 changed files with 21 additions and 21 deletions
|
|
@ -29,8 +29,8 @@ func makeTrie(t *testing.T, entries [][2]common.Hash) *BinaryTrie {
|
|||
t.Helper()
|
||||
store := NewNodeStore()
|
||||
tr := &BinaryTrie{
|
||||
store: store,
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
store: store,
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
}
|
||||
for _, kv := range entries {
|
||||
if err := store.Insert(kv[0][:], kv[1][:], nil); err != nil {
|
||||
|
|
@ -63,8 +63,8 @@ func countLeaves(t *testing.T, tr *BinaryTrie) int {
|
|||
// no nodes and reports no error.
|
||||
func TestIteratorEmptyTrie(t *testing.T) {
|
||||
tr := &BinaryTrie{
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
}
|
||||
it, err := newBinaryNodeIterator(tr, nil)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ package bintrie
|
|||
type NodeKind uint8
|
||||
|
||||
const (
|
||||
KindEmpty NodeKind = iota
|
||||
KindEmpty NodeKind = iota
|
||||
KindInternal
|
||||
KindStem // up to 256 values per stem
|
||||
KindStem // up to 256 values per stem
|
||||
KindHashed
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -174,9 +174,9 @@ func (t *BinaryTrie) GetWithHashedKey(key []byte) ([]byte, error) {
|
|||
// GetAccount returns the account information for the given address.
|
||||
func (t *BinaryTrie) GetAccount(addr common.Address) (*types.StateAccount, error) {
|
||||
var (
|
||||
err error
|
||||
acc = &types.StateAccount{}
|
||||
key = GetBinaryTreeKey(addr, zero[:])
|
||||
err error
|
||||
acc = &types.StateAccount{}
|
||||
key = GetBinaryTreeKey(addr, zero[:])
|
||||
)
|
||||
|
||||
values, err := t.store.GetValuesAtStem(key[:StemSize], t.nodeResolver)
|
||||
|
|
|
|||
|
|
@ -188,8 +188,8 @@ func TestMerkleizeMultipleEntries(t *testing.T) {
|
|||
func TestStorageRoundTrip(t *testing.T) {
|
||||
tracer := trie.NewPrevalueTracer()
|
||||
tr := &BinaryTrie{
|
||||
store: NewNodeStore(),
|
||||
tracer: tracer,
|
||||
store: NewNodeStore(),
|
||||
tracer: tracer,
|
||||
}
|
||||
addr := common.HexToAddress("0x1234567890abcdef1234567890abcdef12345678")
|
||||
|
||||
|
|
@ -256,8 +256,8 @@ func TestStorageRoundTrip(t *testing.T) {
|
|||
func newEmptyTestTrie(t *testing.T) *BinaryTrie {
|
||||
t.Helper()
|
||||
return &BinaryTrie{
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -581,8 +581,8 @@ func TestBinaryTrieWitness(t *testing.T) {
|
|||
tracer := trie.NewPrevalueTracer()
|
||||
|
||||
tr := &BinaryTrie{
|
||||
store: NewNodeStore(),
|
||||
tracer: tracer,
|
||||
store: NewNodeStore(),
|
||||
tracer: tracer,
|
||||
}
|
||||
if w := tr.Witness(); len(w) != 0 {
|
||||
t.Fatal("expected empty witness for fresh trie")
|
||||
|
|
@ -608,8 +608,8 @@ func TestBinaryTrieWitness(t *testing.T) {
|
|||
func testAccount(t *testing.T, addr common.Address, nonce uint64, balance uint64) *BinaryTrie {
|
||||
t.Helper()
|
||||
tr := &BinaryTrie{
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
}
|
||||
acc := &types.StateAccount{
|
||||
Nonce: nonce,
|
||||
|
|
@ -662,8 +662,8 @@ func TestGetAccountNonMembershipStemRoot(t *testing.T) {
|
|||
// address returns nil when the trie root is an InternalNode (multi-account trie).
|
||||
func TestGetAccountNonMembershipInternalRoot(t *testing.T) {
|
||||
tr := &BinaryTrie{
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
}
|
||||
|
||||
// Insert two accounts whose binary tree keys have different first bits
|
||||
|
|
@ -725,8 +725,8 @@ func TestGetStorageNonMembershipStemRoot(t *testing.T) {
|
|||
// non-existent address returns nil when the root is an InternalNode.
|
||||
func TestGetStorageNonMembershipInternalRoot(t *testing.T) {
|
||||
tr := &BinaryTrie{
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
store: NewNodeStore(),
|
||||
tracer: trie.NewPrevalueTracer(),
|
||||
}
|
||||
|
||||
addr := common.HexToAddress("0x1234567890abcdef1234567890abcdef12345678")
|
||||
|
|
|
|||
Loading…
Reference in a new issue