From 1df9976f4c75b2d075a2ad7ba89fe39e3a2dc82e Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 30 Sep 2022 12:01:54 +0200 Subject: [PATCH] refactor(fraud): restoring fraud.Service --- fraud/interface.go | 8 ++++++++ nodebuilder/fraud/service.go | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fraud/interface.go b/fraud/interface.go index f591d5d793..9fa8cc3d2b 100644 --- a/fraud/interface.go +++ b/fraud/interface.go @@ -16,6 +16,14 @@ type headerFetcher func(context.Context, uint64) (*header.ExtendedHeader, error) // ProofUnmarshaler aliases a function that parses data to `Proof`. type ProofUnmarshaler func([]byte) (Proof, error) +// Service encompasses the behavior necessary to subscribe and broadcast +// fraud proofs within the network. +type Service interface { + Subscriber + Broadcaster + Getter +} + // Broadcaster is a generic interface that sends a `Proof` to all nodes subscribed on the Broadcaster's topic. type Broadcaster interface { // Broadcast takes a fraud `Proof` data structure that implements standard BinaryMarshal diff --git a/nodebuilder/fraud/service.go b/nodebuilder/fraud/service.go index b9dc3d0efd..be28981d36 100644 --- a/nodebuilder/fraud/service.go +++ b/nodebuilder/fraud/service.go @@ -5,7 +5,5 @@ import "github.com/celestiaorg/celestia-node/fraud" // Module encompasses the behavior necessary to subscribe and broadcast // fraud proofs within the network. type Module interface { - fraud.Subscriber - fraud.Broadcaster - fraud.Getter + fraud.Service }