Skip to content

Commit

Permalink
chore: rename WarpRouteOptions -> AddWarpRouteOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaroz committed Jan 17, 2025
1 parent fc7807f commit 3eb26b5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .changeset/little-paws-begin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@hyperlane-xyz/registry': minor
---

Add WarpRouteOptions to addWarpRoute function
Include AddWarpRouteOptions to addWarpRoute function
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export {
export { BaseRegistry } from './registry/BaseRegistry.js';
export { GithubRegistry, GithubRegistryOptions } from './registry/GithubRegistry.js';
export {
AddWarpRouteOptions,
ChainFiles,
IRegistry,
RegistryContent,
RegistryType,
WarpRouteOptions,
} from './registry/IRegistry.js';
export { MergedRegistry, MergedRegistryOptions } from './registry/MergedRegistry.js';
export { PartialRegistry, PartialRegistryOptions } from './registry/PartialRegistry.js';
Expand Down
4 changes: 2 additions & 2 deletions src/registry/BaseRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import type { ChainAddresses, MaybePromise } from '../types.js';
import { WarpRouteConfigMap } from '../types.js';
import { stripLeadingSlash } from '../utils.js';
import type {
AddWarpRouteOptions,
IRegistry,
RegistryContent,
RegistryType,
UpdateChainParams,
WarpRouteFilterParams,
WarpRouteOptions,
} from './IRegistry.js';
import { MergedRegistry } from './MergedRegistry.js';

Expand Down Expand Up @@ -47,7 +47,7 @@ export abstract class BaseRegistry implements IRegistry {
return 'deployments/warp_routes';
}

protected getWarpRoutesArtifactPaths({ tokens }: WarpCoreConfig, options?: WarpRouteOptions) {
protected getWarpRoutesArtifactPaths({ tokens }: WarpCoreConfig, options?: AddWarpRouteOptions) {
if (!tokens.length) throw new Error('No tokens provided in config');
const symbols = new Set<string>(tokens.map((token) => token.symbol.toUpperCase()));
if (!options?.symbol && symbols.size !== 1)
Expand Down
4 changes: 2 additions & 2 deletions src/registry/FileSystemRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { toYamlString } from '../utils.js';
import {
RegistryType,
UpdateChainParams,
WarpRouteOptions,
type AddWarpRouteOptions,
type ChainFiles,
type IRegistry,
type RegistryContent,
Expand Down Expand Up @@ -95,7 +95,7 @@ export class FileSystemRegistry extends SynchronousRegistry implements IRegistry
this.removeFiles(Object.values(chainFiles));
}

addWarpRoute(config: WarpCoreConfig, options?: WarpRouteOptions): void {
addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): void {
let { configPath, addressesPath } = this.getWarpRoutesArtifactPaths(config, options);

configPath = path.join(this.uri, configPath);
Expand Down
4 changes: 2 additions & 2 deletions src/registry/IRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export enum RegistryType {
Partial = 'partial',
}

export interface WarpRouteOptions {
export interface AddWarpRouteOptions {
symbol?: string;
}

Expand Down Expand Up @@ -62,7 +62,7 @@ export interface IRegistry {

getWarpRoute(routeId: string): MaybePromise<WarpCoreConfig | null>;
getWarpRoutes(filter?: WarpRouteFilterParams): MaybePromise<WarpRouteConfigMap>;
addWarpRoute(config: WarpCoreConfig, options?: WarpRouteOptions): MaybePromise<void>;
addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): MaybePromise<void>;

// TODO define more deployment artifact related methods

Expand Down
4 changes: 2 additions & 2 deletions src/registry/MergedRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperl
import { ChainAddresses, WarpRouteConfigMap, WarpRouteId } from '../types.js';
import { objMerge } from '../utils.js';
import {
AddWarpRouteOptions,
IRegistry,
RegistryContent,
RegistryType,
UpdateChainParams,
WarpRouteFilterParams,
WarpRouteOptions,
} from './IRegistry.js';

export interface MergedRegistryOptions {
Expand Down Expand Up @@ -108,7 +108,7 @@ export class MergedRegistry implements IRegistry {
return results.reduce((acc, content) => objMerge(acc, content), {});
}

async addWarpRoute(config: WarpCoreConfig, options?: WarpRouteOptions): Promise<void> {
async addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): Promise<void> {
return this.multiRegistryWrite(
async (registry) => await registry.addWarpRoute(config, options),
'adding warp route',
Expand Down
4 changes: 2 additions & 2 deletions src/registry/SynchronousRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperl
import { ChainAddresses, WarpRouteConfigMap, WarpRouteId } from '../types.js';
import { BaseRegistry } from './BaseRegistry.js';
import {
AddWarpRouteOptions,
IRegistry,
RegistryContent,
UpdateChainParams,
WarpRouteFilterParams,
WarpRouteOptions,
} from './IRegistry.js';
import { filterWarpRoutesIds } from './warp-utils.js';

Expand Down Expand Up @@ -72,7 +72,7 @@ export abstract class SynchronousRegistry extends BaseRegistry implements IRegis
return Object.fromEntries(idsWithConfigs);
}

abstract addWarpRoute(config: WarpCoreConfig, options?: WarpRouteOptions): void;
abstract addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): void;

protected abstract createOrUpdateChain(chain: UpdateChainParams): void;

Expand Down

0 comments on commit 3eb26b5

Please sign in to comment.