Versions in this module Expand all Collapse all v0 v0.47.0 Feb 1, 2022 Changes in this version + const EncodedSeqLength + const MaxBytesLen + func AddLengthPrefix(bytes []byte) []byte + func DecodeSequence(bz []byte) uint64 + func EncodeSequence(val uint64) []byte + func NullTerminatedBytes(s string) []byte + func Paginate(it Iterator, pageRequest *query.PageRequest, dest ModelSlicePtr) (*query.PageResponse, error) + func PrefixRange(prefix []byte) ([]byte, []byte) + func PrimaryKey(obj PrimaryKeyed) []byte + type AfterDeleteInterceptor func(store sdk.KVStore, rowID RowID, value codec.ProtoMarshaler) error + type AfterSetInterceptor func(store sdk.KVStore, rowID RowID, newValue, oldValue codec.ProtoMarshaler) error + type AutoUInt64Table struct + func NewAutoUInt64Table(prefixData [2]byte, prefixSeq byte, model codec.ProtoMarshaler, ...) (*AutoUInt64Table, error) + func (a AutoUInt64Table) AddAfterDeleteInterceptor(interceptor AfterDeleteInterceptor) + func (a AutoUInt64Table) AddAfterSetInterceptor(interceptor AfterSetInterceptor) + func (a AutoUInt64Table) Create(store sdk.KVStore, obj codec.ProtoMarshaler) (uint64, error) + func (a AutoUInt64Table) Delete(store sdk.KVStore, rowID uint64) error + func (a AutoUInt64Table) Export(store sdk.KVStore, dest ModelSlicePtr) (uint64, error) + func (a AutoUInt64Table) GetOne(store sdk.KVStore, rowID uint64, dest codec.ProtoMarshaler) (RowID, error) + func (a AutoUInt64Table) Has(store sdk.KVStore, rowID uint64) bool + func (a AutoUInt64Table) Import(store sdk.KVStore, data interface{}, seqValue uint64) error + func (a AutoUInt64Table) PrefixScan(store sdk.KVStore, start, end uint64) (Iterator, error) + func (a AutoUInt64Table) ReversePrefixScan(store sdk.KVStore, start uint64, end uint64) (Iterator, error) + func (a AutoUInt64Table) RowGetter() RowGetter + func (a AutoUInt64Table) Sequence() Sequence + func (a AutoUInt64Table) Set(store sdk.KVStore, rowID RowID, newValue codec.ProtoMarshaler) error + func (a AutoUInt64Table) Update(store sdk.KVStore, rowID uint64, newValue codec.ProtoMarshaler) error + type GasCountingMockContext struct + GasMeter sdk.GasMeter + func NewGasCountingMockContext() *GasCountingMockContext + func (g *GasCountingMockContext) ResetGasMeter() + func (g GasCountingMockContext) GasConsumed() types.Gas + func (g GasCountingMockContext) GasRemaining() types.Gas + func (g GasCountingMockContext) KVStore(store sdk.KVStore) sdk.KVStore + type Index interface + Get func(store sdk.KVStore, searchKey interface{}) (Iterator, error) + GetPaginated func(store sdk.KVStore, searchKey interface{}, pageRequest *query.PageRequest) (Iterator, error) + Has func(store sdk.KVStore, key interface{}) (bool, error) + PrefixScan func(store sdk.KVStore, startI interface{}, endI interface{}) (Iterator, error) + ReversePrefixScan func(store sdk.KVStore, startI interface{}, endI interface{}) (Iterator, error) + type Indexable interface + AddAfterDeleteInterceptor func(interceptor AfterDeleteInterceptor) + AddAfterSetInterceptor func(interceptor AfterSetInterceptor) + RowGetter func() RowGetter + type Indexer struct + func NewIndexer(indexerFunc IndexerFunc) (*Indexer, error) + func NewUniqueIndexer(f UniqueIndexerFunc) (*Indexer, error) + func (i Indexer) IndexerFunc() IndexerFunc + func (i Indexer) OnCreate(store sdk.KVStore, rowID RowID, value interface{}) error + func (i Indexer) OnDelete(store sdk.KVStore, rowID RowID, value interface{}) error + func (i Indexer) OnUpdate(store sdk.KVStore, rowID RowID, newValue, oldValue interface{}) error + type IndexerFunc func(value interface{}) ([]interface{}, error) + type Iterator interface + LoadNext func(dest codec.ProtoMarshaler) (RowID, error) + func NewInvalidIterator() Iterator + func NewSingleValueIterator(rowID RowID, val []byte) Iterator + type IteratorFunc func(dest codec.ProtoMarshaler) (RowID, error) + func (i IteratorFunc) Close() error + func (i IteratorFunc) LoadNext(dest codec.ProtoMarshaler) (RowID, error) + type LimitedIterator struct + func LimitIterator(parent Iterator, max int) (*LimitedIterator, error) + func (i *LimitedIterator) LoadNext(dest codec.ProtoMarshaler) (RowID, error) + func (i LimitedIterator) Close() error + type MockContext struct + func NewMockContext() *MockContext + func (m MockContext) KVStore(key storetypes.StoreKey) sdk.KVStore + type ModelSlicePtr interface + type MultiKeyIndex struct + func NewIndex(tb Indexable, prefix byte, indexerF IndexerFunc, indexKey interface{}) (MultiKeyIndex, error) + func (i MultiKeyIndex) Get(store sdk.KVStore, searchKey interface{}) (Iterator, error) + func (i MultiKeyIndex) GetPaginated(store sdk.KVStore, searchKey interface{}, pageRequest *query.PageRequest) (Iterator, error) + func (i MultiKeyIndex) Has(store sdk.KVStore, key interface{}) (bool, error) + func (i MultiKeyIndex) PrefixScan(store sdk.KVStore, startI interface{}, endI interface{}) (Iterator, error) + func (i MultiKeyIndex) ReversePrefixScan(store sdk.KVStore, startI interface{}, endI interface{}) (Iterator, error) + type PrimaryKeyTable struct + func NewPrimaryKeyTable(prefixData [2]byte, model PrimaryKeyed, cdc codec.Codec) (*PrimaryKeyTable, error) + func (a PrimaryKeyTable) AddAfterDeleteInterceptor(interceptor AfterDeleteInterceptor) + func (a PrimaryKeyTable) AddAfterSetInterceptor(interceptor AfterSetInterceptor) + func (a PrimaryKeyTable) Contains(store sdk.KVStore, obj PrimaryKeyed) bool + func (a PrimaryKeyTable) Create(store sdk.KVStore, obj PrimaryKeyed) error + func (a PrimaryKeyTable) Delete(store sdk.KVStore, obj PrimaryKeyed) error + func (a PrimaryKeyTable) Export(store sdk.KVStore, dest ModelSlicePtr) (uint64, error) + func (a PrimaryKeyTable) GetOne(store sdk.KVStore, primKey RowID, dest codec.ProtoMarshaler) error + func (a PrimaryKeyTable) Has(store sdk.KVStore, primaryKey RowID) bool + func (a PrimaryKeyTable) Import(store sdk.KVStore, data interface{}, seqValue uint64) error + func (a PrimaryKeyTable) PrefixScan(store sdk.KVStore, start, end []byte) (Iterator, error) + func (a PrimaryKeyTable) ReversePrefixScan(store sdk.KVStore, start, end []byte) (Iterator, error) + func (a PrimaryKeyTable) RowGetter() RowGetter + func (a PrimaryKeyTable) Set(store sdk.KVStore, newValue PrimaryKeyed) error + func (a PrimaryKeyTable) Update(store sdk.KVStore, newValue PrimaryKeyed) error + type PrimaryKeyed interface + PrimaryKeyFields func() []interface{} + type RowGetter func(store sdk.KVStore, rowID RowID, dest codec.ProtoMarshaler) error + func NewTypeSafeRowGetter(prefixKey [2]byte, model reflect.Type, cdc codec.Codec) RowGetter + type RowID []byte + func First(it Iterator, dest codec.ProtoMarshaler) (RowID, error) + func ReadAll(it Iterator, dest ModelSlicePtr) ([]RowID, error) + func (r RowID) Bytes() []byte + type Sequence struct + func NewSequence(prefix byte) Sequence + func (s Sequence) CurVal(store sdk.KVStore) uint64 + func (s Sequence) InitVal(store sdk.KVStore, seq uint64) error + func (s Sequence) NextVal(store sdk.KVStore) uint64 + func (s Sequence) PeekNextVal(store sdk.KVStore) uint64 + type TableExportable interface + Export func(store sdk.KVStore, dest ModelSlicePtr) (uint64, error) + Import func(store sdk.KVStore, data interface{}, seqValue uint64) error + type UniqueIndex struct + func NewUniqueIndex(tb Indexable, prefix byte, uniqueIndexerFunc UniqueIndexerFunc, ...) (UniqueIndex, error) + type UniqueIndexerFunc func(value interface{}) (interface{}, error) + type Validateable interface + ValidateBasic func() error