Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update cometbft db code reference link (backport #22166) #22169

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading