Skip to content

Commit a77b4f8

Browse files
authored
DF-21713 Remove unused rest transport for cfbenchmarks (#4102)
1 parent dddedf3 commit a77b4f8

File tree

6 files changed

+6
-172
lines changed

6 files changed

+6
-172
lines changed

.changeset/lemon-badgers-flash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@chainlink/cfbenchmarks-adapter': minor
3+
---
4+
5+
Remove rest endpoint from cfbenchmarks since it's unused.

packages/sources/cfbenchmarks/src/endpoint/crypto.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import { TransportRoutes } from '@chainlink/external-adapter-framework/transport
33
import { SingleNumberResultResponse } from '@chainlink/external-adapter-framework/util'
44
import { InputParameters } from '@chainlink/external-adapter-framework/validation/input-params'
55
import { config } from '../config'
6-
import { customInputValidation } from './utils'
7-
import { makeRestTransport } from '../transport/crypto-http'
86
import { makeWsTransport } from '../transport/crypto-ws'
9-
import { requestTransform } from './utils'
7+
import { customInputValidation, requestTransform } from './utils'
108

119
export type Params = { index?: string; base?: string; quote?: string }
1210
export type RequestParams = { Params: Params }
@@ -58,14 +56,11 @@ export const endpoint = new CryptoPriceEndpoint({
5856
inputParameters,
5957
requestTransforms,
6058
transportRoutes: new TransportRoutes<BaseEndpointTypes>()
61-
.register('rest', makeRestTransport('primary'))
62-
.register('restsecondary', makeRestTransport('secondary'))
6359
.register('ws', makeWsTransport('primary'))
6460
.register('wssecondary', makeWsTransport('secondary')),
6561
defaultTransport: 'ws',
6662
customRouter: (req, adapterConfig) => {
6763
if (adapterConfig.API_SECONDARY) {
68-
if (req.requestContext.transportName === 'rest') return 'restsecondary'
6964
return 'wssecondary'
7065
} else {
7166
return req.requestContext.transportName

packages/sources/cfbenchmarks/src/transport/crypto-http.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

packages/sources/cfbenchmarks/test/integration/__snapshots__/adapter.test.ts.snap

Lines changed: 0 additions & 31 deletions
This file was deleted.

packages/sources/cfbenchmarks/test/integration/adapter.test.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

packages/sources/cfbenchmarks/test/integration/fixtures.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
import { MockWebsocketServer } from '@chainlink/external-adapter-framework/util/testing-utils'
2-
import nock from 'nock'
3-
4-
export const mockResponseSuccess = (): nock.Scope =>
5-
nock('https://www.cfbenchmarks.com/api')
6-
.get('/v1/values?id=BRTI')
7-
.reply(200, {
8-
serverTime: '2022-02-18T16:53:55.772Z',
9-
payload: [
10-
{ value: '39829.42', time: 1645199636000 },
11-
{ value: '39829.30', time: 1645199637000 },
12-
],
13-
})
14-
.persist()
152

163
export const mockWebSocketServer = (URL: string): MockWebsocketServer => {
174
const mockWsServer = new MockWebsocketServer(URL, { mock: false })

0 commit comments

Comments
 (0)