Skip to content

Commit

Permalink
chore: minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ljankovic-txfusion committed Oct 9, 2024
1 parent 8b5afe3 commit 0891c62
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion solidity/solidity/lib/foundry-zksync
Submodule foundry-zksync deleted from 62418b
3 changes: 1 addition & 2 deletions typescript/cli/src/deploy/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export async function runPreflightChecksForChains({
const metadata = multiProvider.tryGetChainMetadata(chain);
if (!metadata) throw new Error(`No chain config found for ${chain}`);
if (
metadata.protocol !== ProtocolType.Ethereum &&
metadata.protocol !== ProtocolType.ZKSync
![ProtocolType.ZKSync, ProtocolType.Ethereum].includes(metadata.protocol)
)
throw new Error('Only Ethereum/ZKSync chains are supported for now');
}
Expand Down
5 changes: 3 additions & 2 deletions typescript/cli/src/hook/read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export async function readHookConfig({
}): Promise<void> {
// TODO: refactor to supported chains function
if (
context.multiProvider.getProtocol(chain) === ProtocolType.Ethereum ||
context.multiProvider.getProtocol(chain) === ProtocolType.ZKSync
[ProtocolType.ZKSync, ProtocolType.Ethereum].includes(
context.multiProvider.getProtocol(chain),
)
) {
const hookReader = new EvmHookReader(context.multiProvider, chain);
const config = await hookReader.deriveHookConfig(address);
Expand Down
7 changes: 3 additions & 4 deletions typescript/sdk/src/contracts/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,9 @@ export function appFromAddressesMapHelper<F extends HyperlaneFactories>(
addressesMap,
(chain, addresses) => {
const metadata = multiProvider.getChainMetadata(chain);
if (metadata.protocol === ProtocolType.ZKSync) {
return addresses;
}
if (metadata.protocol === ProtocolType.Ethereum) {
if (
[ProtocolType.ZKSync, ProtocolType.Ethereum].includes(metadata.protocol)
) {
return addresses;
}
return objMap(
Expand Down
2 changes: 1 addition & 1 deletion typescript/utils/src/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function isValidTransactionHashCosmos(input: string) {
}

export function isValidTransactionHash(input: string, protocol: ProtocolType) {
if (protocol === ProtocolType.Ethereum || protocol === ProtocolType.ZKSync) {
if ([ProtocolType.Ethereum, ProtocolType.ZKSync].includes(protocol)) {
return isValidTransactionHashEvm(input);
} else if (protocol === ProtocolType.Sealevel) {
return isValidTransactionHashSealevel(input);
Expand Down

0 comments on commit 0891c62

Please sign in to comment.