Skip to content

Commit

Permalink
fix all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos committed Dec 11, 2024
1 parent 6c90565 commit 9aef767
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/InterchainToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('InterchainToken', () => {
const contractBytecodeHash = keccak256(contractBytecode);

const expected = {
london: '0xa01cf28b0b6ce6dc3b466e995585d69486400d671fce0ea8d06beba583e6f3bb',
london: '0x482146829055f052063003e9cf0ffaf798a12fb58088c2667566a135b9568355',
}[getEVMVersion()];

expect(contractBytecodeHash).to.be.equal(expected);
Expand Down
17 changes: 6 additions & 11 deletions test/InterchainTokenFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,13 @@ describe('InterchainTokenFactory', () => {
it('Should register a token if the mint amount is zero and minter is the zero address', async () => {
const salt = keccak256('0x123456');
tokenId = await tokenFactory.interchainTokenId(wallet.address, salt);
const tokenAddress = await service.interchainTokenAddress(tokenId);
const minterBytes = new Uint8Array();
const params = defaultAbiCoder.encode(['bytes', 'address'], [minterBytes, tokenAddress]);
const tokenManager = await getContractAt('TokenManager', await service.tokenManagerAddress(tokenId), wallet);

await expect(tokenFactory.deployInterchainToken(salt, name, symbol, decimals, 0, AddressZero))
.to.emit(service, 'InterchainTokenDeployed')
.withArgs(tokenId, tokenAddress, AddressZero, name, symbol, decimals)
.and.to.emit(service, 'TokenManagerDeployed')
.withArgs(tokenId, tokenManager.address, NATIVE_INTERCHAIN_TOKEN, params);

await checkRoles(tokenManager, AddressZero);
await expectRevert(
(gasOptions) => tokenFactory.deployInterchainToken(salt, name, symbol, decimals, 0, AddressZero, { gasOptions }),
tokenFactory,
'EmptyInterchainToken',
[],
);
});

it('Should register a token if the mint amount is greater than zero and the minter is the zero address', async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/InterchainTokenService.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,13 +909,13 @@ describe('Interchain Token Service', () => {
);
});

it('Should revert on deploying a token manager if token handler post deploy fails', async () => {
it('Should revert on deploying a token manager with an empty token', async () => {
const params = defaultAbiCoder.encode(['bytes', 'address'], [wallet.address, AddressZero]);

await expectRevert(
(gasOptions) => service.deployTokenManager(salt, '', LOCK_UNLOCK, params, 0, gasOptions),
service,
'PostDeployFailed',
'TokenManagerDeploymentFailed',
);
});

Expand Down
2 changes: 1 addition & 1 deletion test/TokenManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('Token Manager', () => {
const proxyBytecodeHash = keccak256(proxyBytecode);

const expected = {
london: '0x8080880884e00735cc1a34bdf5c1ea6c023db60a01cfa1e951ca41ecf5fd8836',
london: '0x3b336208cc75ca67bdd39bdeed72871ce795e6e9cd28e20f811599ea51973ebf',
}[getEVMVersion()];

expect(proxyBytecodeHash).to.be.equal(expected);
Expand Down

0 comments on commit 9aef767

Please sign in to comment.