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",
"chain": "FETH",
"rpc": [],
"name": "Lycan Chain",
"chain": "LYC",
"rpc": ["https://rpc.lycanchain.com/"],
"faucets": [],
"nativeCurrency": {
"name": "Factory 127 Token",
"symbol": "FETH",
"name": "Lycan",
"symbol": "LYC",
"decimals": 18
},
"infoURL": "https://www.factory127.com",
"shortName": "tfeth",
"infoURL": "https://lycanchain.com",
"shortName": "LYC",
"chainId": 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 fileDataJson = JSON.parse(fileData)
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}`)
}
const valid = ajv.validate(schema, fileDataJson)