@@ -14,6 +14,7 @@ import (
1414 "github.com/ethereum/go-ethereum/core/types"
1515 "github.com/ethereum/go-ethereum/internal/ethapi"
1616 "github.com/ethereum/go-ethereum/log"
17+ "github.com/ethereum/go-ethereum/params"
1718 "github.com/ethereum/go-ethereum/rpc"
1819)
1920
@@ -61,11 +62,6 @@ type SubqlAPI struct {
6162 backend ethapi.Backend
6263}
6364
64- type DataInfo struct {
65- StartBlock int `json:"startBlock"`
66- EndBlock int `json:"endBlock"`
67- }
68-
6965type Capability struct {
7066 AvailableBlocks []struct {
7167 StartHeight int `json:"startHeight"`
@@ -123,23 +119,11 @@ func NewSubqlApi(sys *FilterSystem, backend ethapi.Backend) *SubqlAPI {
123119 return api
124120}
125121
126- func (api * SubqlAPI ) DataInfo (ctx context.Context ) (* DataInfo , error ) {
122+ // This is an alias for `admin_getDesiredConfig`
123+ func (api * SubqlAPI ) DataInfo (ctx context.Context ) (* params.ChainDataConfig , error ) {
127124 config := rawdb .ReadChainDataConfig (api .backend .ChainDb ())
128125
129- start := 0
130- if config .DesiredChainDataStart != nil {
131- start = int (* config .DesiredChainDataStart )
132- }
133-
134- end := 0
135- if config .DesiredChainDataEnd != nil {
136- end = int (* config .DesiredChainDataEnd )
137- }
138-
139- return & DataInfo {
140- StartBlock : start ,
141- EndBlock : end ,
142- }, nil
126+ return config , nil
143127}
144128
145129func (api * SubqlAPI ) FilterBlocksCapabilities (ctx context.Context ) (* Capability , error ) {
0 commit comments