-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create update data feed loop * Small implementation changes, add tests * Fix lint * Fix tests and update configs * Add documentation * Update test configuration * Make deviationThresholdCoefficient optional * Rename startUpdateFeedsLoops * Fix tests, remove unnecessary flag
- Loading branch information
Showing
18 changed files
with
405 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
const config = require('./jest.config'); | ||
const { join } = require('node:path'); | ||
|
||
/** | ||
* For a detailed explanation regarding each configuration property and type check, visit: | ||
* https://jestjs.io/docs/configuration | ||
* @type {import('jest').Config} | ||
*/ | ||
module.exports = { | ||
...config, | ||
displayName: 'e2e', | ||
collectCoverage: false, // It doesn't make sense to collect coverage for e2e tests because they target high level features and interaction with other services. | ||
maxWorkers: 1, // We don't want to run tests in parallel because they might interfere with each other. This option is the same as --runInBand. See: https://stackoverflow.com/a/46489246. | ||
|
||
preset: 'ts-jest', | ||
restoreMocks: true, | ||
setupFiles: [join(__dirname, './jest.setup.js')], | ||
testEnvironment: 'jest-environment-node', | ||
testMatch: ['**/?(*.)+(feature).[t]s?(x)'], | ||
testPathIgnorePatterns: ['<rootDir>/.build', '<rootDir>/dist/', '<rootDir>/build/'], | ||
verbose: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
const config = require('./jest.config'); | ||
const { join } = require('node:path'); | ||
|
||
/** | ||
* For a detailed explanation regarding each configuration property and type check, visit: | ||
* https://jestjs.io/docs/configuration | ||
* @type {import('jest').Config} | ||
*/ | ||
module.exports = { | ||
...config, | ||
displayName: 'unit', | ||
collectCoverage: true, | ||
coverageDirectory: 'coverage', | ||
coveragePathIgnorePatterns: ['node_modules', '<rootDir>/typechain-types'], // Coverage is collected for all files imported by the tests. We want to exclude files generated by Typechain. | ||
coverageProvider: 'v8', | ||
|
||
preset: 'ts-jest', | ||
restoreMocks: true, | ||
setupFiles: [join(__dirname, './jest.setup.js')], | ||
testEnvironment: 'jest-environment-node', | ||
testMatch: ['**/?(*.)+(spec|test).[t]s?(x)'], | ||
testPathIgnorePatterns: ['<rootDir>/.build', '<rootDir>/dist/', '<rootDir>/build/'], | ||
verbose: true, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './update-feeds'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// NOTE: The function is currently returning static data, because the contract is not yet finalized, but we mark it as | ||
// async in advance. | ||
// | ||
// eslint-disable-next-line @typescript-eslint/require-await | ||
export const getStaticActiveDapis = async (_offset: number, _limit: number) => { | ||
return { | ||
totalCount: 1, | ||
dapiNames: ['MOCK_FEED'], | ||
dataFeedIds: ['0xebba8507d616ed80766292d200a3598fdba656d9938cecc392765d4a284a69a4'], | ||
updateParameters: [{ deviationThresholdInPercentage: 0.5, deviationReference: 0.5, heartbeatInterval: 100 }], | ||
// NOTE: We will need to decode this from the contract, because it will store the template IDs as encoded bytes. | ||
dataFeedTemplateIds: [['0xcc35bd1800c06c12856a87311dd95bfcbb3add875844021d59a929d79f3c99bd']], | ||
signedApiUrls: [['http://localhost:8080']], | ||
airnodeAddresses: ['0xbF3137b0a7574563a23a8fC8badC6537F98197CC'], | ||
}; | ||
}; | ||
|
||
export type ActiveDapisBatch = Awaited<ReturnType<typeof getStaticActiveDapis>>; |
Oops, something went wrong.