From 3cba83dec15bc293d6e8c01c4628d96b8a99b12c Mon Sep 17 00:00:00 2001 From: Troy Kessler <43882936+troykessler@users.noreply.github.com> Date: Fri, 15 Dec 2023 16:10:07 +0100 Subject: [PATCH] fix: add prevalidation for snapshot chunk (#108) --- integrations/tendermint-ssync/src/runtime.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/integrations/tendermint-ssync/src/runtime.ts b/integrations/tendermint-ssync/src/runtime.ts index 840c8dbd..fe2f0753 100644 --- a/integrations/tendermint-ssync/src/runtime.ts +++ b/integrations/tendermint-ssync/src/runtime.ts @@ -115,6 +115,11 @@ export default class TendermintSSync implements IRuntime { throw new Error(`Value in data item is not defined: ${item.value}`); } + // throw error if chunk is missing + if (!item.value.chunk) { + throw new Error(`Value in data item has no snapshot chunk`); + } + if (chunkIndex > 0) { // throw error if one of those values is not null if (