fix: linting issues on contracts folder (#212)

This commit is contained in:
Felipe Mendes 2023-04-17 11:27:39 -03:00 committed by GitHub
parent a571dabe6c
commit fdedc18b02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 26 additions and 25 deletions

View File

@ -21,7 +21,6 @@ const {
ETH_MAIN_API_URL,
ETH_SEPOLIA_API_URL,
ETH_GOERLI_API_URL,
POLYGONSCAN_KEY,
MAINNET_API_KEY,
COINMARKETCAP_KEY,
} = process.env;
@ -39,22 +38,22 @@ const config: HardhatUserConfig = {
: undefined,
},
mumbai: {
url: POLYGON_API_URL ? POLYGON_API_URL : "",
url: POLYGON_API_URL ? POLYGON_API_URL : '',
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
chainId: 80001,
},
goerli: {
url: ETH_GOERLI_API_URL ? ETH_GOERLI_API_URL : "",
url: ETH_GOERLI_API_URL ? ETH_GOERLI_API_URL : '',
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
chainId: 5,
},
sepolia: {
url: ETH_SEPOLIA_API_URL ? ETH_SEPOLIA_API_URL : "",
url: ETH_SEPOLIA_API_URL ? ETH_SEPOLIA_API_URL : '',
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
chainId: 11155111,
},
mainnet: {
url: ETH_MAIN_API_URL ? ETH_MAIN_API_URL : "",
url: ETH_MAIN_API_URL ? ETH_MAIN_API_URL : '',
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
chainId: 1,
},
@ -90,7 +89,7 @@ const config: HardhatUserConfig = {
// apiKey: {
// polygonMumbai: POLYGONSCAN_KEY,
// },
apiKey: ETHERSCAN_API_KEY ? ETHERSCAN_API_KEY : "",
apiKey: ETHERSCAN_API_KEY ? ETHERSCAN_API_KEY : '',
},
};

View File

@ -44,7 +44,7 @@ module.exports = async (taskArgs, hre) => {
console.log(taskArgs);
console.log();
const arguments = [name, symbol, billing];
const deployArguments = [name, symbol, billing];
const libraries = await libraryDeployment(hre);
@ -80,7 +80,7 @@ module.exports = async (taskArgs, hre) => {
console.log('Creating new proxy contract...');
deployResult = await upgrades.deployProxy(
Contract,
arguments,
deployArguments,
DEFAULT_PROXY_SETTINGS
);
await deployResult.deployed();

View File

@ -1,4 +1,3 @@
const { ethers } = require('hardhat');
require('@nomiclabs/hardhat-etherscan');
const networkName = hre.network.name;

View File

@ -1,7 +1,5 @@
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { expect } from 'chai';
import { ethers } from 'hardhat';
import { TestConstants, Fixtures, Errors } from '../helpers';
const { AccessPointStatus } = TestConstants;
@ -19,7 +17,7 @@ describe('FleekERC721.AccessPoints.AutoApprovalOff', () => {
.to.emit(contract, 'NewAccessPoint')
.withArgs('accesspoint.com', tokenId, owner.address);
let ap = await contract.getAccessPointJSON('accesspoint.com');
const ap = await contract.getAccessPointJSON('accesspoint.com');
const parsedAp = JSON.parse(ap);
expect(parsedAp).to.eql({

View File

@ -42,7 +42,7 @@ describe('FleekERC721.AccessPoints.AutoApprovalOn', () => {
});
it('should revert if AP does not exist', async () => {
const { contract, tokenId } = fixture;
const { contract } = fixture;
await expect(
contract.getAccessPointJSON('random.com')
@ -88,7 +88,7 @@ describe('FleekERC721.AccessPoints.AutoApprovalOn', () => {
});
it('should allow anyone to change AP score', async () => {
const { contract, otherAccount, tokenId } = fixture;
const { contract, otherAccount } = fixture;
await contract.increaseAccessPointScore(DefaultAP);
await contract.connect(otherAccount).increaseAccessPointScore(DefaultAP);

View File

@ -2,6 +2,7 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
import { ethers } from 'hardhat';
import { expect } from 'chai';
import { Fixtures, TestConstants, Errors } from './helpers';
import { BigNumber } from 'ethers';
const { Billing, MintParams } = TestConstants;
@ -10,7 +11,7 @@ describe('FleekERC721.Billing', () => {
const mintPrice = ethers.utils.parseEther('1');
const addAPPrice = ethers.utils.parseEther('1');
const mint = (value?: any) => {
const mint = (value?: BigNumber) => {
const { contract, owner } = fixture;
return contract.mint(
owner.address,
@ -28,7 +29,7 @@ describe('FleekERC721.Billing', () => {
);
};
const addAP = (value?: any) => {
const addAP = (value?: BigNumber) => {
const { contract } = fixture;
return contract.addAccessPoint(0, 'random.com', { value });
};

View File

@ -56,7 +56,7 @@ describe('FleekERC721.CollectionRoles', () => {
});
it('should fetch the list of owners', async () => {
const { owner, contract, otherAccount } = fixture;
const { contract, otherAccount } = fixture;
await contract.grantCollectionRole(
CollectionRoles.Owner,

View File

@ -1,6 +1,6 @@
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
import { expect } from 'chai';
import { TestConstants, Fixtures, parseTokenURI } from './helpers';
import { TestConstants, Fixtures } from './helpers';
import { ethers } from 'hardhat';
const { MintParams } = TestConstants;

View File

@ -1,6 +1,5 @@
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { ethers, upgrades } from 'hardhat';
import { TestConstants } from './constants';
import { ethers } from 'hardhat';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const namehash = require('@ensdomains/eth-ens-namehash');

View File

@ -2,7 +2,7 @@ import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
import { expect } from 'chai';
import { TestConstants, Fixtures, Errors } from './helpers';
const { MintParams, CollectionRoles, TokenRoles } = TestConstants;
const { MintParams, CollectionRoles } = TestConstants;
describe('FleekERC721.Pausable', () => {
let fixture: Awaited<ReturnType<typeof Fixtures.default>>;

View File

@ -1,6 +1,6 @@
import { loadFixture } from '@nomicfoundation/hardhat-network-helpers';
import { expect } from 'chai';
import { TestConstants, Fixtures, parseTokenURI, Errors } from './helpers';
import { TestConstants, Fixtures, Errors } from './helpers';
const { TokenRoles } = TestConstants;
@ -25,7 +25,7 @@ describe('FleekERC721.TokenRoles', () => {
});
it('should add a new controller', async () => {
const { contract, owner, otherAccount, tokenId } = fixture;
const { contract, otherAccount, tokenId } = fixture;
await contract.grantTokenRole(
tokenId,
TokenRoles.Controller,
@ -78,7 +78,7 @@ describe('FleekERC721.TokenRoles', () => {
});
it('should remove an added controller', async () => {
const { contract, owner, otherAccount, tokenId } = fixture;
const { contract, otherAccount, tokenId } = fixture;
await contract.grantTokenRole(
tokenId,
TokenRoles.Controller,
@ -134,7 +134,7 @@ describe('FleekERC721.TokenRoles', () => {
});
it('should not be able to remove address role', async () => {
const { contract, owner, otherAccount, tokenId } = fixture;
const { contract, otherAccount, tokenId } = fixture;
await expect(
contract

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import { expect } from 'chai';
import {
proxyStore,

View File

@ -1,4 +1,8 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"noEmit": true
},
"include": ["./**/*"]
}