From 60a328e018ae437fd8d04ee92596435b407f5350 Mon Sep 17 00:00:00 2001 From: Akshay Aggarwal Date: Fri, 1 Dec 2023 19:54:47 +0530 Subject: [PATCH] Add NOTE for enum duplication and todo to resovle it (#11444) --- .../plugins/ocr2keeper/evmregistry/v21/encoding/interface.go | 4 ++++ .../evmregistry/v21/mercury/upkeep_failure_reasons.go | 2 ++ .../ocr2keeper/evmregistry/v21/mercury/upkeep_states.go | 2 ++ 3 files changed, 8 insertions(+) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/interface.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/interface.go index 83ace2492f5..06a3e7b106b 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/interface.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/encoding/interface.go @@ -11,6 +11,8 @@ import ( ) const ( + // NOTE: This enum should be kept in sync with evmregistry/v21/mercury/upkeep_failure_reasons.go + // TODO (AUTO-7928) Remove this duplication // upkeep failure onchain reasons UpkeepFailureReasonNone uint8 = 0 UpkeepFailureReasonUpkeepCancelled uint8 = 1 @@ -30,6 +32,8 @@ const ( UpkeepFailureReasonSimulationFailed uint8 = 35 UpkeepFailureReasonTxHashReorged uint8 = 36 + // NOTE: This enum should be kept in sync with evmregistry/v21/mercury/upkeep_states.go + // TODO (AUTO-7928) Remove this duplication // pipeline execution error NoPipelineError uint8 = 0 CheckBlockTooOld uint8 = 1 diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/upkeep_failure_reasons.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/upkeep_failure_reasons.go index 261fc33bd46..66f8bca402f 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/upkeep_failure_reasons.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/upkeep_failure_reasons.go @@ -2,6 +2,8 @@ package mercury type MercuryUpkeepFailureReason uint8 +// NOTE: This enum should be kept in sync with evmregistry/v21/encoding/interface.go +// TODO (AUTO-7928) Remove this duplication const ( // upkeep failure onchain reasons MercuryUpkeepFailureReasonNone MercuryUpkeepFailureReason = 0 diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/upkeep_states.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/upkeep_states.go index 4e9cd14aee3..0d8276ff2de 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/upkeep_states.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/upkeep_states.go @@ -2,6 +2,8 @@ package mercury type MercuryUpkeepState uint8 +// NOTE: This enum should be kept in sync with evmregistry/v21/encoding/interface.go +// TODO (AUTO-7928) Remove this duplication const ( NoPipelineError MercuryUpkeepState = 0 RpcFlakyFailure MercuryUpkeepState = 3