try to fix hanging iterator
This commit is contained in:
parent
f235a1751a
commit
913852e22b
2
go.mod
2
go.mod
@ -46,3 +46,5 @@ require (
|
||||
)
|
||||
|
||||
replace github.com/ethereum/go-ethereum v1.10.17 => github.com/vulcanize/go-ethereum v1.10.17-statediff-3.2.1
|
||||
|
||||
replace github.com/vulcanize/go-eth-state-node-iterator => ../state-node-iterator
|
||||
|
@ -44,7 +44,7 @@ func TestCreateSnapshot(t *testing.T) {
|
||||
pub.EXPECT().PrepareTxForBatch(gomock.Any(), gomock.Any()).Return(tx, nil).
|
||||
AnyTimes()
|
||||
pub.EXPECT().PublishStateNode(gomock.Any(), gomock.Any(), gomock.Any()).
|
||||
Times(len(fixt.Block1_StateNodePaths))
|
||||
MinTimes(len(fixt.Block1_StateNodePaths))
|
||||
|
||||
// TODO: fixtures for storage node
|
||||
// pub.EXPECT().PublishStorageNode(gomock.Eq(fixt.StorageNode), gomock.Eq(int64(0)), gomock.Any())
|
||||
|
@ -137,7 +137,11 @@ func (tr *iteratorTracker) restore(tree state.Trie) ([]trie.NodeIterator, error)
|
||||
}
|
||||
}
|
||||
|
||||
it := iter.NewPrefixBoundIterator(tree, paths[0], paths[1])
|
||||
// Force the lower bound path to an even length
|
||||
if len(paths[0])&0b1 == 1 {
|
||||
paths[0] = append(paths[0], 0)
|
||||
}
|
||||
it := iter.NewPrefixBoundIterator(tree.NodeIterator(iter.HexToKeyBytes(paths[0])), paths[1])
|
||||
ret = append(ret, tr.tracked(it))
|
||||
}
|
||||
return ret, nil
|
||||
|
Loading…
Reference in New Issue
Block a user