Skip to content

Commit

Permalink
test: add test to deploy gateway without operator
Browse files Browse the repository at this point in the history
  • Loading branch information
blockchainguyy committed Jun 27, 2024
1 parent c77f292 commit 508c811
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/gateway/AxelarAmplifierGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,32 @@ describe('AxelarAmplifierGateway', () => {
expect(await gateway.operator()).to.equal(operator.address);
});

it('should allow deploying gateway with address 0 as the operator', async () => {
const signers = defaultAbiCoder.encode(
['address', `${WEIGHTED_SIGNERS_TYPE}[]`],
[AddressZero, [weightedSigners]],
);

implementation = await gatewayFactory.deploy(
previousSignersRetention,
domainSeparator,
minimumRotationDelay,
);
await implementation.deployTransaction.wait(network.config.confirmations);

const proxy = await gatewayProxyFactory.deploy(
implementation.address,
owner.address,
signers,
getGasOptions(),
);
await proxy.deployTransaction.wait(network.config.confirmations);

gateway = gatewayFactory.attach(proxy.address);

expect(await gateway.operator()).to.equal(AddressZero);
});

it('reject transferring ownership by non-owner', async () => {
await expectRevert(
(gasOptions) => gateway.connect(operator).transferOwnership(operator.address, gasOptions),
Expand Down

0 comments on commit 508c811

Please sign in to comment.