Fixed validation

This commit is contained in:
uxname committed 2024-08-06 14:00:40 +03:00
1 parent 0993ebe621
commit a9364c4553
2 files changed
+6 -1

No files matched your search

@@ -3,8 +3,9 @@
"ticker": "test_symbol", "ticker": "test_symbol",
"title": "Test Token", "title": "Test Token",
"iconFileName": "0xe19413dc5cca43fcd61b696d99c2cd45cfa9a6cb7d2913e37908ce5ca3fa4e13.png", "iconFileName": "0xe19413dc5cca43fcd61b696d99c2cd45cfa9a6cb7d2913e37908ce5ca3fa4e13.png",
"infoURL": "https://vara.network",
"contractAddress": "0xe19413dc5cca43fcd61b696d99c2cd45cfa9a6cb7d2913e37908ce5ca3fa4e13", "contractAddress": "0xe19413dc5cca43fcd61b696d99c2cd45cfa9a6cb7d2913e37908ce5ca3fa4e13",
"type": "fungible", "type": "fungible",
"decimals": 12 "decimals": 12
} }
+4
View File
@@ -14,6 +14,10 @@ const dataDirectoryPath = path.resolve(process.cwd(), 'data');
const iconsDirectoryPath = path.resolve(dataDirectoryPath, 'icons'); const iconsDirectoryPath = path.resolve(dataDirectoryPath, 'icons');
async function validateJsonFile(filePath, iconUsage) { async function validateJsonFile(filePath, iconUsage) {
// exclude file "list.json"
if (path.basename(filePath) === 'list.json') {
return;
}
const data = JSON.parse(fs.readFileSync(filePath, 'utf8')); const data = JSON.parse(fs.readFileSync(filePath, 'utf8'));
const valid = validate(data); const valid = validate(data);
if (valid) { if (valid) {