Skip to content

Commit 24c883d

Browse files
committed
chore: fix some function names and typo in comment
Signed-off-by: wangjingcun <wangjingcun@aliyun.com>
1 parent 0bce70d commit 24c883d

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

batch_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func testBatchWithFlusher(t *testing.T) {
4040

4141
batchWithFlusher := NewBatchWithFlusher(db, DefaultOptions().FlushThreshold)
4242

43-
// we'll try to to commit 10MBs (1000 * 10KBs each entries) of data into the db
43+
// we'll try to commit 10MBs (1000 * 10KBs each entries) of data into the db
4444
for keyNonce := uint16(0); keyNonce < 1000; keyNonce++ {
4545
// each value is 10 KBs of zero bytes
4646
key := makeKey(keyNonce)

cmd/iaviewer/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Below is a brief introduction to the tool.
66

77
## Installation
88

9-
Once this is merged into the offical repo, master, you should be able to do:
9+
Once this is merged into the official repo, master, you should be able to do:
1010

1111
```shell
1212
go get github.com/cosmos/iavl
@@ -42,7 +42,7 @@ Now, if you run `ls -l`, you should see two directories... `bns-a.db` and `bns-b
4242
iaviewer versions ./bns-a.db ""
4343
```
4444

45-
This should print out a list of 20 versions of the code. Note the the iavl tree will persist multiple
45+
This should print out a list of 20 versions of the code. Note the iavl tree will persist multiple
4646
historical versions, which is a great aid in forensic queries (thanks Tendermint team!). For the rest
4747
of the cases, we will consider only the last two versions, 190257 (last one where they match) and 190258
4848
(where they are different).

immutable_tree.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func (t *ImmutableTree) Get(key []byte) ([]byte, error) {
208208

209209
// otherwise skipFastStorageUpgrade is true or
210210
// the cached node was updated later than the current tree. In this case,
211-
// we need to use the regular stategy for reading from the current tree to avoid staleness.
211+
// we need to use the regular strategy for reading from the current tree to avoid staleness.
212212
_, result, err := t.root.get(t, key)
213213
return result, err
214214
}

internal/encoding/encoding.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var uvarintPool = &sync.Pool{
2828
},
2929
}
3030

31-
// decodeBytes decodes a varint length-prefixed byte slice, returning it along with the number
31+
// DecodeBytes decodes a varint length-prefixed byte slice, returning it along with the number
3232
// of input bytes read.
3333
// Assumes bz will not be mutated.
3434
func DecodeBytes(bz []byte) ([]byte, int, error) {
@@ -55,7 +55,7 @@ func DecodeBytes(bz []byte) ([]byte, int, error) {
5555
return bz[n:end], end, nil
5656
}
5757

58-
// decodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the
58+
// DecodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the
5959
// number of bytes decoded.
6060
func DecodeUvarint(bz []byte) (uint64, int, error) {
6161
u, n := binary.Uvarint(bz)
@@ -71,7 +71,7 @@ func DecodeUvarint(bz []byte) (uint64, int, error) {
7171
return u, n, nil
7272
}
7373

74-
// decodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of
74+
// DecodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of
7575
// bytes decoded.
7676
func DecodeVarint(bz []byte) (int64, int, error) {
7777
i, n := binary.Varint(bz)

iterator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -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

mutable_tree_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ func TestFastStorageReUpgradeProtection_ForceUpgradeFirstTime_NoForceSecondTime_
974974
batchMock.EXPECT().Write().Return(nil).Times(1)
975975
batchMock.EXPECT().Close().Return(nil).Times(1)
976976

977-
// iterMock is used to mock the underlying db iterator behing fast iterator
977+
// iterMock is used to mock the underlying db iterator behind fast iterator
978978
// Here, we want to mock the behavior of deleting fast nodes from disk when
979979
// force upgrade is detected.
980980
iterMock.EXPECT().Valid().Return(true).Times(1)
@@ -994,7 +994,7 @@ func TestFastStorageReUpgradeProtection_ForceUpgradeFirstTime_NoForceSecondTime_
994994
iterMock.EXPECT().Next().Return().Times(1)
995995
iterMock.EXPECT().Error().Return(nil).Times(1)
996996
iterMock.EXPECT().Valid().Return(false).Times(1)
997-
// Call Valid after first iteraton
997+
// Call Valid after first iteration
998998
iterMock.EXPECT().Valid().Return(false).Times(1)
999999
iterMock.EXPECT().Close().Return(nil).Times(1)
10001000

testutils_test.go

+1-1
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

v2/internal/encoding.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var uvarintPool = &sync.Pool{
2828
},
2929
}
3030

31-
// decodeBytes decodes a varint length-prefixed byte slice, returning it along with the number
31+
// DecodeBytes decodes a varint length-prefixed byte slice, returning it along with the number
3232
// of input bytes read.
3333
func DecodeBytes(bz []byte) ([]byte, int, error) {
3434
s, n, err := DecodeUvarint(bz)
@@ -56,7 +56,7 @@ func DecodeBytes(bz []byte) ([]byte, int, error) {
5656
return bz2, end, nil
5757
}
5858

59-
// decodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the
59+
// DecodeUvarint decodes a varint-encoded unsigned integer from a byte slice, returning it and the
6060
// number of bytes decoded.
6161
func DecodeUvarint(bz []byte) (uint64, int, error) {
6262
u, n := binary.Uvarint(bz)
@@ -72,7 +72,7 @@ func DecodeUvarint(bz []byte) (uint64, int, error) {
7272
return u, n, nil
7373
}
7474

75-
// decodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of
75+
// DecodeVarint decodes a varint-encoded integer from a byte slice, returning it and the number of
7676
// bytes decoded.
7777
func DecodeVarint(bz []byte) (int64, int, error) {
7878
i, n := binary.Varint(bz)

v2/iterator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Iterator interface {
3333
// Error returns the last error encountered by the iterator, if any.
3434
Error() error
3535

36-
// Close closes the iterator, relasing any allocated resources.
36+
// Close closes the iterator, releasing any allocated resources.
3737
Close() error
3838
}
3939

0 commit comments

Comments
 (0)