mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-23 04:03:49 +00:00
BadgerDatabase GetS
This commit is contained in:
parent
b419f35a17
commit
26cb9bd33b
@ -186,4 +186,10 @@ func (db *BadgerDatabase) DeleteTimestamp(timestamp uint64) error {
|
||||
})
|
||||
}
|
||||
|
||||
// GetS returns a single value that was put into a given historical bucket for an exact timestamp.
|
||||
func (db *BadgerDatabase) GetS(hBucket, key []byte, timestamp uint64) ([]byte, error) {
|
||||
composite, _ := dbutils.CompositeKeySuffix(key, timestamp)
|
||||
return db.Get(hBucket, composite)
|
||||
}
|
||||
|
||||
// TODO [Andrew] implement the full Database interface
|
||||
|
@ -186,6 +186,7 @@ func (db *BoltDatabase) Get(bucket, key []byte) ([]byte, error) {
|
||||
return dat, err
|
||||
}
|
||||
|
||||
// GetS returns a single value that was put into a given historical bucket for an exact timestamp.
|
||||
func (db *BoltDatabase) GetS(hBucket, key []byte, timestamp uint64) ([]byte, error) {
|
||||
composite, _ := dbutils.CompositeKeySuffix(key, timestamp)
|
||||
return db.Get(hBucket, composite)
|
||||
|
@ -35,7 +35,11 @@ type Putter interface {
|
||||
type Getter interface {
|
||||
// Get returns a single value.
|
||||
Get(bucket, key []byte) ([]byte, error)
|
||||
|
||||
// GetS returns a single value that was put into a given historical bucket for an exact timestamp.
|
||||
// timestamp == block number
|
||||
GetS(hBucket, key []byte, timestamp uint64) ([]byte, error)
|
||||
|
||||
GetAsOf(bucket, hBucket, key []byte, timestamp uint64) ([]byte, error)
|
||||
Has(bucket, key []byte) (bool, error)
|
||||
Walk(bucket, startkey []byte, fixedbits uint, walker func([]byte, []byte) (bool, error)) error
|
||||
|
Loading…
Reference in New Issue
Block a user