Skip to content

Commit

Permalink
Disable setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Inkvi committed Apr 12, 2024
1 parent 464cfad commit 9c4d21a
Showing 1 changed file with 23 additions and 32 deletions.
55 changes: 23 additions & 32 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,6 @@ async function writeAckPacket<name extends Virtual.EventNames<config>>(event: Vi
let sequence = event.args.sequence;
let transactionHash = event.transaction.hash;

logger.debug('writeAckPacket', writerChannelId, sequence)
logger.debug("ackTx", transactionHash)

await context.db.WriteAckPacket.create({
id: event.log.id,
data: {
Expand Down Expand Up @@ -373,9 +370,6 @@ async function recvPacket<name extends Virtual.EventNames<config>>(event: Virtua
let sequence = event.args.sequence;
let recvTx = event.transaction.hash;

logger.debug('recvPacket', destPortAddress, destChannelId, sequence)
logger.debug("recvTx", recvTx)

await context.db.RecvPacket.create({
id: event.log.id,
data: {
Expand Down Expand Up @@ -445,9 +439,6 @@ async function acknowledgement<name extends Virtual.EventNames<config>>(event: V
let srcPortAddress = event.args.sourcePortAddress;
let transactionHash = event.transaction.hash;

logger.debug('acknowledgement', sourceChannelId, sequence)
logger.debug("ackTx", transactionHash)

await context.db.Acknowledgement.create({
id: event.log.id,
data: {
Expand Down Expand Up @@ -618,29 +609,29 @@ ponder.on("DispatcherProof:Acknowledgement", async ({event, context}) => {
await acknowledgement(event, context, "DispatcherProof");
});

ponder.on("DispatcherProof:setup", async ({context}) => {
let databaseConfig = ponderConfig.database!;
let common = {options: ponderConfig.options}
if (process.env.DATABASE_URL) {
let pool = new pg.Pool({
statement_timeout: 2 * 60 * 1000, // 2 minutes
connectionString: process.env.DATABASE_URL
});

let db = new Kysely({
dialect: new PostgresDialect({pool: pool}),
log(event) {
console.log(event);
},
});

await db.schema
.createIndex('channel')
.on('Channel')
.columns(["portId", "blockTimestamp", "openTryChannelId", "openInitChannelId", "state"])
.execute();
}
});
// ponder.on("DispatcherProof:setup", async ({context}) => {
// let databaseConfig = ponderConfig.database!;
// let common = {options: ponderConfig.options}
// if (process.env.DATABASE_URL) {
// let pool = new pg.Pool({
// statement_timeout: 2 * 60 * 1000, // 2 minutes
// connectionString: process.env.DATABASE_URL
// });
//
// let db = new Kysely({
// dialect: new PostgresDialect({pool: pool}),
// log(event) {
// console.log(event);
// },
// });
//
// await db.schema
// .createIndex('channel')
// .on('Channel')
// .columns(["portId", "blockTimestamp", "openTryChannelId", "openInitChannelId", "state"])
// .execute();
// }
// });

// ponder.on("DispatcherSim:Timeout", async ({event, context}) => {
// await timeout(event, context, "DispatcherSim");
Expand Down

0 comments on commit 9c4d21a

Please sign in to comment.