Skip to content

Commit

Permalink
fix: linting errors and remove duplicate switch cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ljankovic-txfusion committed Dec 12, 2024
1 parent fae0a67 commit 94920ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 46 deletions.
1 change: 1 addition & 0 deletions typescript/sdk/src/deploy/verify/ZKSyncContractVerifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export class ZKSyncContractVerifier extends BaseContractVerifier {
} catch (error) {
verificationLogger.trace(
{
error,
failure: response.statusText,
status: response.status,
chain,
Expand Down
13 changes: 2 additions & 11 deletions typescript/sdk/src/deploy/verify/utils.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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', '');
}

/**
Expand Down
36 changes: 1 addition & 35 deletions typescript/sdk/src/ism/HyperlaneIsmFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -231,16 +231,6 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
[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}`);
}
Expand All @@ -263,30 +253,6 @@ export class HyperlaneIsmFactory extends HyperlaneApp<ProxyFactoryFactories> {
return contract;
}

protected async deployStorageMultisigIsm({
destination,
config,
}: {
destination: ChainName;
config: MultisigIsmConfig;
}): Promise<IMultisigIsm> {
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,
Expand Down

0 comments on commit 94920ae

Please sign in to comment.