refactor(core): core review (1/n) (#21193)
This commit is contained in:
parent
6b4557ddb8
commit
72e77c3580
@ -20,7 +20,7 @@ type QueryResponse struct {
|
||||
Value []byte
|
||||
}
|
||||
|
||||
type BlockRequest[T any] struct {
|
||||
type BlockRequest[T transaction.Tx] struct {
|
||||
Height uint64
|
||||
Time time.Time
|
||||
Hash []byte
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
package store
|
||||
|
||||
// DatabaseService provides access to the underlying database for CRUD operations of non-consensus data.
|
||||
// WARNING: using this api will make your module unprovable for fraud and validity proofs
|
||||
type DatabaseService interface {
|
||||
Database() NonConsensusStore
|
||||
}
|
||||
|
||||
// NonConsensusStore is a simple key-value store that is used to store non-consensus data.
|
||||
// Note the non-consensus data is not committed to the blockchain and does not allow iteration
|
||||
type NonConsensusStore 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
|
||||
}
|
||||
@ -21,6 +21,8 @@ type MemoryStoreService interface {
|
||||
// TransientStoreService represents a unique, non-forgeable handle to a memory-backed
|
||||
// KVStore which is reset at the start of every block. It should be provided as
|
||||
// a module-scoped dependency by the runtime module being used to build the app.
|
||||
// WARNING: This service is not available in server/v2 apps. Store/v2 does not support
|
||||
// transient stores.
|
||||
type TransientStoreService interface {
|
||||
// OpenTransientStore retrieves the transient store from the context.
|
||||
OpenTransientStore(context.Context) KVStore
|
||||
|
||||
Loading…
Reference in New Issue
Block a user