Skip to content

refactor(collections): remove core dependency #24081

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

Merged
merged 18 commits into from
Mar 28, 2025
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
4 changes: 4 additions & 0 deletions collections/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Improvements

* [#24081](https://github.com/cosmos/cosmos-sdk/pull/24081) Remove `cosmossdk.io/core` dependency.

## [v1.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/collections%2Fv1.1.0)

### Improvements
Expand Down
8 changes: 4 additions & 4 deletions collections/collections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (

"github.com/stretchr/testify/require"

"cosmossdk.io/core/store"
"cosmossdk.io/core/testing"
store "cosmossdk.io/collections/corecompat"
"cosmossdk.io/collections/internal/testutil"
)

func deps() (store.KVStoreService, context.Context) {
ctx := coretesting.Context()
kv := coretesting.KVStoreService(ctx, "test")
ctx := testutil.Context()
kv := testutil.KVStoreService(ctx, "test")
return kv, ctx
}

Expand Down
2 changes: 1 addition & 1 deletion collections/colltest/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

db "github.com/cosmos/cosmos-db"

"cosmossdk.io/core/store"
store "cosmossdk.io/collections/corecompat"
)

type contextStoreKey struct{}
Expand Down
26 changes: 26 additions & 0 deletions collections/corecompat/codec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package corecompat

// Codec defines a Binary Codec and JSON Codec for modules to encode and decode data.
type Codec interface {
BinaryCodec
JSONCodec
}

// BinaryCodec defines a binary encoding and decoding interface for modules to encode and decode data.
type BinaryCodec interface {
Marshal(ProtoMsg) ([]byte, error)
Unmarshal([]byte, ProtoMsg) error
}

// JSONCodec defines a JSON encoding and decoding interface for modules to encode and decode data.
type JSONCodec interface {
MarshalJSON(ProtoMsg) ([]byte, error)
UnmarshalJSON([]byte, ProtoMsg) error
}

// ProtoMsg defines the legacy golang proto message interface.
type ProtoMsg = interface {
Reset()
String() string
ProtoMessage()
}
4 changes: 4 additions & 0 deletions collections/corecompat/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Package corecompat defines the store, codec and genesis interface that collections expects
// or implements. These interfaces are all redefined from cosmossdk.io/core in order to
// avoid a direct dependency on cosmossdk.io/core.
package corecompat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this package feel like the right place to put this stuff?

20 changes: 20 additions & 0 deletions collections/corecompat/genesis.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package corecompat

import "io"

// GenesisSource is a source for genesis data in JSON format. It may abstract over a
// single JSON object or separate files for each field in a JSON object that can
// be streamed over. Modules should open a separate io.ReadCloser for each field that
// is required. When fields represent arrays they can efficiently be streamed
// over. If there is no data for a field, this function should return nil, nil. It is
// important that the caller closes the reader when done with it.
type GenesisSource = func(field string) (io.ReadCloser, error)

// GenesisTarget is a target for writing genesis data in JSON format. It may
// abstract over a single JSON object or JSON in separate files that can be
// streamed over. Modules should open a separate io.WriteCloser for each field
// and should prefer writing fields as arrays when possible to support efficient
// iteration. It is important the caller closers the writer AND checks the error
// when done with it. It is expected that a stream of JSON data is written
// to the writer.
type GenesisTarget = func(field string) (io.WriteCloser, error)
84 changes: 84 additions & 0 deletions collections/corecompat/store.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package corecompat

import "context"

// KVStoreService represents a unique, non-forgeable handle to a regular merkle-tree
// backed KVStore. It should be provided as a module-scoped dependency by the runtime
// module being used to build the app.
type KVStoreService = interface {
// OpenKVStore retrieves the KVStore from the context.
OpenKVStore(context.Context) KVStore
}

// MemoryStoreService represents a unique, non-forgeable handle to a memory-backed
// KVStore. It should be provided as a module-scoped dependency by the runtime
// module being used to build the app.
type MemoryStoreService = interface {
// OpenMemoryStore retrieves the memory store from the context.
OpenMemoryStore(context.Context) KVStore
}

