Documentation ¶
Index ¶
- Variables
- type CommitStore
- func (c *CommitStore) Close() (ferr error)
- func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error)
- func (c *CommitStore) Get(storeKey []byte, version uint64, key []byte) ([]byte, error)
- func (c *CommitStore) GetCommitInfo(version uint64) (*proof.CommitInfo, error)
- func (c *CommitStore) GetLatestVersion() (uint64, error)
- func (c *CommitStore) GetProof(storeKey []byte, version uint64, key []byte) ([]proof.CommitmentOp, error)
- func (c *CommitStore) LoadVersion(targetVersion uint64) error
- func (c *CommitStore) PausePruning(pause bool)
- func (c *CommitStore) Prune(version uint64) (ferr error)
- func (c *CommitStore) Restore(version uint64, format uint32, protoReader protoio.Reader, ...) (snapshotstypes.SnapshotItem, error)
- func (c *CommitStore) SetInitialVersion(version uint64) error
- func (c *CommitStore) Snapshot(version uint64, protoWriter protoio.Writer) error
- func (c *CommitStore) WorkingCommitInfo(version uint64) *proof.CommitInfo
- func (c *CommitStore) WriteChangeset(cs *corestore.Changeset) error
- type CommitStoreTestSuite
- type Exporter
- type Importer
- type Tree
Constants ¶
This section is empty.
Variables ¶
ErrorExportDone is returned by Exporter.Next() when all items have been exported.
Functions ¶
This section is empty.
Types ¶
type CommitStore ¶
type CommitStore struct {
// contains filtered or unexported fields
}
CommitStore is a wrapper around multiple Tree objects mapped by a unique store key. Each store key reflects dedicated and unique usage within a module. A caller can construct a CommitStore with one or more store keys. It is expected that a RootStore use a CommitStore as an abstraction to handle multiple store keys and trees.
func NewCommitStore ¶
func NewCommitStore(trees map[string]Tree, db corestore.KVStoreWithBatch, logger log.Logger) (*CommitStore, error)
NewCommitStore creates a new CommitStore instance.
func (*CommitStore) Close ¶
func (c *CommitStore) Close() (ferr error)
func (*CommitStore) Commit ¶
func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error)
func (*CommitStore) Get ¶
func (*CommitStore) GetCommitInfo ¶
func (c *CommitStore) GetCommitInfo(version uint64) (*proof.CommitInfo, error)
func (*CommitStore) GetLatestVersion ¶
func (c *CommitStore) GetLatestVersion() (uint64, error)
func (*CommitStore) GetProof ¶
func (c *CommitStore) GetProof(storeKey []byte, version uint64, key []byte) ([]proof.CommitmentOp, error)
func (*CommitStore) LoadVersion ¶
func (c *CommitStore) LoadVersion(targetVersion uint64) error
func (*CommitStore) PausePruning ¶
func (c *CommitStore) PausePruning(pause bool)
PausePruning implements store.PausablePruner.
func (*CommitStore) Prune ¶
func (c *CommitStore) Prune(version uint64) (ferr error)
Prune implements store.Pruner.
func (*CommitStore) Restore ¶
func (c *CommitStore) Restore( version uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *corestore.StateChanges, ) (snapshotstypes.SnapshotItem, error)
Restore implements snapshotstypes.CommitSnapshotter.
func (*CommitStore) SetInitialVersion ¶
func (c *CommitStore) SetInitialVersion(version uint64) error
func (*CommitStore) Snapshot ¶
func (c *CommitStore) Snapshot(version uint64, protoWriter protoio.Writer) error
Snapshot implements snapshotstypes.CommitSnapshotter.
func (*CommitStore) WorkingCommitInfo ¶
func (c *CommitStore) WorkingCommitInfo(version uint64) *proof.CommitInfo
func (*CommitStore) WriteChangeset ¶
func (c *CommitStore) WriteChangeset(cs *corestore.Changeset) error
type CommitStoreTestSuite ¶
type CommitStoreTestSuite struct { suite.Suite NewStore func(db corestore.KVStoreWithBatch, storeKeys []string, logger log.Logger) (*CommitStore, error) }
CommitStoreTestSuite is a test suite to be used for all tree backends.
func (*CommitStoreTestSuite) TestStore_Pruning ¶
func (s *CommitStoreTestSuite) TestStore_Pruning()
func (*CommitStoreTestSuite) TestStore_Snapshotter ¶
func (s *CommitStoreTestSuite) TestStore_Snapshotter()
type Exporter ¶
type Exporter interface { Next() (*snapshotstypes.SnapshotIAVLItem, error) io.Closer }
Exporter is the interface that wraps the basic Export methods.
type Importer ¶
type Importer interface { Add(*snapshotstypes.SnapshotIAVLItem) error Commit() error io.Closer }
Importer is the interface that wraps the basic Import methods.
type Tree ¶
type Tree interface { Set(key, value []byte) error Remove(key []byte) error GetLatestVersion() uint64 // Hash returns the hash of the latest saved version of the tree. Hash() []byte // WorkingHash returns the working hash of the tree. WorkingHash() []byte LoadVersion(version uint64) error Commit() ([]byte, uint64, error) SetInitialVersion(version uint64) error GetProof(version uint64, key []byte) (*ics23.CommitmentProof, error) // Get attempts to retrieve a value from the tree for a given version. // // NOTE: This method only exists to support migration from IAVL v0/v1 to v2. // Once migration is complete, this method should be removed and/or not used. Get(version uint64, key []byte) ([]byte, error) Prune(version uint64) error Export(version uint64) (Exporter, error) Import(version uint64) (Importer, error) io.Closer }
Tree is the interface that wraps the basic Tree methods.