Skip to content

Commit caee8b2

Browse files
authored
Merge branch 'master' into iterator-go-fix-doublecheck-todo
2 parents 64a883d + 7e90511 commit caee8b2

File tree

8 files changed

+17
-15
lines changed

8 files changed

+17
-15
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
# binary built during testing
12
cmd/legacydump/legacydump
3+
24
vendor
35
.glide
46
*.swp

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ test-short:
2424
@go test ./... $(LDFLAGS) -v --race --short
2525
.PHONY: test-short
2626

27-
cmd/legacydump/legacydump:
27+
legacydump:
2828
cd cmd/legacydump && go build -o legacydump main.go
2929

30-
test: cmd/legacydump/legacydump
30+
test: legacydump
3131
@echo "--> Running go test"
3232
@go test ./... $(LDFLAGS)
3333
.PHONY: test

PERFORMANCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The rest of this document is the planned or completed actions for the above-list
2323
## Cleanup
2424

2525
Done in branch `cleanup_deps`:
26-
* Fixed up dependeny management (tmlibs/db etc in glide/vendor)
26+
* Fixed up dependency management (tmlibs/db etc in glide/vendor)
2727
* Updated Makefile (test, bench, get_deps)
2828
* Fixed broken code - `looper.go` and one benchmark didn't run
2929

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/google/btree v1.1.3
1111
github.com/stretchr/testify v1.10.0
1212
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
13-
go.uber.org/mock v0.5.1
13+
go.uber.org/mock v0.5.2
1414
)
1515

1616
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70
6464
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
6565
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
6666
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
67-
go.uber.org/mock v0.5.1 h1:ASgazW/qBmR+A32MYFDB6E2POoTgOwT509VP0CT/fjs=
68-
go.uber.org/mock v0.5.1/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
67+
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
68+
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
6969
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
7070
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
7171
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=

immutable_tree.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (t *ImmutableTree) String() string {
5252
return "Tree{" + strings.Join(leaves, ", ") + "}"
5353
}
5454

55-
// RenderShape provides a nested tree shape, ident is prepended in each level
55+
// RenderShape provides a nested tree shape, indent is prepended in each level
5656
// Returns an array of strings, one per line, to join with "\n" or display otherwise
5757
func (t *ImmutableTree) RenderShape(indent string, encoder NodeEncoder) ([]string, error) {
5858
if encoder == nil {
@@ -63,7 +63,7 @@ func (t *ImmutableTree) RenderShape(indent string, encoder NodeEncoder) ([]strin
6363

6464
// NodeEncoder will take an id (hash, or key for leaf nodes), the depth of the node,
6565
// and whether or not this is a leaf node.
66-
// It returns the string we wish to print, for iaviwer
66+
// It returns the string we wish to print, for iavlviewer
6767
type NodeEncoder func(id []byte, depth int, isLeaf bool) string
6868

6969
// defaultNodeEncoder can encode any node unless the client overrides it
@@ -209,7 +209,7 @@ func (t *ImmutableTree) Get(key []byte) ([]byte, error) {
209209

210210
// otherwise skipFastStorageUpgrade is true or
211211
// the cached node was updated later than the current tree. In this case,
212-
// we need to use the regular stategy for reading from the current tree to avoid staleness.
212+
// we need to use the regular strategy for reading from the current tree to avoid staleness.
213213
_, result, err := t.root.get(t, key)
214214
return result, err
215215
}
@@ -326,7 +326,7 @@ func (t *ImmutableTree) nodeSize() int {
326326
return int(t.root.size*2 - 1)
327327
}
328328

329-
// TraverseStateChanges iterate the range of versions, compare each version to it's predecessor to extract the state changes of it.
329+
// TraverseStateChanges iterate the range of versions, compare each version to its predecessor to extract the state changes of it.
330330
// endVersion is exclusive.
331331
func (t *ImmutableTree) TraverseStateChanges(startVersion, endVersion int64, fn func(version int64, changeSet *ChangeSet) error) error {
332332
return t.ndb.traverseStateChanges(startVersion, endVersion, fn)

iterator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ func (nodes *delayedNodes) length() int {
6868
// next traversal to proceed, or simply discard the `traversal` struct to stop iteration.
6969
//
7070
// At the each step of `next`, the `delayedNodes` can have one of the three states:
71-
// 1. It has length of 0, meaning that their is no more traversable nodes.
71+
// 1. It has length of 0, meaning that there is no more traversable nodes.
7272
// 2. It has length of 1, meaning that the traverse is being started from the initial node.
7373
// 3. It has length of 2>=, meaning that there are delayed nodes to be traversed.
7474
//
7575
// When the `delayedNodes` are not empty, `next` retrieves the first `delayedNode` and initially check:
76-
// 1. If it is not an delayed node (node.delayed == false) it immediately returns it.
76+
// 1. If it is not a delayed node (node.delayed == false) it immediately returns it.
7777
//
7878
// A. If the `node` is a branch node:
7979
// 1. If the traversal is postorder, then append the current node to the t.delayedNodes,
@@ -164,7 +164,7 @@ func (t *traversal) next() (*Node, error) {
164164
return node, nil
165165
}
166166

167-
// Keep traversing and expanding the remaning delayed nodes. A-4.
167+
// Keep traversing and expanding the remaining delayed nodes. A-4.
168168
return t.next()
169169
}
170170

@@ -258,7 +258,7 @@ func (iter *Iterator) Error() error {
258258
return iter.err
259259
}
260260

261-
// IsFast returnts true if iterator uses fast strategy
261+
// IsFast returns true if iterator uses fast strategy
262262
func (iter *Iterator) IsFast() bool {
263263
return false
264264
}

testutils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func setupMirrorForIterator(t *testing.T, config *iteratorTestConfig, tree *Muta
283283
return mirror
284284
}
285285

286-
// assertIterator confirms that the iterator returns the expected values desribed by mirror in the same order.
286+
// assertIterator confirms that the iterator returns the expected values described by mirror in the same order.
287287
// mirror is a slice containing slices of the form [key, value]. In other words, key at index 0 and value at index 1.
288288
func assertIterator(t *testing.T, itr corestore.Iterator, mirror [][]string, ascending bool) {
289289
startIdx, endIdx := 0, len(mirror)-1

0 commit comments

Comments
 (0)