Skip to content

Commit 228d91d

Browse files
authored
fix: config.json files and add template config test (#1998)
1 parent 9261e5b commit 228d91d

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

.changeset/young-seahorses-crash.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@api3/airnode-validator": patch
3+
"@api3/airnode-deployer": patch
4+
---
5+
6+
Fix deployer test config files and add an airnode-validator valid template test

packages/airnode-deployer/test/fixtures/config.aws.valid.json

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"heartbeat": {
4141
"enabled": true,
4242
"apiKey": "${HEARTBEAT_API_KEY}",
43-
"id": "${HEARTBEAT_ID}",
4443
"url": "${HEARTBEAT_URL}"
4544
},
4645
"httpGateway": {

packages/airnode-deployer/test/fixtures/config.gcp.valid.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
{
44
"maxConcurrency": 100,
55
"authorizers": {
6-
"requesterEndpointAuthorizers": []
6+
"requesterEndpointAuthorizers": [],
7+
"crossChainRequesterAuthorizers": [],
8+
"requesterAuthorizersWithErc721": [],
9+
"crossChainRequesterAuthorizersWithErc721": []
710
},
811
"authorizations": {
912
"requesterEndpointAuthorizations": {}
1013
},
1114
"contracts": {
1215
"AirnodeRrp": "0x534DfA0d242e7fDCFD096C2B1a3D70F172008778"
1316
},
14-
"id": "4",
17+
"id": "11155111",
1518
"providers": {
16-
"rinkeby": {
19+
"sepolia": {
1720
"url": "${PROVIDER_URL}"
1821
}
1922
},
@@ -37,7 +40,6 @@
3740
"heartbeat": {
3841
"enabled": true,
3942
"apiKey": "${HEARTBEAT_API_KEY}",
40-
"id": "${HEARTBEAT_ID}",
4143
"url": "${HEARTBEAT_URL}"
4244
},
4345
"httpGateway": {

packages/airnode-validator/src/config/config.test.ts

+17
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,23 @@ describe('templates', () => {
291291
])
292292
);
293293
});
294+
295+
it('allows a valid template', () => {
296+
const config = JSON.parse(
297+
readFileSync(join(__dirname, '../../test/fixtures/interpolated-config.valid.json')).toString()
298+
);
299+
config.nodeSettings.airnodeWalletMnemonic =
300+
'answer tobacco wave sausage age report congress cannon fever hammer happy budget';
301+
const validTemplates = [
302+
{
303+
templateId: '0x0058c1abb08d25f0c397673931eb30b94682f47a7d2509e6eebb92fc8b292a3c',
304+
endpointId: '0xfb87102cdabadf905321521ba0b3cbf74ad09c5d400ac2eccdbef8d6143e78c4',
305+
encodedParameters:
306+
'0x3173000000000000000000000000000000000000000000000000000000000000636f696e49640000000000000000000000000000000000000000000000000000657468657265756d000000000000000000000000000000000000000000000000',
307+
},
308+
];
309+
expect(() => configSchema.parse({ ...config, templates: validTemplates })).not.toThrow();
310+
});
294311
});
295312

296313
it('fails if a securitySchemeName is enabled and it is of type "apiKey" or "http" but is missing credentials in "apiCredentials"', () => {

0 commit comments

Comments
 (0)