Skip to content

Commit

Permalink
chore(types): Fix error type and clean up interface definition (#2515)
Browse files Browse the repository at this point in the history
  • Loading branch information
rezbera authored Feb 15, 2025
1 parent 70cb888 commit 2dc5822
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions consensus/cometbft/service/encoding/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ func UnmarshalBlobSidecarsFromABCIRequest(

txs := req.GetTxs()
if len(txs) == 0 || bzIndex >= uint(len(txs)) {
return sidecars, ErrNoBeaconBlockInRequest
return sidecars, ErrNoBlobSidecarInRequest
}

sidecarBz := txs[bzIndex]
if sidecarBz == nil {
return sidecars, ErrNilBeaconBlockInRequest
return sidecars, ErrNilBlobSidecarInRequest
}

// TODO: Do some research to figure out how to make this more
Expand Down
8 changes: 8 additions & 0 deletions consensus/cometbft/service/encoding/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ var (
// there is no beacon block in an abci request.
ErrNoBeaconBlockInRequest = errors.New("no beacon block in abci request")

// ErrNilBlobSidecarInRequest is an error for when
// the blob sidecar in an abci request is nil.
ErrNilBlobSidecarInRequest = errors.New("nil blob sidecar in abci request")

// ErrNoBlobSidecarInRequest is an error for when
// there is no blob sidecar in an abci request.
ErrNoBlobSidecarInRequest = errors.New("no blob sidecar in abci request")

// ErrBzIndexOutOfBounds is an error for when the index
// is out of bounds.
ErrBzIndexOutOfBounds = errors.New("bzIndex out of bounds")
Expand Down
4 changes: 1 addition & 3 deletions node-core/types/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ type Node interface {

// ConsensusService defines everything we utilise externally from CometBFT.
type ConsensusService interface {
Start(ctx context.Context) error
Stop() error
Name() string
service.Basic
CreateQueryContext(
height int64,
prove bool,
Expand Down

0 comments on commit 2dc5822

Please sign in to comment.