Skip to content

Commit

Permalink
Don't handle OwnershipTransferred events
Browse files Browse the repository at this point in the history
  • Loading branch information
Inkvi committed Apr 9, 2024
1 parent 2716ebe commit b358e15
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
16 changes: 0 additions & 16 deletions ponder.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,6 @@ export default createSchema((p) => ({
maxPriorityFeePerGas: p.bigint().optional(),
from: p.string(),
}),
OwnershipTransferred: p.createTable({
id: p.string(),
dispatcherAddress: p.string(),
dispatcherType: p.string(),
dispatcherClientName: p.string(),
previousOwner: p.string(),
newOwner: p.string(),
blockNumber: p.bigint(),
blockTimestamp: p.bigint(),
transactionHash: p.string(),
chainId: p.int(),
gas: p.int(),
maxFeePerGas: p.bigint().optional(),
maxPriorityFeePerGas: p.bigint().optional(),
from: p.string(),
}),
RecvPacket: p.createTable({
id: p.string(),
dispatcherAddress: p.string(),
Expand Down
34 changes: 0 additions & 34 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,31 +227,6 @@ async function closeIbcChannel<name extends Virtual.EventNames<config>>(event: V
await updateStats(context.db.Stat, StatName.CloseIBCChannel)
}

async function ownershipTransferred<name extends Virtual.EventNames<config>>(event: Virtual.Event<config, "DispatcherSim:OwnershipTransferred" | "DispatcherProof:OwnershipTransferred">, context: Virtual.Context<config, schema, name>, contractName: Virtual.ExtractContractName<name>) {
const {address, dispatcherType} = getAddressAndDispatcherType<name>(contractName, context);
let client = DISPATCHER_CLIENT[address!];
const chainId = context.network.chainId as number;

await context.db.OwnershipTransferred.create({
id: event.log.id,
data: {
dispatcherAddress: address || "0x",
dispatcherType: dispatcherType,
dispatcherClientName: client!,
previousOwner: event.args.previousOwner,
newOwner: event.args.newOwner,
blockNumber: event.block.number,
blockTimestamp: event.block.timestamp,
transactionHash: event.transaction.hash,
chainId: chainId,
gas: Number(event.transaction.gas),
maxFeePerGas: event.transaction.maxFeePerGas,
maxPriorityFeePerGas: event.transaction.maxPriorityFeePerGas,
from: event.transaction.from.toString(),
},
});
}

async function sendPacket<name extends Virtual.EventNames<config>>(event: Virtual.Event<config, "DispatcherSim:SendPacket" | "DispatcherProof:SendPacket">, context: Virtual.Context<config, schema, name>, contractName: Virtual.ExtractContractName<name>) {
const {address, dispatcherType} = getAddressAndDispatcherType<name>(contractName, context);
let client = DISPATCHER_CLIENT[address!];
Expand Down Expand Up @@ -653,15 +628,6 @@ ponder.on("DispatcherProof:CloseIbcChannel", async ({event, context}) => {
await closeIbcChannel(event, context, "DispatcherProof");
});

ponder.on("DispatcherSim:OwnershipTransferred", async ({event, context}) => {
await ownershipTransferred(event, context, "DispatcherSim");
});

ponder.on("DispatcherProof:OwnershipTransferred", async ({event, context}) => {
await ownershipTransferred(event, context, "DispatcherProof");
});


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

0 comments on commit b358e15

Please sign in to comment.