mirror of
https://github.com/alexgo-io/DefiLlama-Adapters.git
synced 2026-04-30 05:45:32 +08:00
Add hallmarks tests
This commit is contained in:
14
test.js
14
test.js
@@ -260,6 +260,20 @@ function checkExportKeys(module, filePath, chains) {
|
||||
exportKeys = Object.keys(exportKeys.reduce((agg, key) => ({...agg, [key]: 1}), {})) // get unique keys
|
||||
const unknownKeys = exportKeys.filter(key => !whitelistedExportKeys.includes(key))
|
||||
|
||||
const hallmarks = module.hallmarks || [];
|
||||
|
||||
if (hallmarks.length) {
|
||||
const TIMESTAMP_LENGTH = 10;
|
||||
hallmarks.forEach(([timestamp, text]) => {
|
||||
const strTimestamp = String(timestamp)
|
||||
if (strTimestamp.length !== TIMESTAMP_LENGTH){
|
||||
throw new Error(`
|
||||
Incorrect time format for the hallmark: [${strTimestamp}, ${text}] ,please use unix timestamp
|
||||
`)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (unknownChains.length) {
|
||||
throw new Error(`
|
||||
|
||||
Reference in New Issue
Block a user