From 94920ae1fbb25e8293b988d3611ccbd6a1f8295a Mon Sep 17 00:00:00 2001 From: ljankovic-txfusion Date: Thu, 12 Dec 2024 14:38:40 +0100 Subject: [PATCH] fix: linting errors and remove duplicate switch cases --- .../deploy/verify/ZKSyncContractVerifier.ts | 1 + typescript/sdk/src/deploy/verify/utils.ts | 13 ++----- typescript/sdk/src/ism/HyperlaneIsmFactory.ts | 36 +------------------ 3 files changed, 4 insertions(+), 46 deletions(-) diff --git a/typescript/sdk/src/deploy/verify/ZKSyncContractVerifier.ts b/typescript/sdk/src/deploy/verify/ZKSyncContractVerifier.ts index edfbfd5d3e..b76c1d0111 100644 --- a/typescript/sdk/src/deploy/verify/ZKSyncContractVerifier.ts +++ b/typescript/sdk/src/deploy/verify/ZKSyncContractVerifier.ts @@ -137,6 +137,7 @@ export class ZKSyncContractVerifier extends BaseContractVerifier { } catch (error) { verificationLogger.trace( { + error, failure: response.statusText, status: response.status, chain, diff --git a/typescript/sdk/src/deploy/verify/utils.ts b/typescript/sdk/src/deploy/verify/utils.ts index 2a5dd1448d..e82b3e1696 100644 --- a/typescript/sdk/src/deploy/verify/utils.ts +++ b/typescript/sdk/src/deploy/verify/utils.ts @@ -1,9 +1,9 @@ import { ethers, utils } from 'ethers'; -import { ZKSyncArtifact } from '@hyperlane-xyz/core'; import { ProxyAdmin__factory, TransparentUpgradeableProxy__factory, + ZKSyncArtifact, } from '@hyperlane-xyz/core'; import { Address, assert, eqAddress } from '@hyperlane-xyz/utils'; @@ -99,16 +99,7 @@ export async function getContractVerificationInputForZKSync({ export function encodeArguments(abi: any, constructorArgs: any[]): string { const contractInterface = new utils.Interface(abi); - let deployArgumentsEncoded; - try { - deployArgumentsEncoded = contractInterface - .encodeDeploy(constructorArgs) - .replace('0x', ''); - } catch (error: any) { - throw new Error('Cant encode constructor args'); - } - - return deployArgumentsEncoded; + return contractInterface.encodeDeploy(constructorArgs).replace('0x', ''); } /** diff --git a/typescript/sdk/src/ism/HyperlaneIsmFactory.ts b/typescript/sdk/src/ism/HyperlaneIsmFactory.ts index 994368c160..8f3943e389 100644 --- a/typescript/sdk/src/ism/HyperlaneIsmFactory.ts +++ b/typescript/sdk/src/ism/HyperlaneIsmFactory.ts @@ -25,8 +25,8 @@ import { StorageMessageIdMultisigIsm__factory, TestIsm__factory, TrustedRelayerIsm__factory, + ZKSyncArtifact, } from '@hyperlane-xyz/core'; -import { ZKSyncArtifact } from '@hyperlane-xyz/core'; import { Address, Domain, @@ -231,16 +231,6 @@ export class HyperlaneIsmFactory extends HyperlaneApp { [config.bridge], ); break; - case IsmType.STORAGE_MESSAGE_ID_MULTISIG: - case IsmType.STORAGE_MERKLE_ROOT_MULTISIG: - assert( - this.deployer, - `HyperlaneDeployer must be set to deploy ${ismType}`, - ); - return this.deployStorageMultisigIsm({ - destination, - config, - }); default: throw new Error(`Unsupported ISM type ${ismType}`); } @@ -263,30 +253,6 @@ export class HyperlaneIsmFactory extends HyperlaneApp { return contract; } - protected async deployStorageMultisigIsm({ - destination, - config, - }: { - destination: ChainName; - config: MultisigIsmConfig; - }): Promise { - const signer = this.multiProvider.getSigner(destination); - - const factory = - config.type === IsmType.STORAGE_MERKLE_ROOT_MULTISIG - ? new StorageMerkleRootMultisigIsm__factory() - : new StorageMessageIdMultisigIsm__factory(); - - const contract = await this.deployer!.deployContractFromFactory( - destination, - factory, - config.type, - [config.validators, config.threshold], - ); - - return IMultisigIsm__factory.connect(contract.address, signer); - } - protected async deployMultisigIsm( destination: ChainName, config: MultisigIsmConfig,