Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MemoryMutation satisfy TemporalTx interface #12828

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
Loading