Skip to content

Commit

Permalink
fix: exclude tendermint software version from validation (#123)
Browse files Browse the repository at this point in the history
* fix: exclude tendermint software version from validation
  • Loading branch information
troykessler authored Mar 13, 2024
1 parent 6b18bcf commit 1a35943
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion integrations/tendermint-ssync/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -172,6 +172,18 @@ export default class TendermintSSync implements IRuntime {
proposedDataItem: DataItem,
validationDataItem: DataItem
): Promise<number> {
// 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)
Expand Down

0 comments on commit 1a35943

Please sign in to comment.