Disallow leading zeroes in file names (#1680)

* Disallow leading zeroes in file names

* Remove Factory 127 testnet in favor of Lycan chain
This commit is contained in:
Frederik Bolding 2022-10-01 14:10:05 +02:00 committed by GitHub
parent 30fe54fdf6
commit 313b649b2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 32 deletions

View File

@ -1,23 +0,0 @@
{
"name": "Lycan Chain",
"chain": "LYC",
"rpc": ["https://rpc.lycanchain.com/"],
"faucets": [],
"nativeCurrency": {
"name": "Lycan",
"symbol": "LYC",
"decimals": 18
},
"infoURL": "https://lycanchain.com",
"shortName": "LYC",
"chainId": 721,
"networkId": 721,
"icon": "lycanchain",
"explorers": [
{
"name": "blockscout",
"url": "https://explorer.lycanchain.com",
"standard": "EIP3091"
}
]
}

View File

@ -1,16 +1,23 @@
{ {
"name": "Factory 127 Testnet", "name": "Lycan Chain",
"chain": "FETH", "chain": "LYC",
"rpc": [], "rpc": ["https://rpc.lycanchain.com/"],
"faucets": [], "faucets": [],
"nativeCurrency": { "nativeCurrency": {
"name": "Factory 127 Token", "name": "Lycan",
"symbol": "FETH", "symbol": "LYC",
"decimals": 18 "decimals": 18
}, },
"infoURL": "https://www.factory127.com", "infoURL": "https://lycanchain.com",
"shortName": "tfeth", "shortName": "LYC",
"chainId": 721, "chainId": 721,
"networkId": 721, "networkId": 721,
"slip44": 721 "icon": "lycanchain",
"explorers": [
{
"name": "blockscout",
"url": "https://explorer.lycanchain.com",
"standard": "EIP3091"
}
]
} }

View File

@ -10,7 +10,11 @@ for(const chainFile of chainFiles){
const fileData = fs.readFileSync(fileLocation,'utf8') const fileData = fs.readFileSync(fileLocation,'utf8')
const fileDataJson = JSON.parse(fileData) const fileDataJson = JSON.parse(fileData)
const chainIdFromFileName = chainFile.match(/eip155-(\d+)\.json/)[1] const chainIdFromFileName = chainFile.match(/eip155-(\d+)\.json/)[1]
if(chainIdFromFileName != fileDataJson.chainId){ const parsedChainId = parseInt(chainIdFromFileName, 10);
if(chainIdFromFileName != parsedChainId.toString()){
throw new Error(`File name does not match parsed ChainID ${parsedChainId} in ${chainFile}`)
}
if(parsedChainId !== fileDataJson.chainId){
throw new Error(`File Name does not match with ChainID in ${chainFile}`) throw new Error(`File Name does not match with ChainID in ${chainFile}`)
} }
const valid = ajv.validate(schema, fileDataJson) const valid = ajv.validate(schema, fileDataJson)