Skip to content

Commit

Permalink
chore: fix spelling errors (#20278)
Browse files Browse the repository at this point in the history
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
  • Loading branch information
github-prbot and github-merge-queue[bot] committed May 4, 2024
1 parent 921ab72 commit b795646
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion store/cachekv/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (store *Store) dirtyItems(start, end []byte) {
n := len(store.unsortedCache)
unsorted := make([]*kv.Pair, 0)
// If the unsortedCache is too big, its costs too much to determine
// whats in the subset we are concerned about.
// what's in the subset we are concerned about.
// If you are interleaving iterator calls with writes, this can easily become an
// O(N^2) overhead.
// Even without that, too many range checks eventually becomes more expensive
Expand Down
2 changes: 1 addition & 1 deletion store/cachekv/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestCacheKVStore(t *testing.T) {
st.Set(keyFmt(1), valFmt(1))
require.Equal(t, valFmt(1), st.Get(keyFmt(1)))

// update it in cache, shoudn't change mem
// update it in cache, shouldn't change mem
st.Set(keyFmt(1), valFmt(2))
require.Equal(t, valFmt(2), st.Get(keyFmt(1)))
require.Equal(t, valFmt(1), mem.Get(keyFmt(1)))
Expand Down
12 changes: 6 additions & 6 deletions store/dbadapter/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Store struct {
dbm.DB
}

// Get wraps the underlying DB's Get method panicing on error.
// Get wraps the underlying DB's Get method panicking on error.
func (dsa Store) Get(key []byte) []byte {
v, err := dsa.DB.Get(key)
if err != nil {
Expand All @@ -25,7 +25,7 @@ func (dsa Store) Get(key []byte) []byte {
return v
}

// Has wraps the underlying DB's Has method panicing on error.
// Has wraps the underlying DB's Has method panicking on error.
func (dsa Store) Has(key []byte) bool {
ok, err := dsa.DB.Has(key)
if err != nil {
Expand All @@ -35,7 +35,7 @@ func (dsa Store) Has(key []byte) bool {
return ok
}

// Set wraps the underlying DB's Set method panicing on error.
// Set wraps the underlying DB's Set method panicking on error.
func (dsa Store) Set(key, value []byte) {
types.AssertValidKey(key)
types.AssertValidValue(value)
Expand All @@ -44,14 +44,14 @@ func (dsa Store) Set(key, value []byte) {
}
}

// Delete wraps the underlying DB's Delete method panicing on error.
// Delete wraps the underlying DB's Delete method panicking on error.
func (dsa Store) Delete(key []byte) {
if err := dsa.DB.Delete(key); err != nil {
panic(err)
}
}

// Iterator wraps the underlying DB's Iterator method panicing on error.
// Iterator wraps the underlying DB's Iterator method panicking on error.
func (dsa Store) Iterator(start, end []byte) types.Iterator {
iter, err := dsa.DB.Iterator(start, end)
if err != nil {
Expand All @@ -61,7 +61,7 @@ func (dsa Store) Iterator(start, end []byte) types.Iterator {
return iter
}

// ReverseIterator wraps the underlying DB's ReverseIterator method panicing on error.
// ReverseIterator wraps the underlying DB's ReverseIterator method panicking on error.
func (dsa Store) ReverseIterator(start, end []byte) types.Iterator {
iter, err := dsa.DB.ReverseIterator(start, end)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (st *Store) Delete(key []byte) {
}
}

// DeleteVersionsTo deletes versions upto the given version from the MutableTree. An error
// DeleteVersionsTo deletes versions up to the given version from the MutableTree. An error
// is returned if any single version is invalid or the delete fails. All writes
// happen in a single batch with a single commit.
func (st *Store) DeleteVersionsTo(version int64) error {
Expand Down
2 changes: 1 addition & 1 deletion store/internal/conv/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Package conv provides internal functions for convertions and data manipulation
// Package conv provides internal functions for conversions and data manipulation
package conv
2 changes: 1 addition & 1 deletion store/prefix/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var _ types.KVStore = Store{}

// Store is similar with cometbft/cometbft/libs/db/prefix_db
// both gives access only to the limited subset of the store
// for convinience or safety
// for convenience or safety
type Store struct {
parent types.KVStore
prefix []byte
Expand Down
2 changes: 1 addition & 1 deletion store/prefix/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func mockStoreWithStuff() types.KVStore {
store.Set(bz("key3"), bz("value3"))
store.Set(bz("something"), bz("else"))
store.Set(bz("k"), bz("val"))
store.Set(bz("ke"), bz("valu"))
store.Set(bz("ke"), bz("value"))
store.Set(bz("kee"), bz("valuu"))
return store
}
Expand Down
6 changes: 3 additions & 3 deletions store/pruning/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (e *NegativeHeightsError) Error() string {
var pruneSnapshotHeightsKey = []byte("s/prunesnapshotheights")

// NewManager returns a new Manager with the given db and logger.
// The retuned manager uses a pruning strategy of "nothing" which
// The returned manager uses a pruning strategy of "nothing" which
// keeps all heights. Users of the Manager may change the strategy
// by calling SetOptions.
func NewManager(db dbm.DB, logger log.Logger) *Manager {
Expand Down Expand Up @@ -99,7 +99,7 @@ func (m *Manager) SetSnapshotInterval(snapshotInterval uint64) {
m.snapshotInterval = snapshotInterval
}

// GetPruningHeight returns the height which can prune upto if it is able to prune at the given height.
// GetPruningHeight returns the height which can prune up to if it is able to prune at the given height.
func (m *Manager) GetPruningHeight(height int64) int64 {
if m.opts.GetPruningStrategy() == types.PruningNothing {
return 0
Expand Down Expand Up @@ -128,7 +128,7 @@ func (m *Manager) GetPruningHeight(height int64) int64 {
}

// the snapshot `m.pruneSnapshotHeights[0]` is already operated,
// so we can prune upto `m.pruneSnapshotHeights[0] + int64(m.snapshotInterval) - 1`
// so we can prune up to `m.pruneSnapshotHeights[0] + int64(m.snapshotInterval) - 1`
snHeight := m.pruneSnapshotHeights[0] + int64(m.snapshotInterval) - 1
if snHeight < pruneHeight {
return snHeight
Expand Down
2 changes: 1 addition & 1 deletion store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ func (rs *Store) handlePruning(version int64) error {
return rs.PruneStores(pruneHeight)
}

// PruneStores prunes all history upto the specific height of the multi store.
// PruneStores prunes all history up to the specific height of the multi store.
func (rs *Store) PruneStores(pruningHeight int64) (err error) {
if pruningHeight <= 0 {
rs.logger.Debug("pruning skipped, height is less than or equal to 0")
Expand Down
2 changes: 1 addition & 1 deletion store/transient/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var (
_ types.KVStore = (*Store)(nil)
)

// Store is a wrapper for a MemDB with Commiter implementation
// Store is a wrapper for a MemDB with Committer implementation
type Store struct {
dbadapter.Store
}
Expand Down
2 changes: 1 addition & 1 deletion store/types/gas.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (g *infiniteGasMeter) ConsumeGas(amount Gas, descriptor string) {
// RefundGas will deduct the given amount from the gas consumed. If the amount is greater than the
// gas consumed, the function will panic.
//
// Use case: This functionality enables refunding gas to the trasaction or block gas pools so that
// Use case: This functionality enables refunding gas to the transaction or block gas pools so that
// EVM-compatible chains can fully support the go-ethereum StateDb interface.
// See https://github.com/cosmos/cosmos-sdk/pull/9403 for reference.
func (g *infiniteGasMeter) RefundGas(amount Gas, descriptor string) {
Expand Down

0 comments on commit b795646

Please sign in to comment.