Skip to content

Commit

Permalink
docs: update cometbft db code reference link (#22166)
Browse files Browse the repository at this point in the history
  • Loading branch information
tutufen authored Oct 8, 2024
1 parent 9076487 commit 8117f2c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions store/prefix/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var _ types.KVStore = Store{}

// Store is similar with cometbft/cometbft/libs/db/prefix_db
// Store is similar with cometbft/cometbft-db/blob/v1.0.1/prefixdb.go
// both gives access only to the limited subset of the store
// for convenience or safety
type Store struct {
Expand Down Expand Up @@ -81,7 +81,7 @@ func (s Store) Delete(key []byte) {
}

// Iterator implements KVStore
// Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L106
// Check https://github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go#L109
func (s Store) Iterator(start, end []byte) types.Iterator {
newstart := cloneAppend(s.prefix, start)

Expand All @@ -98,7 +98,7 @@ func (s Store) Iterator(start, end []byte) types.Iterator {
}

// ReverseIterator implements KVStore
// Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L129
// Check https://github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go#L132
func (s Store) ReverseIterator(start, end []byte) types.Iterator {
newstart := cloneAppend(s.prefix, start)

Expand Down Expand Up @@ -192,7 +192,7 @@ func (pi *prefixIterator) Error() error {
return nil
}

// copied from github.com/cometbft/cometbft/libs/db/prefix_db.go
// copied from github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go
func stripPrefix(key, prefix []byte) []byte {
if len(key) < len(prefix) || !bytes.Equal(key[:len(prefix)], prefix) {
panic("should not happen")
Expand Down
8 changes: 4 additions & 4 deletions x/accounts/internal/prefixstore/prefixstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func New(store store.KVStore, prefix []byte) store.KVStore {

var _ store.KVStore = Store{}

// Store is similar with cometbft/cometbft/libs/db/prefix_db
// Store is similar with cometbft/cometbft-db/blob/v1.0.1/prefixdb.go
// both gives access only to the limited subset of the store
// for convenience or safety
type Store struct {
Expand Down Expand Up @@ -63,7 +63,7 @@ func (s Store) Set(key, value []byte) error {
func (s Store) Delete(key []byte) error { return s.parent.Delete(s.key(key)) }

// Implements KVStore
// Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L106
// Check https://github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go#L109
func (s Store) Iterator(start, end []byte) (store.Iterator, error) {
newstart := cloneAppend(s.prefix, start)

Expand All @@ -83,7 +83,7 @@ func (s Store) Iterator(start, end []byte) (store.Iterator, error) {
}

// ReverseIterator implements KVStore
// Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L129
// Check https://github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go#L132
func (s Store) ReverseIterator(start, end []byte) (store.Iterator, error) {
newstart := cloneAppend(s.prefix, start)

Expand Down Expand Up @@ -180,7 +180,7 @@ func (pi *prefixIterator) Error() error {
return nil
}

// copied from github.com/cometbft/cometbft/libs/db/prefix_db.go
// copied from github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go
func stripPrefix(key, prefix []byte) []byte {
if len(key) < len(prefix) || !bytes.Equal(key[:len(prefix)], prefix) {
panic("should not happen")
Expand Down
8 changes: 4 additions & 4 deletions x/group/internal/orm/prefixstore/prefixstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func New(store store.KVStore, prefix []byte) store.KVStore {

var _ store.KVStore = Store{}

// Store is similar with cometbft/cometbft/libs/db/prefix_db
// Store is similar with cometbft/cometbft-db/blob/v1.0.1/prefixdb.go
// both gives access only to the limited subset of the store
// for convenience or safety
type Store struct {
Expand Down Expand Up @@ -63,7 +63,7 @@ func (s Store) Set(key, value []byte) error {
func (s Store) Delete(key []byte) error { return s.parent.Delete(s.key(key)) }

// Implements KVStore
// Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L106
// Check https://github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go#L109
func (s Store) Iterator(start, end []byte) (store.Iterator, error) {
newstart := cloneAppend(s.prefix, start)

Expand All @@ -83,7 +83,7 @@ func (s Store) Iterator(start, end []byte) (store.Iterator, error) {
}

// ReverseIterator implements KVStore
// Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L129
// Check https://github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go#L132
func (s Store) ReverseIterator(start, end []byte) (store.Iterator, error) {
newstart := cloneAppend(s.prefix, start)

Expand Down Expand Up @@ -180,7 +180,7 @@ func (pi *prefixIterator) Error() error {
return nil
}

// copied from github.com/cometbft/cometbft/libs/db/prefix_db.go
// copied from github.com/cometbft/cometbft-db/blob/v1.0.1/prefixdb.go
func stripPrefix(key, prefix []byte) []byte {
if len(key) < len(prefix) || !bytes.Equal(key[:len(prefix)], prefix) {
panic("should not happen")
Expand Down

0 comments on commit 8117f2c

Please sign in to comment.