Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
e3: idx range method (erigontech#7767)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Jun 20, 2023
1 parent 6815323 commit 880c939
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
19 changes: 1 addition & 18 deletions core/state/temporal/kv_temporal.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,24 +410,7 @@ func (tx *Tx) HistoryGet(name kv.History, key []byte, ts uint64) (v []byte, ok b
}

func (tx *Tx) IndexRange(name kv.InvertedIdx, k []byte, fromTs, toTs int, asc order.By, limit int) (timestamps iter.U64, err error) {
switch name {
case kv.AccountsHistoryIdx:
timestamps, err = tx.aggCtx.AccountHistoyIdxRange(k, fromTs, toTs, asc, limit, tx)
case kv.StorageHistoryIdx:
timestamps, err = tx.aggCtx.StorageHistoyIdxRange(k, fromTs, toTs, asc, limit, tx)
case kv.CodeHistoryIdx:
timestamps, err = tx.aggCtx.CodeHistoyIdxRange(k, fromTs, toTs, asc, limit, tx)
case kv.LogTopicIdx:
timestamps, err = tx.aggCtx.LogTopicRange(k, fromTs, toTs, asc, limit, tx)
case kv.LogAddrIdx:
timestamps, err = tx.aggCtx.LogAddrRange(k, fromTs, toTs, asc, limit, tx)
case kv.TracesFromIdx:
timestamps, err = tx.aggCtx.TraceFromRange(k, fromTs, toTs, asc, limit, tx)
case kv.TracesToIdx:
timestamps, err = tx.aggCtx.TraceToRange(k, fromTs, toTs, asc, limit, tx)
default:
return nil, fmt.Errorf("unexpected history name: %s", name)
}
timestamps, err = tx.aggCtx.IndexRange(name, k, fromTs, toTs, asc, limit, tx.MdbxTx)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon
go 1.19

require (
github.com/ledgerwatch/erigon-lib v0.0.0-20230619064215-9090990e1696
github.com/ledgerwatch/erigon-lib v0.0.0-20230620035725-0610e2e32317
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230605042354-196538d42475
github.com/ledgerwatch/log/v3 v3.8.0
github.com/ledgerwatch/secp256k1 v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/ledgerwatch/erigon-lib v0.0.0-20230619064215-9090990e1696 h1:Uir08miTnJ6mxh9rGAzXCMLn7D1GDCsciYKoJNTh3WU=
github.com/ledgerwatch/erigon-lib v0.0.0-20230619064215-9090990e1696/go.mod h1:iz1daifnfSn3P0Iwd21ioyjwdmFEOn8DKeynahoHeSc=
github.com/ledgerwatch/erigon-lib v0.0.0-20230620035725-0610e2e32317 h1:3O7JJHpsHIE0coFUO+r5Z4Z0IYKZO9rpZhLeF2kLifU=
github.com/ledgerwatch/erigon-lib v0.0.0-20230620035725-0610e2e32317/go.mod h1:iz1daifnfSn3P0Iwd21ioyjwdmFEOn8DKeynahoHeSc=
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230605042354-196538d42475 h1:1BvWA6agTUS4RZUHx79f45HpvelMVv4iEddaURUYcC8=
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230605042354-196538d42475/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo=
github.com/ledgerwatch/log/v3 v3.8.0 h1:gCpp7uGtIerEz1jKVPeDnbIopFPud9ZnCpBLlLBGqPU=
Expand Down

0 comments on commit 880c939

Please sign in to comment.