@@ -14,6 +14,7 @@ import (
14
14
"github.com/ethereum/go-ethereum/core/types"
15
15
"github.com/ethereum/go-ethereum/internal/ethapi"
16
16
"github.com/ethereum/go-ethereum/log"
17
+ "github.com/ethereum/go-ethereum/params"
17
18
"github.com/ethereum/go-ethereum/rpc"
18
19
)
19
20
@@ -61,11 +62,6 @@ type SubqlAPI struct {
61
62
backend ethapi.Backend
62
63
}
63
64
64
- type DataInfo struct {
65
- StartBlock int `json:"startBlock"`
66
- EndBlock int `json:"endBlock"`
67
- }
68
-
69
65
type Capability struct {
70
66
AvailableBlocks []struct {
71
67
StartHeight int `json:"startHeight"`
@@ -123,23 +119,11 @@ func NewSubqlApi(sys *FilterSystem, backend ethapi.Backend) *SubqlAPI {
123
119
return api
124
120
}
125
121
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 ) {
127
124
config := rawdb .ReadChainDataConfig (api .backend .ChainDb ())
128
125
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
143
127
}
144
128
145
129
func (api * SubqlAPI ) FilterBlocksCapabilities (ctx context.Context ) (* Capability , error ) {
0 commit comments