MCPcopy Create free account
hub / github.com/ethstorage/es-node / createRemoteHost

Function createRemoteHost

ethstorage/p2p/protocol/sync_test.go:373–384  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, chainID *big.Int,
	storageManager *mockStorageManagerReader, db ethdb.Database, metrics SyncServerMetrics)

Source from the content-addressed store, hash-verified

371}
372
373func createRemoteHost(t *testing.T, ctx context.Context, chainID *big.Int,
374 storageManager *mockStorageManagerReader, db ethdb.Database, metrics SyncServerMetrics) host.Host {
375
376 remoteHost := getNetHost(t)
377 syncSrv := NewSyncServer(storageManager, db, metrics, lg)
378 blobByRangeHandler := MakeStreamHandler(ctx, lg, syncSrv.HandleGetBlobsByRangeRequest)
379 remoteHost.SetStreamHandler(GetProtocolID(RequestBlobsByRangeProtocolID, chainID), blobByRangeHandler)
380 blobByListHandler := MakeStreamHandler(ctx, lg, syncSrv.HandleGetBlobsByListRequest)
381 remoteHost.SetStreamHandler(GetProtocolID(RequestBlobsByListProtocolID, chainID), blobByListHandler)
382
383 return remoteHost
384}
385
386func checkStall(t *testing.T, waitTime time.Duration, mux *event.Feed, cancel func()) {
387 dlEventCh := make(chan EthStorageSyncDone, 16)

Callers 5

TestSync_RequestL2RangeFunction · 0.85
TestSync_RequestL2ListFunction · 0.85
testSyncFunction · 0.85
TestAddPeerDuringSyncingFunction · 0.85
TestAddPeerAfterSyncDoneFunction · 0.85

Calls 4

getNetHostFunction · 0.85
NewSyncServerFunction · 0.85
MakeStreamHandlerFunction · 0.85
GetProtocolIDFunction · 0.85

Tested by

no test coverage detected