Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 8a33405

Browse files
Ruteriavalonche
authored andcommitted
Adjust value encoding (#9)
1 parent 9e05d57 commit 8a33405

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

builder/backend.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"sync"
1212
"time"
1313

14-
"github.com/ethereum/go-ethereum/common"
1514
"github.com/ethereum/go-ethereum/common/hexutil"
1615
"github.com/ethereum/go-ethereum/core/beacon"
1716
"github.com/ethereum/go-ethereum/core/types"
@@ -248,7 +247,7 @@ func (b *Backend) handleGetHeader(w http.ResponseWriter, req *http.Request) {
248247

249248
bid := boostTypes.BuilderBid{
250249
Header: bestHeader,
251-
Value: [32]byte(common.BytesToHash(profit.Bytes())),
250+
Value: *new(boostTypes.U256Str).FromBig(profit),
252251
Pubkey: b.builderPublicKey,
253252
}
254253
signature, err := boostTypes.SignMessage(&bid, b.builderSigningDomain, b.builderSecretKey)

builder/backend_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func TestGetHeader(t *testing.T) {
150150
require.NoError(t, err)
151151
require.EqualValues(t, &boostTypes.BuilderBid{
152152
Header: expectedHeader,
153-
Value: [32]byte(common.BytesToHash(forkchoiceBlock.Profit.Bytes())),
153+
Value: *new(boostTypes.U256Str).FromBig(forkchoiceBlock.Profit),
154154
Pubkey: backend.builderPublicKey,
155155
}, bid.Data.Message)
156156

0 commit comments

Comments
 (0)