Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed Dec 14, 2022
1 parent a2c00fd commit 4605a6d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions beacon-chain/rpc/eth/beacon/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func (bs *Server) getBlockBellatrix(ctx context.Context, blk interfaces.SignedBe
if blindedBellatrixBlk == nil {
return nil, errNilBlock
}
signedFullBlock, err := bs.ExecutionPayloadReconstructor.ReconstructFullBellatrixBlock(ctx, blk)
signedFullBlock, err := bs.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk)
if err != nil {
return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block")
}
Expand Down Expand Up @@ -733,7 +733,7 @@ func (bs *Server) getBlockCapella(ctx context.Context, blk interfaces.SignedBeac
if blindedCapellaBlk == nil {
return nil, errNilBlock
}
signedFullBlock, err := bs.ExecutionPayloadReconstructor.ReconstructFullBellatrixBlock(ctx, blk)
signedFullBlock, err := bs.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk)
if err != nil {
return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block")
}
Expand Down Expand Up @@ -846,7 +846,7 @@ func (bs *Server) getSSZBlockBellatrix(ctx context.Context, blk interfaces.Signe
if blindedBellatrixBlk == nil {
return nil, errNilBlock
}
signedFullBlock, err := bs.ExecutionPayloadReconstructor.ReconstructFullBellatrixBlock(ctx, blk)
signedFullBlock, err := bs.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk)
if err != nil {
return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block")
}
Expand Down Expand Up @@ -922,7 +922,7 @@ func (bs *Server) getSSZBlockCapella(ctx context.Context, blk interfaces.SignedB
if blindedCapellaBlk == nil {
return nil, errNilBlock
}
signedFullBlock, err := bs.ExecutionPayloadReconstructor.ReconstructFullBellatrixBlock(ctx, blk)
signedFullBlock, err := bs.ExecutionPayloadReconstructor.ReconstructFullBlock(ctx, blk)
if err != nil {
return nil, errors.Wrapf(err, "could not reconstruct full execution payload to create signed beacon block")
}
Expand Down
8 changes: 4 additions & 4 deletions proto/engine/v1/json_marshal_unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ func (j *withdrawalJSON) ToWithdrawal() (*Withdrawal, error) {
}

func (w *Withdrawal) MarshalJSON() ([]byte, error) {
index := hexutil.Uint64(w.WithdrawalIndex)
index := hexutil.Uint64(w.Index)
validatorIndex := hexutil.Uint64(w.ValidatorIndex)
address := common.BytesToAddress(w.ExecutionAddress)
address := common.BytesToAddress(w.Address)
wei := new(big.Int).SetUint64(1000000000)
amountWei := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), wei)
return json.Marshal(withdrawalJSON{
Expand All @@ -188,9 +188,9 @@ func (w *Withdrawal) UnmarshalJSON(enc []byte) error {
return errors.New("missing execution address")
}
*w = Withdrawal{}
w.WithdrawalIndex = uint64(*dec.Index)
w.Index = uint64(*dec.Index)
w.ValidatorIndex = types.ValidatorIndex(*dec.Validator)
w.ExecutionAddress = dec.Address.Bytes()
w.Address = dec.Address.Bytes()
wei := new(big.Int).SetUint64(1000000000)
amountWei, err := hexutil.DecodeBig(dec.Amount)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions proto/engine/v1/json_marshal_unmarshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,13 @@ func TestJsonMarshalUnmarshal(t *testing.T) {
require.DeepEqual(t, want.MixDigest, payloadPb.MixDigest)
require.DeepEqual(t, want.Nonce, payloadPb.Nonce)
require.Equal(t, 2, len(payloadPb.Withdrawals))
require.Equal(t, uint64(1), payloadPb.Withdrawals[0].WithdrawalIndex)
require.Equal(t, uint64(1), payloadPb.Withdrawals[0].Index)
require.Equal(t, types.ValidatorIndex(1), payloadPb.Withdrawals[0].ValidatorIndex)
require.DeepEqual(t, bytesutil.PadTo([]byte("address1"), 20), payloadPb.Withdrawals[0].ExecutionAddress)
require.DeepEqual(t, bytesutil.PadTo([]byte("address1"), 20), payloadPb.Withdrawals[0].Address)
require.Equal(t, uint64(1), payloadPb.Withdrawals[0].Amount)
require.Equal(t, uint64(2), payloadPb.Withdrawals[1].WithdrawalIndex)
require.Equal(t, uint64(2), payloadPb.Withdrawals[1].Index)
require.Equal(t, types.ValidatorIndex(2), payloadPb.Withdrawals[1].ValidatorIndex)
require.DeepEqual(t, bytesutil.PadTo([]byte("address2"), 20), payloadPb.Withdrawals[1].ExecutionAddress)
require.DeepEqual(t, bytesutil.PadTo([]byte("address2"), 20), payloadPb.Withdrawals[1].Address)
require.Equal(t, uint64(2), payloadPb.Withdrawals[1].Amount)
})
}
Expand Down

0 comments on commit 4605a6d

Please sign in to comment.