// KVStore describes the basic interface for interacting with key-value stores.
type KVStore = interface {
// Get returns nil iff key doesn't exist. Errors on nil key.
Get(key []byte) ([]byte, error)

// Has checks if a key exists. Errors on nil key.
Has(key []byte) (bool, error)

// Set sets the key. Errors on nil key or value.
Set(key, value []byte) error

// Delete deletes the key. Errors on nil key.
Delete(key []byte) error

// Iterator iterates over a domain of keys in ascending order. End is exclusive.
// Start must be less than end, or the Iterator is invalid.
// Iterator must be closed by caller.
// To iterate over entire domain, use store.Iterator(nil, nil)
// CONTRACT: No writes may happen within a domain while an iterator exists over it.
// Exceptionally allowed for cachekv.Store, safe to write in the modules.
Iterator(start, end []byte) (Iterator, error)

// ReverseIterator iterates over a domain of keys in descending order. End is exclusive.
// Start must be less than end, or the Iterator is invalid.
// Iterator must be closed by caller.
// CONTRACT: No writes may happen within a domain while an iterator exists over it.
// Exceptionally allowed for cachekv.Store, safe to write in the modules.
ReverseIterator(start, end []byte) (Iterator, error)
}

// Iterator represents an iterator over a domain of keys. Callers must call
// Close when done. No writes can happen to a domain while there exists an
// iterator over it. Some backends may take out database locks to ensure this
// will not happen.
//
// Callers must make sure the iterator is valid before calling any methods on it,
// otherwise these methods will panic.
type Iterator = interface {
// Domain returns the start (inclusive) and end (exclusive) limits of the iterator.
Domain() (start, end []byte)

// Valid returns whether the current iterator is valid. Once invalid, the Iterator remains
// invalid forever.
Valid() bool

// Next moves the iterator to the next key in the database, as defined by order of iteration.
// If Valid returns false, this method will panic.
Next()

// Key returns the key at the current position. Panics if the iterator is invalid.
// Note, the key returned should be a copy and thus safe for modification.
Key() []byte

// Value returns the value at the current position. Panics if the iterator is
// invalid.
// Note, the value returned should be a copy and thus safe for modification.
Value() []byte

// Error returns the last error encountered by the iterator, if any.
Error() error

// Close closes the iterator, releasing any allocated resources.
Close() error
}
2 changes: 1 addition & 1 deletion collections/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/stretchr/testify/require"

"cosmossdk.io/core/appmodule"
appmodule "cosmossdk.io/collections/corecompat"
)

