From 05462da59d65d55c1775729f4e2883454af30dc7 Mon Sep 17 00:00:00 2001 From: Joel Carter Date: Wed, 11 Oct 2023 08:11:41 -0500 Subject: [PATCH] Build with payload builder --- .../packages/diviner/src/Diviner/Diviner.ts | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/plugins/packages/payloadset/packages/image-thumbnail/packages/diviner/src/Diviner/Diviner.ts b/packages/plugins/packages/payloadset/packages/image-thumbnail/packages/diviner/src/Diviner/Diviner.ts index 4a7c4ab23bd..6745527446f 100644 --- a/packages/plugins/packages/payloadset/packages/image-thumbnail/packages/diviner/src/Diviner/Diviner.ts +++ b/packages/plugins/packages/payloadset/packages/image-thumbnail/packages/diviner/src/Diviner/Diviner.ts @@ -73,12 +73,14 @@ export class ImageThumbnailDiviner({ schema: BoundWitnessDivinerQuerySchema }).fields({ - limit: this.payloadDivinerLimit, - offset, - order: 'asc', - payload_schemas: [ImageThumbnailSchema, TimestampSchema], - }) + const query = new PayloadBuilder({ schema: BoundWitnessDivinerQuerySchema }) + .fields({ + limit: this.payloadDivinerLimit, + offset, + order: 'asc', + payload_schemas: [ImageThumbnailSchema, TimestampSchema], + }) + .build() const batch = await boundWitnessDiviner.divine([query]) if (batch.length === 0) return // Find all the indexable hashes in this batch @@ -216,13 +218,15 @@ export class ImageThumbnailDiviner { let hash: string = '' const diviner = await this.getBoundWitnessDivinerForStore('stateStore') - const query = new PayloadBuilder({ schema: BoundWitnessDivinerQuerySchema }).fields({ - address: this.account.address, - limit: 1, - offset: 0, - order: 'desc', - payload_schemas: [ModuleStateSchema], - }) + const query = new PayloadBuilder({ schema: BoundWitnessDivinerQuerySchema }) + .fields({ + address: this.account.address, + limit: 1, + offset: 0, + order: 'desc', + payload_schemas: [ModuleStateSchema], + }) + .build() const boundWitnesses = await diviner.divine([query]) if (boundWitnesses.length > 0) { const boundWitness = boundWitnesses[0]