Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth committed Nov 6, 2023
1 parent 561d231 commit d7f6b07
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
42 changes: 33 additions & 9 deletions test/AxelarGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,23 @@ describe('AxelarGateway', () => {
externalDecimals = 18;
externalCap = 0;

externalToken = await mintableCappedERC20Factory.deploy(externalTokenName, externalSymbol, externalDecimals, externalCap, getGasOptions(true));
externalToken = await mintableCappedERC20Factory.deploy(
externalTokenName,
externalSymbol,
externalDecimals,
externalCap,
getGasOptions(true),
);
await externalToken.deployTransaction.wait(network.config.confirmations);
});

const deployGateway = async (invalidDeployer = false) => {
const operatorAddresses = getAddresses(operators);

auth = await authFactory.deploy(getWeightedAuthDeployParam([operatorAddresses], [getWeights(operatorAddresses)], [threshold]), getGasOptions(true));
auth = await authFactory.deploy(
getWeightedAuthDeployParam([operatorAddresses], [getWeights(operatorAddresses)], [threshold]),
getGasOptions(true),
);
await auth.deployTransaction.wait(network.config.confirmations);

const gatewayImplementation = invalidDeployer
Expand Down Expand Up @@ -124,7 +133,10 @@ describe('AxelarGateway', () => {
const params = '0x00';
const operatorAddresses = getAddresses(operators);

auth = await authFactory.deploy(getWeightedAuthDeployParam([operatorAddresses], [getWeights(operatorAddresses)], [threshold]), getGasOptions(true));
auth = await authFactory.deploy(
getWeightedAuthDeployParam([operatorAddresses], [getWeights(operatorAddresses)], [threshold]),
getGasOptions(true),
);
await auth.deployTransaction.wait(network.config.confirmations);

const gatewayImplementation = await gatewayFactory.deploy(auth.address, auth.address, getGasOptions(true));
Expand Down Expand Up @@ -422,7 +434,9 @@ describe('AxelarGateway', () => {
});

it('should allow governance to upgrade to the correct implementation', async () => {
const newGatewayImplementation = await gatewayFactory.deploy(auth.address, tokenDeployer.address, getGasOptions(true)).then((d) => d.deployed());
const newGatewayImplementation = await gatewayFactory
.deploy(auth.address, tokenDeployer.address, getGasOptions(true))
.then((d) => d.deployed());
const newGatewayImplementationCodeHash = await getBytecodeHash(newGatewayImplementation, network.config.id);
const params = '0x';

Expand All @@ -443,7 +457,9 @@ describe('AxelarGateway', () => {
});

it('should allow governance to upgrade to the correct implementation with new governance and mint limiter', async () => {
const newGatewayImplementation = await gatewayFactory.deploy(auth.address, tokenDeployer.address, getGasOptions(true)).then((d) => d.deployed());
const newGatewayImplementation = await gatewayFactory
.deploy(auth.address, tokenDeployer.address, getGasOptions(true))
.then((d) => d.deployed());
const newGatewayImplementationCodeHash = await getBytecodeHash(newGatewayImplementation, network.config.id);
let params = '0x';

Expand Down Expand Up @@ -472,7 +488,9 @@ describe('AxelarGateway', () => {
});

it('should allow governance to upgrade to the correct implementation with new operators', async () => {
const newGatewayImplementation = await gatewayFactory.deploy(auth.address, tokenDeployer.address, getGasOptions(true)).then((d) => d.deployed());
const newGatewayImplementation = await gatewayFactory
.deploy(auth.address, tokenDeployer.address, getGasOptions(true))
.then((d) => d.deployed());
const newGatewayImplementationCodeHash = await getBytecodeHash(newGatewayImplementation, network.config.id);

const newOperatorAddresses = getAddresses(operators.slice(0, threshold - 1));
Expand Down Expand Up @@ -502,7 +520,9 @@ describe('AxelarGateway', () => {
});

it('should allow governance to upgrade to the correct implementation with new governance and operators', async () => {
const newGatewayImplementation = await gatewayFactory.deploy(auth.address, tokenDeployer.address, getGasOptions(true)).then((d) => d.deployed());
const newGatewayImplementation = await gatewayFactory
.deploy(auth.address, tokenDeployer.address, getGasOptions(true))
.then((d) => d.deployed());
const newGatewayImplementationCodeHash = await getBytecodeHash(newGatewayImplementation, network.config.id);

const newOperatorAddresses = getAddresses(operators.slice(0, threshold - 1));
Expand Down Expand Up @@ -550,10 +570,14 @@ describe('AxelarGateway', () => {
});

it('should not allow governance to upgrade to a wrong implementation', async () => {
const newGatewayImplementation = await gatewayFactory.deploy(auth.address, tokenDeployer.address, getGasOptions(true)).then((d) => d.deployed());
const newGatewayImplementation = await gatewayFactory
.deploy(auth.address, tokenDeployer.address, getGasOptions(true))
.then((d) => d.deployed());
const wrongCodeHash = keccak256(`0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`);
const depositServiceFactory = await ethers.getContractFactory('AxelarDepositService', owner);
const wrongImplementation = await depositServiceFactory.deploy(gateway.address, '', owner.address, getGasOptions(true)).then((d) => d.deployed());
const wrongImplementation = await depositServiceFactory
.deploy(gateway.address, '', owner.address, getGasOptions(true))
.then((d) => d.deployed());
const wrongImplementationCodeHash = await getBytecodeHash(wrongImplementation, network.config.id);

const newOperatorAddresses = getAddresses(operators.slice(0, 2));
Expand Down
4 changes: 2 additions & 2 deletions test/RpcCompatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ describe('RpcCompatibility', () => {

if (a1.gt(b1)) {
return a1;
} else {
return b1;
}

return b1;
}, BigNumber.from('0x0'));
}

Expand Down

0 comments on commit d7f6b07

Please sign in to comment.