From 1a35943f1165e895b5a704833276d0b21fdea8b9 Mon Sep 17 00:00:00 2001 From: Troy Kessler <43882936+troykessler@users.noreply.github.com> Date: Wed, 13 Mar 2024 14:42:14 +0100 Subject: [PATCH] fix: exclude tendermint software version from validation (#123) * fix: exclude tendermint software version from validation --- integrations/tendermint-ssync/src/runtime.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/integrations/tendermint-ssync/src/runtime.ts b/integrations/tendermint-ssync/src/runtime.ts index fe2f0753..da961a87 100644 --- a/integrations/tendermint-ssync/src/runtime.ts +++ b/integrations/tendermint-ssync/src/runtime.ts @@ -118,7 +118,7 @@ export default class TendermintSSync implements IRuntime { // 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 @@ -172,6 +172,18 @@ export default class TendermintSSync implements IRuntime { proposedDataItem: DataItem, validationDataItem: DataItem ): Promise { + // exclude tendermint software version from validation + if (proposedDataItem.value.state && proposedDataItem.value.state.Version) { + delete proposedDataItem.value.state.Version.software; + } + + if ( + validationDataItem.value.state && + validationDataItem.value.state.Version + ) { + delete validationDataItem.value.state.Version.software; + } + // apply equal comparison if ( JSON.stringify(proposedDataItem) === JSON.stringify(validationDataItem)