Skip to content

Commit

Permalink
refactor(fraud): restoring fraud.Service
Browse files Browse the repository at this point in the history
  • Loading branch information
distractedm1nd committed Sep 30, 2022
1 parent 7ceab0a commit 1df9976
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions fraud/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions nodebuilder/fraud/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 1df9976

Please sign in to comment.