chore: fix spelling errors (#20278)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
This commit is contained in:
parent
921ab722e4
commit
b795646c9b
@ -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
|
||||
|
||||
@ -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)))
|
||||
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
@ -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)
|
||||
@ -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 {
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user