From 9aef7679169e7c1f223642d8a09946707eb81897 Mon Sep 17 00:00:00 2001 From: Foivos Date: Wed, 11 Dec 2024 17:43:52 +0200 Subject: [PATCH] fix all tests --- test/InterchainToken.js | 2 +- test/InterchainTokenFactory.js | 17 ++++++----------- test/InterchainTokenService.js | 4 ++-- test/TokenManager.js | 2 +- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/test/InterchainToken.js b/test/InterchainToken.js index a7ff687a..300678c7 100644 --- a/test/InterchainToken.js +++ b/test/InterchainToken.js @@ -147,7 +147,7 @@ describe('InterchainToken', () => { const contractBytecodeHash = keccak256(contractBytecode); const expected = { - london: '0xa01cf28b0b6ce6dc3b466e995585d69486400d671fce0ea8d06beba583e6f3bb', + london: '0x482146829055f052063003e9cf0ffaf798a12fb58088c2667566a135b9568355', }[getEVMVersion()]; expect(contractBytecodeHash).to.be.equal(expected); diff --git a/test/InterchainTokenFactory.js b/test/InterchainTokenFactory.js index fa9e687e..0e2cd5f3 100644 --- a/test/InterchainTokenFactory.js +++ b/test/InterchainTokenFactory.js @@ -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 () => { diff --git a/test/InterchainTokenService.js b/test/InterchainTokenService.js index 2cb75946..2dc561c3 100644 --- a/test/InterchainTokenService.js +++ b/test/InterchainTokenService.js @@ -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', ); }); diff --git a/test/TokenManager.js b/test/TokenManager.js index 18fd33de..5d9a4a8a 100644 --- a/test/TokenManager.js +++ b/test/TokenManager.js @@ -92,7 +92,7 @@ describe('Token Manager', () => { const proxyBytecodeHash = keccak256(proxyBytecode); const expected = { - london: '0x8080880884e00735cc1a34bdf5c1ea6c023db60a01cfa1e951ca41ecf5fd8836', + london: '0x3b336208cc75ca67bdd39bdeed72871ce795e6e9cd28e20f811599ea51973ebf', }[getEVMVersion()]; expect(proxyBytecodeHash).to.be.equal(expected);