func TestDefaultGenesis(t *testing.T) {
Expand Down
8 changes: 3 additions & 5 deletions collections/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ module cosmossdk.io/collections
go 1.23.2

require (
cosmossdk.io/core v1.0.0
cosmossdk.io/core/testing v0.0.2
cosmossdk.io/schema v1.0.0
github.com/cosmos/cosmos-db v1.1.1
github.com/cosmos/gogoproto v1.7.0
github.com/google/go-cmp v0.7.0
github.com/google/go-cmp v0.6.0
github.com/stretchr/testify v1.10.0
github.com/tidwall/btree v1.7.0
google.golang.org/protobuf v1.36.6
Expand Down Expand Up @@ -46,7 +44,7 @@ require (
github.com/spf13/cast v1.7.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
24 changes: 10 additions & 14 deletions collections/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cosmossdk.io/core v1.0.0 h1:e7XBbISOytLBOXMVwpRPixThXqEkeLGlg8no/qpgS8U=
cosmossdk.io/core v1.0.0/go.mod h1:mKIp3RkoEmtqdEdFHxHwWAULRe+79gfdOvmArrLDbDc=
cosmossdk.io/core/testing v0.0.2 h1:TXAmsnHa1C5lLiVN1z+rnkiyNS6sNwcGJCb6OouaNv8=
cosmossdk.io/core/testing v0.0.2/go.mod h1:6Y3QaoNXsgeHiV4+9oYF/IqMFqCK5cJClonw/OXxHlY=
cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ=
cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
Expand Down Expand Up @@ -153,8 +149,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
Expand Down Expand Up @@ -348,8 +344,8 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand All @@ -366,8 +362,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -411,17 +407,17 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
8 changes: 4 additions & 4 deletions collections/indexed_map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"cosmossdk.io/collections"
"cosmossdk.io/collections/colltest"
"cosmossdk.io/collections/indexes"
"cosmossdk.io/core/testing"
"cosmossdk.io/collections/internal/testutil"
)

type company struct {
Expand Down Expand Up @@ -45,8 +45,8 @@ func newTestIndexedMap(schema *collections.SchemaBuilder) *collections.IndexedMa
}

func TestIndexedMap(t *testing.T) {
ctx := coretesting.Context()
sk := coretesting.KVStoreService(ctx, "test")
ctx := testutil.Context()
sk := testutil.KVStoreService(ctx, "test")

schema := collections.NewSchemaBuilder(sk)

Expand Down Expand Up @@ -125,7 +125,7 @@ func newInferIndex(schema *collections.SchemaBuilder) *inferIndex {
}

func TestIndexedMapInfer(t *testing.T) {
sk := coretesting.KVStoreService(coretesting.Context(), "test")
sk := testutil.KVStoreService(testutil.Context(), "test")
schema := collections.NewSchemaBuilder(sk)

_, err := collections.NewIndexedMapSafe(schema, collections.NewPrefix(0), "im", collections.StringKey, colltest.MockValueCodec[company](), newInferIndex(schema))
Expand Down
8 changes: 4 additions & 4 deletions collections/indexes/indexes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package indexes
import (
"context"

"cosmossdk.io/core/store"
"cosmossdk.io/core/testing"
store "cosmossdk.io/collections/corecompat"
"cosmossdk.io/collections/internal/testutil"
)

func deps() (store.KVStoreService, context.Context) {
ctx := coretesting.Context()
kv := coretesting.KVStoreService(ctx, "test")
ctx := testutil.Context()
kv := testutil.KVStoreService(ctx, "test")
return kv, ctx
}

Expand Down
32 changes: 32 additions & 0 deletions collections/internal/testutil/context.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package testutil

import (
"context"

"cosmossdk.io/collections/corecompat"
)

type dummyKey struct{}

func Context() context.Context {
dummy := &dummyCtx{
stores: map[string]corecompat.KVStore{},
}

ctx := context.WithValue(context.Background(), dummyKey{}, dummy)
return ctx
}

type dummyCtx struct {
// maps store by the actor.
stores map[string]corecompat.KVStore
}

func unwrap(ctx context.Context) *dummyCtx {
dummy := ctx.Value(dummyKey{})
if dummy == nil {
panic("invalid ctx without dummy")
}

return dummy.(*dummyCtx)
}
31 changes: 31 additions & 0 deletions collections/internal/testutil/store.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package testutil

import (
"context"
"fmt"

db "github.com/cosmos/cosmos-db"

store "cosmossdk.io/collections/corecompat"
)

var _ store.KVStoreService = (*kvStoreService)(nil)

func KVStoreService(ctx context.Context, moduleName string) store.KVStoreService {
unwrap(ctx).stores[moduleName] = db.NewMemDB()
return kvStoreService{
moduleName: moduleName,
}
}

type kvStoreService struct {
moduleName string
}

func (k kvStoreService) OpenKVStore(ctx context.Context) store.KVStore {
kv, ok := unwrap(ctx).stores[k.moduleName]
if !ok {
panic(fmt.Sprintf("KVStoreService %s not found", k.moduleName))
}
return kv
}
2 changes: 1 addition & 1 deletion collections/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"

"cosmossdk.io/collections/codec"
"cosmossdk.io/core/store"
store "cosmossdk.io/collections/corecompat"
)

// ErrInvalidIterator is returned when an Iterate call resulted in an invalid iterator.
Expand Down
Loading
Loading