fix linting for remix-core-plugin

pull/5370/head
lianahus 7 months ago
parent a94189bf65
commit b6d7ddbd58
  1. 10
      libs/remix-core-plugin/src/lib/compiler-artefacts.ts
  2. 4
      libs/remix-core-plugin/src/lib/compiler-metadata.ts
  3. 1
      libs/remix-core-plugin/src/lib/constants/uups.ts
  4. 2
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts

@ -127,7 +127,7 @@ export class CompilerArtefacts extends Plugin {
_getAllContractArtefactsfromOutput (compilerOutput, contractName) {
const contractArtefacts = {}
for (const filename in compilerOutput) {
if(Object.keys(compilerOutput[filename]).includes(contractName)) contractArtefacts[filename + ':' + contractName] = compilerOutput[filename][contractName]
if (Object.keys(compilerOutput[filename]).includes(contractName)) contractArtefacts[filename + ':' + contractName] = compilerOutput[filename][contractName]
}
return contractArtefacts
}
@ -141,10 +141,10 @@ export class CompilerArtefacts extends Plugin {
*/
async _populateAllContractArtefactsFromFE (path, contractName, contractArtefacts) {
const dirList = await this.call('fileManager', 'dirList', path)
if(dirList && dirList.length) {
if (dirList && dirList.length) {
for (const dirPath of dirList) {
// check if directory contains an 'artifacts' folder and a 'build-info' folder inside 'artifacts'
if(dirPath === path + '/artifacts' && await this.call('fileManager', 'exists', dirPath + '/build-info')) {
if (dirPath === path + '/artifacts' && await this.call('fileManager', 'exists', dirPath + '/build-info')) {
const buildFileList = await this.call('fileManager', 'fileList', dirPath + '/build-info')
// process each build-info file to populate the artefacts for contractName
for (const buildFile of buildFileList) {
@ -173,12 +173,12 @@ export class CompilerArtefacts extends Plugin {
const nameArr = fullyQualifiedName.split(':')
const filename = nameArr[0]
const contract = nameArr[1]
if(Object.keys(contractsDataByFilename).includes(filename) && contractsDataByFilename[filename][contract])
if (Object.keys(contractsDataByFilename).includes(filename) && contractsDataByFilename[filename][contract])
return contractsDataByFilename[filename][contract]
else {
const allContractsData = {}
await this._populateAllContractArtefactsFromFE ('contracts', contract, allContractsData)
if(allContractsData[fullyQualifiedName]) return { fullyQualifiedName, artefact: allContractsData[fullyQualifiedName]}
if (allContractsData[fullyQualifiedName]) return { fullyQualifiedName, artefact: allContractsData[fullyQualifiedName] }
else throw new Error(`Could not find artifacts for ${fullyQualifiedName}. Compile contract to generate artifacts.`)
}
} else {

@ -85,12 +85,12 @@ export class CompilerMetadata extends Plugin {
// Check the existing build-info and delete all the previous build files for compiled file
await this.removeStoredBuildInfo(input, path, filePath)
this.buildInfoNames[filePath] = buildFilename
const buildData = {id, _format: format, solcVersion, solcLongVersion, input, output}
const buildData = { id, _format: format, solcVersion, solcLongVersion, input, output }
await this.call('fileManager', 'writeFile', buildFilename, JSON.stringify(buildData, null, '\t'))
} else if (this.buildInfoNames[filePath] && this.buildInfoNames[filePath] !== buildFilename) {
await this.call('fileManager', 'remove', this.buildInfoNames[filePath])
this.buildInfoNames[filePath] = buildFilename
const buildData = {id, _format: format, solcVersion, solcLongVersion, input, output}
const buildData = { id, _format: format, solcVersion, solcLongVersion, input, output }
await this.call('fileManager', 'writeFile', buildFilename, JSON.stringify(buildData, null, '\t'))
}
}

@ -140,7 +140,6 @@ export const UUPSupgradeAbi = {
"type": "function"
}
export const UUPSupgradeToAndCallAbi = {
"inputs": [
{

@ -109,7 +109,7 @@ export class OpenZeppelinProxy extends Plugin {
data.dataHex = UUPSBytecode + constructorData.replace('0x', '')
data.funAbi = UUPSfunAbi
this.call('terminal', 'logHtml', `Deploying ERC1967 < 5.0.0 as proxy...`)
}else{
} else {
this.call('terminal', 'logHtml', `Deploying ERC1967 >= 5.0.0 as proxy...`)
}
// re-use implementation contract's ABI for UI display in udapp and change name to proxy name.

Loading…
Cancel
Save