Skip to content

Commit 01bc368

Browse files
committed
Revert "Attempt to resolve @pmikolajczyk41 and @ganeshvanahalli concerns"
This reverts commit 94cbe8d.
1 parent 4e6ac35 commit 01bc368

File tree

3 files changed

+12
-20
lines changed

3 files changed

+12
-20
lines changed

arbitrum/apibackend.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,9 @@ func createRegisterAPIBackend(backend *Backend, filterConfig filters.Config, fal
150150
archiveClientsManager: archiveClientsManager,
151151
}
152152
filterSystem := filters.NewFilterSystem(backend.apiBackend, filterConfig)
153-
apis := backend.apiBackend.GetAPIs(filterSystem)
154-
transactionAPI := ethapi.GetTransactionAPI(backend.apiBackend)
155-
apis = append(apis, rpc.API{
156-
Namespace: "eth",
157-
Service: transactionAPI,
158-
})
153+
apis, receiptFetcher := backend.apiBackend.GetAPIs(filterSystem)
159154
backend.stack.RegisterAPIs(apis)
160-
return filterSystem, transactionAPI, nil
155+
return filterSystem, receiptFetcher, nil
161156
}
162157

163158
func (a *APIBackend) SetSyncBackend(sync SyncProgressBackend) error {
@@ -168,8 +163,8 @@ func (a *APIBackend) SetSyncBackend(sync SyncProgressBackend) error {
168163
return nil
169164
}
170165

171-
func (a *APIBackend) GetAPIs(filterSystem *filters.FilterSystem) []rpc.API {
172-
apis := ethapi.GetAPIs(a)
166+
func (a *APIBackend) GetAPIs(filterSystem *filters.FilterSystem) ([]rpc.API, ReceiptFetcher) {
167+
apis, transactionAPI := ethapi.GetAPIs(a)
173168

174169
apis = append(apis, rpc.API{
175170
Namespace: "eth",
@@ -201,7 +196,7 @@ func (a *APIBackend) GetAPIs(filterSystem *filters.FilterSystem) []rpc.API {
201196

202197
apis = append(apis, tracers.APIs(a)...)
203198

204-
return apis
199+
return apis, transactionAPI
205200
}
206201

207202
func (a *APIBackend) BlockChain() *core.BlockChain {

eth/backend.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ func makeExtraData(extra []byte) []byte {
394394
// APIs return the collection of RPC services the ethereum package offers.
395395
// NOTE, some of these services probably need to be moved to somewhere else.
396396
func (s *Ethereum) APIs() []rpc.API {
397-
apis := ethapi.GetAPIs(s.APIBackend)
397+
apis, _ := ethapi.GetAPIs(s.APIBackend)
398398

399399
// Append all the local APIs and return
400400
return append(apis, []rpc.API{
@@ -404,9 +404,6 @@ func (s *Ethereum) APIs() []rpc.API {
404404
}, {
405405
Namespace: "eth",
406406
Service: downloader.NewDownloaderAPI(s.handler.downloader, s.blockchain, s.eventMux),
407-
}, {
408-
Namespace: "eth",
409-
Service: ethapi.GetTransactionAPI(s.APIBackend),
410407
}, {
411408
Namespace: "admin",
412409
Service: NewAdminAPI(s),

internal/ethapi/backend.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,19 @@ type Backend interface {
108108
NewMatcherBackend() filtermaps.MatcherBackend
109109
}
110110

111-
func GetTransactionAPI(apiBackend Backend) *TransactionAPI {
111+
func GetAPIs(apiBackend Backend) ([]rpc.API, *TransactionAPI) {
112112
nonceLock := new(AddrLocker)
113-
return NewTransactionAPI(apiBackend, nonceLock)
114-
}
115-
116-
func GetAPIs(apiBackend Backend) []rpc.API {
113+
transactionAPI := NewTransactionAPI(apiBackend, nonceLock)
117114
return []rpc.API{
118115
{
119116
Namespace: "eth",
120117
Service: NewEthereumAPI(apiBackend),
121118
}, {
122119
Namespace: "eth",
123120
Service: NewBlockChainAPI(apiBackend),
121+
}, {
122+
Namespace: "eth",
123+
Service: transactionAPI,
124124
}, {
125125
Namespace: "txpool",
126126
Service: NewTxPoolAPI(apiBackend),
@@ -131,5 +131,5 @@ func GetAPIs(apiBackend Backend) []rpc.API {
131131
Namespace: "eth",
132132
Service: NewEthereumAccountAPI(apiBackend.AccountManager()),
133133
},
134-
}
134+
}, transactionAPI
135135
}

0 commit comments

Comments
 (0)