Skip to content

Commit 75cc798

Browse files
authored
Allow override on cfbenchmarks2 (#3528)
* Allow cfb2 override * Update comments
1 parent 4a3e99f commit 75cc798

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-1
lines changed

.changeset/four-rocks-deliver.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@chainlink/cfbenchmarks-adapter': minor
3+
---
4+
5+
Seperate cfb with cfb2

packages/scripts/src/get-changed-adapters/soakTestBlacklist.ts

+2
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,6 @@ export const SoakTestBlacklist: string[] = [
8888
'blockchain.com', // Does not support . in the name
8989
'cache.gold',
9090
'ion.au',
91+
'galaxy', // Not deployed internally
92+
'stader-balance', // Not deployed internally
9193
]

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

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export const inputParameters = new InputParameters(
3030
description: 'The symbol of the currency to convert to',
3131
required: false,
3232
},
33+
adapterNameOverride: {
34+
type: 'string',
35+
description: 'Used internally for override and metrics, do not set this field',
36+
required: false,
37+
},
3338
},
3439
[
3540
{

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

+5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ const overridenBaseQuoteFromId: BaseQuoteToIdLookup = {
1818

1919
export function customInputValidation(
2020
req: AdapterRequest<typeof inputParameters.validated>,
21+
adapterSettings: BaseEndpointTypes['Settings'],
2122
): AdapterError | undefined {
23+
if (adapterSettings.API_SECONDARY) {
24+
req.requestContext.data.adapterNameOverride = 'cfbenchmarks2'
25+
}
26+
2227
const { base, quote, index } = req.requestContext.data
2328
// Base and quote must be provided OR index must be provided
2429
if (!(index || (base && quote))) {

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ export const makeWsTransport = (
4848
const value = Number(message.value)
4949
return [
5050
{
51-
params: { index, base: undefined, quote: undefined },
51+
params: {
52+
index,
53+
base: undefined,
54+
quote: undefined,
55+
...(type != 'primary' && { adapterNameOverride: 'cfbenchmarks2' }),
56+
},
5257
response: {
5358
result: value,
5459
data: {

0 commit comments

Comments
 (0)