Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(types): Fix error type and clean up interface definition #2515

Merged
merged 2 commits into from
Feb 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading