Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonche committed Aug 4, 2024
1 parent 4a64090 commit 0c697db
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions api/electra/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ package electra

// Need to `go install github.com/ferranbt/fastssz/sszgen@latest` for this to work.
//go:generate rm -f builderbid_ssz.go executionpayloadandblobsbundle_ssz.go signedbuilderbid_ssz.go submitblockrequest_ssz.go
//nolint:revive
//go:generate sszgen --suffix ssz --include ../../../go-eth2-client/spec/phase0,../../../go-eth2-client/spec/bellatrix,../../../go-eth2-client/spec/capella,../../../go-eth2-client/spec/deneb,../../../go-eth2-client/spec/electra,../v1,../deneb --path . --objs BuilderBid,ExecutionPayloadAndBlobsBundle,SignedBuilderBid,SubmitBlockRequest
//go:generate goimports -w builderbid_ssz.go executionpayloadandblobsbundle_ssz.go signedbuilderbid_ssz.go submitblockrequest_ssz.go
4 changes: 2 additions & 2 deletions api/electra/submitblockrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import (
"fmt"

"github.com/attestantio/go-builder-client/api/deneb"
v1 "github.com/attestantio/go-builder-client/api/v1"
apiv1 "github.com/attestantio/go-builder-client/api/v1"
"github.com/attestantio/go-eth2-client/spec/electra"
"github.com/attestantio/go-eth2-client/spec/phase0"
"github.com/goccy/go-yaml"
)

// SubmitBlockRequest is the request from the builder to submit a block.
type SubmitBlockRequest struct {
Message *v1.BidTrace
Message *apiv1.BidTrace
ExecutionPayload *electra.ExecutionPayload
BlobsBundle *deneb.BlobsBundle
Signature phase0.BLSSignature `ssz-size:"96"`
Expand Down
4 changes: 2 additions & 2 deletions api/electra/submitblockrequest_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ import (
"strings"

"github.com/attestantio/go-builder-client/api/deneb"
v1 "github.com/attestantio/go-builder-client/api/v1"
apiv1 "github.com/attestantio/go-builder-client/api/v1"
"github.com/attestantio/go-eth2-client/spec/electra"
"github.com/attestantio/go-eth2-client/spec/phase0"
"github.com/pkg/errors"
)

// submitBlockRequestJSON is the spec representation of the struct.
type submitBlockRequestJSON struct {
Message *v1.BidTrace `json:"message"`
Message *apiv1.BidTrace `json:"message"`
ExecutionPayload *electra.ExecutionPayload `json:"execution_payload"`
BlobsBundle *deneb.BlobsBundle `json:"blobs_bundle"`
Signature string `json:"signature"`
Expand Down
8 changes: 4 additions & 4 deletions api/electra/submitblockrequest_ssz.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/electra/submitblockrequest_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import (
"fmt"

"github.com/attestantio/go-builder-client/api/deneb"
v1 "github.com/attestantio/go-builder-client/api/v1"
apiv1 "github.com/attestantio/go-builder-client/api/v1"
"github.com/attestantio/go-eth2-client/spec/electra"
"github.com/goccy/go-yaml"
)

// submitBlockRequestYAML is the spec representation of the struct.
type submitBlockRequestYAML struct {
Message *v1.BidTrace `yaml:"message"`
Message *apiv1.BidTrace `yaml:"message"`
ExecutionPayload *electra.ExecutionPayload `yaml:"execution_payload"`
BlobsBundle *deneb.BlobsBundle `yaml:"blobs_bundle"`
Signature string `yaml:"signature"`
Expand Down
4 changes: 3 additions & 1 deletion http/unblindproposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ func (s *Service) unblindElectraProposal(ctx context.Context,
return nil, errors.Join(errors.New("failed to generate hash tree root for the received execution payload header"), err)
}
if !bytes.Equal(ourExecutionPayloadHash[:], receivedExecutionPayloadHash[:]) {
return nil, fmt.Errorf("execution payload hash mismatch: %#x != %#x", receivedExecutionPayloadHash[:], ourExecutionPayloadHash[:])
return nil, fmt.Errorf("execution payload hash mismatch: %#x != %#x", receivedExecutionPayloadHash[:],
ourExecutionPayloadHash[:],
)
}
res.Electra.SignedBlock.Message.Body.ExecutionPayload = bundle.ExecutionPayload

Expand Down

0 comments on commit 0c697db

Please sign in to comment.