Skip to content

Commit

Permalink
Make MemoryMutation satisfy TemporalTx interface (#12828)
Browse files Browse the repository at this point in the history
Co-authored-by: antonis19 <[email protected]>
  • Loading branch information
antonis19 and antonis19 authored Nov 22, 2024
1 parent 7fba1b2 commit b565e4c
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions erigon-lib/kv/membatchwithdb/memory_mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,30 +713,31 @@ func (m *MemoryMutation) AggTx() any {
}

func (m *MemoryMutation) GetLatest(name kv.Domain, k, k2 []byte) (v []byte, step uint64, err error) {
panic("not supported")
//return m.db.(kv.TemporalTx).GetLatest(name, k, k2)
// panic("not supported")
return m.db.(kv.TemporalTx).GetLatest(name, k, k2)
}

func (m *MemoryMutation) GetAsOf(name kv.Domain, k, k2 []byte, ts uint64) (v []byte, ok bool, err error) {
panic("not supported")
//return m.db.(kv.TemporalTx).GetAsOf(name, k, k2, ts)
// panic("not supported")
return m.db.(kv.TemporalTx).GetAsOf(name, k, k2, ts)
}
func (m *MemoryMutation) HistorySeek(name kv.History, k []byte, ts uint64) (v []byte, ok bool, err error) {
panic("not supported")
//return m.db.(kv.TemporalTx).HistorySeek(name, k, ts)

func (m *MemoryMutation) RangeAsOf(name kv.Domain, fromKey, toKey []byte, ts uint64, asc order.By, limit int) (it stream.KV, err error) {
// panic("not supported")
return m.db.(kv.TemporalTx).RangeAsOf(name, fromKey, toKey, ts, asc, limit)
}

func (m *MemoryMutation) IndexRange(name kv.InvertedIdx, k []byte, fromTs, toTs int, asc order.By, limit int) (timestamps stream.U64, err error) {
func (m *MemoryMutation) HistorySeek(name kv.Domain, k []byte, ts uint64) (v []byte, ok bool, err error) {
panic("not supported")
//return m.db.(kv.TemporalTx).IndexRange(name, k, fromTs, toTs, asc, limit)
// return m.db.(kv.TemporalTx).HistorySeek(name, k, ts)
}

func (m *MemoryMutation) HistoryRange(name kv.History, fromTs, toTs int, asc order.By, limit int) (it stream.KV, err error) {
panic("not supported")
//return m.db.(kv.TemporalTx).HistoryRange(name, fromTs, toTs, asc, limit)
func (m *MemoryMutation) IndexRange(name kv.InvertedIdx, k []byte, fromTs, toTs int, asc order.By, limit int) (timestamps stream.U64, err error) {
// panic("not supported")
return m.db.(kv.TemporalTx).IndexRange(name, k, fromTs, toTs, asc, limit)
}

func (m *MemoryMutation) DomainRange(name kv.Domain, fromKey, toKey []byte, ts uint64, asc order.By, limit int) (it stream.KV, err error) {
func (m *MemoryMutation) HistoryRange(name kv.Domain, fromTs, toTs int, asc order.By, limit int) (it stream.KV, err error) {
panic("not supported")
//return m.db.(kv.TemporalTx).RangeAsOf(name, fromKey, toKey, ts, asc, limit)
// return m.db.(kv.TemporalTx).HistoryRange(name, fromTs, toTs, asc, limit)
}

0 comments on commit b565e4c

Please sign in to comment.