Skip to content

Commit

Permalink
some updates to pass validations
Browse files Browse the repository at this point in the history
  • Loading branch information
aditiharini committed Dec 6, 2024
1 parent 32be58e commit b8ad01d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/shuttle/src/example-app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import url from "node:url";
import { err, ok, Result } from "neverthrow";
import { getQueue, getWorker } from "./worker";
import { Queue } from "bullmq";
import { bytesToHex, farcasterTimeToDate } from "../utils";
import { bytesToHex, farcasterTimeToDate, sleep } from "../utils";

const hubId = "shuttle";

Expand Down Expand Up @@ -200,7 +200,8 @@ export class App implements MessageHandler {

const newMessage = Message.create(message);
newMessage.dataBytes = MessageData.encode(message.data).finish();
newMessage.data = undefined;
// TODO(aditi): Is this right? Need to leave data as is to avoid message missing data error.
// newMessage.data = undefined;
const result = await this.snapchainClient.submitMessage(newMessage);
if (result.isErr()) {
log.info(`Unable to submit message to snapchain ${result.error.message} ${result.error.stack}`);
Expand Down Expand Up @@ -301,6 +302,10 @@ export class App implements MessageHandler {
continue;
}

// Wait for the onchain events to get committed
// TODO(aditi): We may want to do something better here.
await sleep(1 * 1000);

await reconciler.reconcileMessagesForFid(
fid,
async (message, missingInDb, prunedInDb, revokedInDb) => {
Expand Down

0 comments on commit b8ad01d

Please sign in to comment.