Fixed validation
This commit is contained in:
1 parent
0993ebe621
commit
a9364c4553
2 files changed
+5
No files matched your search
@@ -3,6 +3,7 @@
|
|||||||
"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
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in new issue
Block a user