Skip to content

Commit

Permalink
Do polling and handle polling result
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Aug 24, 2023
1 parent b7f6055 commit e66024c
Show file tree
Hide file tree
Showing 13 changed files with 5,035 additions and 248 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ node_modules/
/actions/types/

# Compiled production code
/actions/out/
/actions/out/
.yalc
yalc.lock
18 changes: 11 additions & 7 deletions actions/addContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ import type {
} from "./types/ComposableCoW";
import { ComposableCoW__factory } from "./types/factories/ComposableCoW__factory";

import { isComposableCowCompatible, handleExecutionError, init, writeRegistry } from "./utils";
import {
isComposableCowCompatible,
handleExecutionError,
init,
writeRegistry,
toChainId,
} from "./utils";
import { ChainContext, Owner, Proof, Registry } from "./model";

/**
Expand All @@ -32,12 +38,10 @@ const _addContract: ActionFn = async (context: Context, event: Event) => {
const transactionEvent = event as TransactionEvent;
const tx = transactionEvent.hash;
const composableCow = ComposableCoW__factory.createInterface();
const { provider } = await ChainContext.create(context, transactionEvent.network);
const { registry } = await init(
"addContract",
transactionEvent.network,
context
);

const chainId = toChainId(transactionEvent.network);
const { provider } = await ChainContext.create(context, chainId);
const { registry } = await init("addContract", chainId, context);

// Process the logs
let hasErrors = false;
Expand Down
Loading

0 comments on commit e66024c

Please sign in to comment.