Skip to content

Commit

Permalink
reduce log noise
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Nov 27, 2023
1 parent 0ebc7d3 commit d996cd8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/store-sync/src/postgres/createStorageAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ export async function createStorageAdapter<TConfig extends StoreConfig = StoreCo
// TODO: update stores table

for (const log of logs) {
debug(log.eventName, log);

const keyBytes = encodePacked(["bytes32[]"], [log.args.keyTuple]);

if (log.eventName === "Store_SetRecord") {
debug("upserting record", {
address: log.address,
tableId: log.args.tableId,
keyTuple: log.args.keyTuple,
});

await tx
.insert(recordsTable)
.values({
Expand Down Expand Up @@ -95,9 +99,6 @@ export async function createStorageAdapter<TConfig extends StoreConfig = StoreCo
address: log.address,
tableId: log.args.tableId,
keyTuple: log.args.keyTuple,
previousStaticData,
newStaticData,
previousValue,
});

await tx
Expand Down Expand Up @@ -145,9 +146,6 @@ export async function createStorageAdapter<TConfig extends StoreConfig = StoreCo
address: log.address,
tableId: log.args.tableId,
keyTuple: log.args.keyTuple,
previousDynamicData,
newDynamicData,
previousValue,
});

await tx
Expand Down

0 comments on commit d996cd8

Please sign in to comment.