diff --git a/pkg/types/automation/basetypes.go b/pkg/types/automation/basetypes.go index 45874ccde..96013c95f 100644 --- a/pkg/types/automation/basetypes.go +++ b/pkg/types/automation/basetypes.go @@ -35,14 +35,6 @@ func init() { checkResultStringTemplate = strings.Replace(checkResultStringTemplate, "\n", "", -1) } -type UpkeepType uint8 - -const ( - // Exploratory AUTO 4335: add type for unknown - ConditionTrigger UpkeepType = iota - LogTrigger -) - type TransmitEventType int const ( @@ -339,11 +331,3 @@ type ReportedUpkeep struct { // WorkID represents the unit of work for the reported upkeep WorkID string } - -// RetryRecord is a record of a payload that can be retried after a certain interval. -type RetryRecord struct { - // payload is the desired unit of work to be retried - Payload UpkeepPayload - // Interval is the time interval after which the same payload can be retried. - Interval time.Duration -} diff --git a/pkg/types/automation/interfaces.go b/pkg/types/automation/interfaces.go index 6213f5722..a42913ef7 100644 --- a/pkg/types/automation/interfaces.go +++ b/pkg/types/automation/interfaces.go @@ -7,9 +7,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" ) -type UpkeepTypeGetter func(UpkeepIdentifier) UpkeepType -type WorkIDGenerator func(UpkeepIdentifier, Trigger) string - // UpkeepStateStore is the interface for managing upkeeps final state in a local store. type UpkeepStateStore interface { UpkeepStateUpdater @@ -59,10 +56,6 @@ type RecoverableProvider interface { GetRecoveryProposals(context.Context) ([]UpkeepPayload, error) } -type TransmitEventProvider interface { - GetLatestEvents(context.Context) ([]TransmitEvent, error) -} - type ConditionalUpkeepProvider interface { GetActiveUpkeeps(context.Context) ([]UpkeepPayload, error) } @@ -72,11 +65,6 @@ type PayloadBuilder interface { BuildPayloads(context.Context, ...CoordinatedBlockProposal) ([]UpkeepPayload, error) } -type Runnable interface { - // Can get results for a subset of payloads along with an error - CheckUpkeeps(context.Context, ...UpkeepPayload) ([]CheckResult, error) -} - type BlockSubscriber interface { // Subscribe provides an identifier integer, a new channel, and potentially an error Subscribe() (int, chan BlockHistory, error) @@ -89,49 +77,3 @@ type BlockSubscriber interface { type UpkeepStateUpdater interface { SetUpkeepState(context.Context, CheckResult, UpkeepState) error } - -type RetryQueue interface { - // Enqueue adds new items to the queue - Enqueue(items ...RetryRecord) error - // Dequeue returns the next n items in the queue, considering retry time schedules - Dequeue(n int) ([]UpkeepPayload, error) -} - -type ProposalQueue interface { - // Enqueue adds new items to the queue - Enqueue(items ...CoordinatedBlockProposal) error - // Dequeue returns the next n items in the queue, considering retry time schedules - Dequeue(t UpkeepType, n int) ([]CoordinatedBlockProposal, error) -} - -type ResultStore interface { - Add(...CheckResult) - Remove(...string) - View() ([]CheckResult, error) -} - -type Coordinator interface { - PreProcess(_ context.Context, payloads []UpkeepPayload) ([]UpkeepPayload, error) - - Accept(ReportedUpkeep) bool - ShouldTransmit(ReportedUpkeep) bool - FilterResults([]CheckResult) ([]CheckResult, error) - FilterProposals([]CoordinatedBlockProposal) ([]CoordinatedBlockProposal, error) -} - -type MetadataStore interface { - SetBlockHistory(BlockHistory) - GetBlockHistory() BlockHistory - - AddProposals(proposals ...CoordinatedBlockProposal) - ViewProposals(utype UpkeepType) []CoordinatedBlockProposal - RemoveProposals(proposals ...CoordinatedBlockProposal) - - Start(context.Context) error - Close() error -} - -type Ratio interface { - // OfInt should return n out of x such that n/x ~ r (ratio) - OfInt(int) int -}