@@ -17,12 +17,12 @@ import (
17
17
18
18
"github.com/onflow/crypto"
19
19
20
- "github.com/onflow/flow-go/access"
21
20
"github.com/onflow/flow-go/cmd/build"
22
21
hsmock "github.com/onflow/flow-go/consensus/hotstuff/mocks"
23
22
"github.com/onflow/flow-go/consensus/hotstuff/model"
24
23
"github.com/onflow/flow-go/engine/access/ingestion"
25
24
accessmock "github.com/onflow/flow-go/engine/access/mock"
25
+ "github.com/onflow/flow-go/engine/access/rpc"
26
26
"github.com/onflow/flow-go/engine/access/rpc/backend"
27
27
connectionmock "github.com/onflow/flow-go/engine/access/rpc/connection/mock"
28
28
"github.com/onflow/flow-go/engine/access/subscription"
@@ -151,7 +151,7 @@ func (suite *Suite) SetupTest() {
151
151
}
152
152
153
153
func (suite * Suite ) RunTest (
154
- f func (handler * access .Handler , db * badger.DB , all * storage.All ),
154
+ f func (handler * rpc .Handler , db * badger.DB , all * storage.All ),
155
155
) {
156
156
unittest .RunWithBadgerDB (suite .T (), func (db * badger.DB ) {
157
157
all := util .StorageLayer (suite .T (), db )
@@ -175,20 +175,20 @@ func (suite *Suite) RunTest(
175
175
})
176
176
require .NoError (suite .T (), err )
177
177
178
- handler := access .NewHandler (
178
+ handler := rpc .NewHandler (
179
179
suite .backend ,
180
180
suite .chainID .Chain (),
181
181
suite .finalizedHeaderCache ,
182
182
suite .me ,
183
183
subscription .DefaultMaxGlobalStreams ,
184
- access .WithBlockSignerDecoder (suite .signerIndicesDecoder ),
184
+ rpc .WithBlockSignerDecoder (suite .signerIndicesDecoder ),
185
185
)
186
186
f (handler , db , all )
187
187
})
188
188
}
189
189
190
190
func (suite * Suite ) TestSendAndGetTransaction () {
191
- suite .RunTest (func (handler * access .Handler , _ * badger.DB , _ * storage.All ) {
191
+ suite .RunTest (func (handler * rpc .Handler , _ * badger.DB , _ * storage.All ) {
192
192
referenceBlock := unittest .BlockHeaderFixture ()
193
193
transaction := unittest .TransactionFixture ()
194
194
transaction .SetReferenceBlockID (referenceBlock .ID ())
@@ -241,7 +241,7 @@ func (suite *Suite) TestSendAndGetTransaction() {
241
241
}
242
242
243
243
func (suite * Suite ) TestSendExpiredTransaction () {
244
- suite .RunTest (func (handler * access .Handler , _ * badger.DB , _ * storage.All ) {
244
+ suite .RunTest (func (handler * rpc .Handler , _ * badger.DB , _ * storage.All ) {
245
245
referenceBlock := suite .finalizedBlock
246
246
247
247
transaction := unittest .TransactionFixture ()
@@ -261,7 +261,7 @@ func (suite *Suite) TestSendExpiredTransaction() {
261
261
Return (referenceBlock , nil ).
262
262
Twice ()
263
263
264
- //Advancing final state to expire ref block
264
+ // Advancing final state to expire ref block
265
265
suite .finalizedBlock = latestBlock
266
266
267
267
req := & accessproto.SendTransactionRequest {
@@ -343,7 +343,7 @@ func (suite *Suite) TestSendTransactionToRandomCollectionNode() {
343
343
})
344
344
require .NoError (suite .T (), err )
345
345
346
- handler := access .NewHandler (bnd , suite .chainID .Chain (), suite .finalizedHeaderCache , suite .me , subscription .DefaultMaxGlobalStreams )
346
+ handler := rpc .NewHandler (bnd , suite .chainID .Chain (), suite .finalizedHeaderCache , suite .me , subscription .DefaultMaxGlobalStreams )
347
347
348
348
// Send transaction 1
349
349
resp , err := handler .SendTransaction (context .Background (), sendReq1 )
@@ -380,7 +380,7 @@ func (suite *Suite) TestSendTransactionToRandomCollectionNode() {
380
380
}
381
381
382
382
func (suite * Suite ) TestGetBlockByIDAndHeight () {
383
- suite .RunTest (func (handler * access .Handler , db * badger.DB , all * storage.All ) {
383
+ suite .RunTest (func (handler * rpc .Handler , db * badger.DB , all * storage.All ) {
384
384
385
385
// test block1 get by ID
386
386
block1 := unittest .BlockFixture ()
@@ -516,7 +516,7 @@ func (suite *Suite) TestGetBlockByIDAndHeight() {
516
516
}
517
517
518
518
func (suite * Suite ) TestGetExecutionResultByBlockID () {
519
- suite .RunTest (func (handler * access .Handler , db * badger.DB , all * storage.All ) {
519
+ suite .RunTest (func (handler * rpc .Handler , db * badger.DB , all * storage.All ) {
520
520
521
521
// test block1 get by ID
522
522
nonexistingID := unittest .IdentifierFixture ()
@@ -675,7 +675,7 @@ func (suite *Suite) TestGetSealedTransaction() {
675
675
})
676
676
require .NoError (suite .T (), err )
677
677
678
- handler := access .NewHandler (bnd , suite .chainID .Chain (), suite .finalizedHeaderCache , suite .me , subscription .DefaultMaxGlobalStreams )
678
+ handler := rpc .NewHandler (bnd , suite .chainID .Chain (), suite .finalizedHeaderCache , suite .me , subscription .DefaultMaxGlobalStreams )
679
679
680
680
collectionExecutedMetric , err := indexer .NewCollectionExecutedMetricImpl (
681
681
suite .log ,
@@ -864,7 +864,7 @@ func (suite *Suite) TestGetTransactionResult() {
864
864
})
865
865
require .NoError (suite .T (), err )
866
866
867
- handler := access .NewHandler (bnd , suite .chainID .Chain (), suite .finalizedHeaderCache , suite .me , subscription .DefaultMaxGlobalStreams )
867
+ handler := rpc .NewHandler (bnd , suite .chainID .Chain (), suite .finalizedHeaderCache , suite .me , subscription .DefaultMaxGlobalStreams )
868
868
869
869
collectionExecutedMetric , err := indexer .NewCollectionExecutedMetricImpl (
870
870
suite .log ,
@@ -1106,7 +1106,7 @@ func (suite *Suite) TestExecuteScript() {
1106
1106
})
1107
1107
require .NoError (suite .T (), err )
1108
1108
1109
- handler := access .NewHandler (suite .backend , suite .chainID .Chain (), suite .finalizedHeaderCache , suite .me , subscription .DefaultMaxGlobalStreams )
1109
+ handler := rpc .NewHandler (suite .backend , suite .chainID .Chain (), suite .finalizedHeaderCache , suite .me , subscription .DefaultMaxGlobalStreams )
1110
1110
1111
1111
// initialize metrics related storage
1112
1112
metrics := metrics .NewNoopCollector ()
@@ -1173,7 +1173,7 @@ func (suite *Suite) TestExecuteScript() {
1173
1173
require .NoError (suite .T (), err )
1174
1174
err = db .Update (operation .IndexBlockHeight (lastBlock .Header .Height , lastBlock .ID ()))
1175
1175
require .NoError (suite .T (), err )
1176
- //update latest sealed block
1176
+ // update latest sealed block
1177
1177
suite .sealedBlock = lastBlock .Header
1178
1178
// create execution receipts for each of the execution node and the last block
1179
1179
executionReceipts := unittest .ReceiptsForBlockFixture (lastBlock , identities .NodeIDs ())
@@ -1281,7 +1281,7 @@ func (suite *Suite) TestExecuteScript() {
1281
1281
// TestAPICallNodeVersionInfo tests the GetNodeVersionInfo query and check response returns correct node version
1282
1282
// information
1283
1283
func (suite * Suite ) TestAPICallNodeVersionInfo () {
1284
- suite .RunTest (func (handler * access .Handler , db * badger.DB , all * storage.All ) {
1284
+ suite .RunTest (func (handler * rpc .Handler , db * badger.DB , all * storage.All ) {
1285
1285
req := & accessproto.GetNodeVersionInfoRequest {}
1286
1286
resp , err := handler .GetNodeVersionInfo (context .Background (), req )
1287
1287
require .NoError (suite .T (), err )
@@ -1302,7 +1302,7 @@ func (suite *Suite) TestAPICallNodeVersionInfo() {
1302
1302
// field in the response matches the finalized header from cache. It also tests that the LastFinalizedBlock field is
1303
1303
// updated correctly when a block with a greater height is finalized.
1304
1304
func (suite * Suite ) TestLastFinalizedBlockHeightResult () {
1305
- suite .RunTest (func (handler * access .Handler , db * badger.DB , all * storage.All ) {
1305
+ suite .RunTest (func (handler * rpc .Handler , db * badger.DB , all * storage.All ) {
1306
1306
block := unittest .BlockWithParentFixture (suite .finalizedBlock )
1307
1307
newFinalizedBlock := unittest .BlockWithParentFixture (block .Header )
1308
1308
0 commit comments