Skip to content

Commit dddedf3

Browse files
authored
DF-21712 Remove birc endpoint from cfbenchmarks (#4096)
1 parent cd239ab commit dddedf3

File tree

11 files changed

+12
-333
lines changed

11 files changed

+12
-333
lines changed
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 unused birc endpoint from cfbenchmarks

packages/sources/cfbenchmarks/README.md

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ There are no rate limits for this adapter.
2626

2727
## Input Parameters
2828

29-
| Required? | Name | Description | Type | Options | Default |
30-
| :-------: | :------: | :-----------------: | :----: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------: |
31-
| | endpoint | The endpoint to use | string | [birc](#birc-endpoint), [crypto-lwba](#crypto-lwba-endpoint), [crypto](#crypto-endpoint), [crypto_lwba](#crypto-lwba-endpoint), [cryptolwba](#crypto-lwba-endpoint), [price](#crypto-endpoint), [values](#crypto-endpoint) | `crypto` |
29+
| Required? | Name | Description | Type | Options | Default |
30+
| :-------: | :------: | :-----------------: | :----: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------: |
31+
| | endpoint | The endpoint to use | string | [crypto-lwba](#crypto-lwba-endpoint), [crypto](#crypto-endpoint), [crypto_lwba](#crypto-lwba-endpoint), [cryptolwba](#crypto-lwba-endpoint), [price](#crypto-endpoint), [values](#crypto-endpoint) | `crypto` |
3232

3333
## Crypto Endpoint
3434

@@ -59,31 +59,6 @@ Request:
5959

6060
---
6161

62-
## Birc Endpoint
63-
64-
`birc` is the only supported name for this endpoint.
65-
66-
### Input Params
67-
68-
| Required? | Name | Aliases | Description | Type | Options | Default | Depends On | Not Valid With |
69-
| :-------: | :---: | :-----: | :-------------------------------------------: | :----: | :----------------------------------------------------: | :-----: | :--------: | :------------: |
70-
|| tenor | | The tenor value to pull from the API response | string | `1M`, `1W`, `2M`, `2W`, `3M`, `3W`, `4M`, `5M`, `SIRB` | | | |
71-
72-
### Example
73-
74-
Request:
75-
76-
```json
77-
{
78-
"data": {
79-
"endpoint": "birc",
80-
"tenor": "SIRB"
81-
}
82-
}
83-
```
84-
85-
---
86-
8762
## Crypto-lwba Endpoint
8863

8964
Supported names for this endpoint are: `crypto-lwba`, `crypto_lwba`, `cryptolwba`.

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

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export { endpoint as crypto } from './crypto'
2-
export { endpoint as birc } from './birc'
32
export { endpoint as cryptolwba } from './crypto-lwba'

packages/sources/cfbenchmarks/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { expose, ServerInstance } from '@chainlink/external-adapter-framework'
22
import { PriceAdapter } from '@chainlink/external-adapter-framework/adapter'
33
import { config } from './config'
4-
import { birc, crypto, cryptolwba } from './endpoint'
4+
import { crypto, cryptolwba } from './endpoint'
55

66
export const adapter = new PriceAdapter({
77
name: 'CFBENCHMARKS',
8-
endpoints: [crypto, birc, cryptolwba],
8+
endpoints: [crypto, cryptolwba],
99
defaultEndpoint: crypto.name,
1010
config,
1111
})

packages/sources/cfbenchmarks/src/transport/birc.ts

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

packages/sources/cfbenchmarks/src/transport/utils.ts

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

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`execute birc endpoint should return success 1`] = `
4-
{
5-
"data": {
6-
"result": 0.0947,
7-
},
8-
"result": 0.0947,
9-
"statusCode": 200,
10-
"timestamps": {
11-
"providerDataReceivedUnixMs": 1641035471111,
12-
"providerDataRequestedUnixMs": 1641035471111,
13-
"providerIndicatedTimeUnixMs": 1677226637446,
14-
},
15-
}
16-
`;
17-
183
exports[`execute crypto endpoint should return success 1`] = `
194
{
205
"data": {

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { mockBircResponseSuccess, mockResponseSuccess } from './fixtures'
21
import {
32
TestAdapter,
43
setEnvVariables,
54
} from '@chainlink/external-adapter-framework/util/testing-utils'
65
import * as nock from 'nock'
6+
import { mockResponseSuccess } from './fixtures'
77

88
describe('execute', () => {
99
let spy: jest.SpyInstance
@@ -32,19 +32,6 @@ describe('execute', () => {
3232
spy.mockRestore()
3333
})
3434

35-
describe('birc endpoint', () => {
36-
it('should return success', async () => {
37-
const data = {
38-
endpoint: 'birc',
39-
tenor: 'SIRB',
40-
}
41-
mockBircResponseSuccess()
42-
const response = await testAdapter.request(data)
43-
expect(response.statusCode).toBe(200)
44-
expect(response.json()).toMatchSnapshot()
45-
})
46-
})
47-
4835
describe('crypto endpoint', () => {
4936
it('should return success', async () => {
5037
const data = {

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

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import nock from 'nock'
21
import { MockWebsocketServer } from '@chainlink/external-adapter-framework/util/testing-utils'
2+
import nock from 'nock'
33

44
export const mockResponseSuccess = (): nock.Scope =>
55
nock('https://www.cfbenchmarks.com/api')
@@ -13,47 +13,6 @@ export const mockResponseSuccess = (): nock.Scope =>
1313
})
1414
.persist()
1515

16-
export const mockBircResponseSuccess = (): nock.Scope => {
17-
const currentDayIsoString = new Date().toISOString()
18-
const currentDayTimestampMs = new Date(currentDayIsoString).getTime()
19-
return nock('https://www.cfbenchmarks.com/api')
20-
.get('/v1/curves?id=BIRC')
21-
.reply(200, {
22-
serverTime: '2023-02-24T08:17:17.446Z',
23-
payload: [
24-
{
25-
tenors: {
26-
SIRB: '0.0986',
27-
'1W': '0.0077',
28-
'2W': '0.0186',
29-
'3W': '0.0219',
30-
'1M': '0.0168',
31-
'2M': '0.0099',
32-
'3M': '0.0097',
33-
'4M': '0.0078',
34-
'5M': '0.0059',
35-
},
36-
time: currentDayTimestampMs,
37-
},
38-
{
39-
tenors: {
40-
SIRB: '0.0947',
41-
'1W': '0.0367',
42-
'2W': '0.0185',
43-
'3W': '0.0229',
44-
'1M': '0.0274',
45-
'2M': '0.0297',
46-
'3M': '0.0275',
47-
'4M': '0.0253',
48-
'5M': '0.0000',
49-
},
50-
time: currentDayTimestampMs,
51-
},
52-
],
53-
})
54-
.persist()
55-
}
56-
5716
export const mockWebSocketServer = (URL: string): MockWebsocketServer => {
5817
const mockWsServer = new MockWebsocketServer(URL, { mock: false })
5918
mockWsServer.on('connection', (socket) => {

0 commit comments

Comments
 (0)