Skip to content

Commit

Permalink
Fix domain naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mj52951 committed Jul 12, 2024
1 parent 6e17b81 commit dea4bc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
7 changes: 2 additions & 5 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { ApiPromise, WsProvider } from "@polkadot/api";
import {
EvmResource,
FeeHandler,
Network,
ResourceType,
SubstrateResource,
Domain as DomainSDK,
} from "@buildwithsygma/sygma-sdk-core";
import { logger } from "../utils/logger";

Expand All @@ -31,10 +31,7 @@ export type SharedConfig = {
domains: Array<Domain>;
};

export type Domain = {
id: number;
name: string;
type: Network;
export type Domain = DomainSDK & {
bridge: string;
feeRouter: string;
feeHandlers: Array<FeeHandler>;
Expand Down
14 changes: 7 additions & 7 deletions src/evmIndexer/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
DepositType,
FeeData,
} from "../evmTypes";
import { Domain as DomainConfig } from "../../config";
import { Domain } from "../../config";
import { logger } from "../../utils/logger";
import { Transfer } from "../../model";
import * as FeeHandlerRouter from "../../abi/FeeHandlerRouter.json";
Expand All @@ -47,8 +47,8 @@ type FeeDataResponse = {

export async function parseDeposit(
log: Log,
fromDomain: DomainConfig,
toDomain: DomainConfig,
fromDomain: Domain,
toDomain: Domain,
provider: Provider,
substrateRpcUrlConfig: Map<number, ApiPromise>
): Promise<DecodedDepositLog> {
Expand Down Expand Up @@ -96,7 +96,7 @@ export async function parseDeposit(

export function parseDestination(
hexData: BytesLike,
domain: DomainConfig,
domain: Domain,
resourceType: string,
substrateRpcUrlConfig: Map<number, ApiPromise>
): string {
Expand Down Expand Up @@ -209,7 +209,7 @@ function decodeAmountsOrTokenId(

export function parseProposalExecution(
log: Log,
toDomain: DomainConfig
toDomain: Domain
): DecodedProposalExecutionLog {
const event = bridge.events.ProposalExecution.decode(log);
const transaction = assertNotNull(log.transaction, "Missing transaction");
Expand All @@ -228,7 +228,7 @@ export function parseProposalExecution(

export function parseFailedHandlerExecution(
log: Log,
toDomain: DomainConfig
toDomain: Domain
): DecodedFailedHandlerExecution {
const event = bridge.events.FailedHandlerExecution.decode(log);
const transaction = assertNotNull(log.transaction, "Missing transaction");
Expand All @@ -249,7 +249,7 @@ export function parseFailedHandlerExecution(

export async function getFee(
log: Log,
fromDomain: DomainConfig,
fromDomain: Domain,
provider: Provider
): Promise<FeeData> {
try {
Expand Down

0 comments on commit dea4bc3

Please sign in to comment.