mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-07 22:54:17 -05:00
Remove unused variables, functions and more (#15264)
This commit is contained in:
@@ -5,46 +5,6 @@ import (
|
||||
ethpbalpha "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1"
|
||||
)
|
||||
|
||||
// V1Alpha1SignedHeaderToV1 converts a v1alpha1 signed beacon block header to v1.
|
||||
func V1Alpha1SignedHeaderToV1(v1alpha1Hdr *ethpbalpha.SignedBeaconBlockHeader) *ethpbv1.SignedBeaconBlockHeader {
|
||||
if v1alpha1Hdr == nil || v1alpha1Hdr.Header == nil {
|
||||
return ðpbv1.SignedBeaconBlockHeader{}
|
||||
}
|
||||
return ðpbv1.SignedBeaconBlockHeader{
|
||||
Message: V1Alpha1HeaderToV1(v1alpha1Hdr.Header),
|
||||
Signature: v1alpha1Hdr.Signature,
|
||||
}
|
||||
}
|
||||
|
||||
// V1Alpha1HeaderToV1 converts a v1alpha1 beacon block header to v1.
|
||||
func V1Alpha1HeaderToV1(v1alpha1Hdr *ethpbalpha.BeaconBlockHeader) *ethpbv1.BeaconBlockHeader {
|
||||
if v1alpha1Hdr == nil {
|
||||
return ðpbv1.BeaconBlockHeader{}
|
||||
}
|
||||
|
||||
return ðpbv1.BeaconBlockHeader{
|
||||
Slot: v1alpha1Hdr.Slot,
|
||||
ProposerIndex: v1alpha1Hdr.ProposerIndex,
|
||||
ParentRoot: v1alpha1Hdr.ParentRoot,
|
||||
StateRoot: v1alpha1Hdr.StateRoot,
|
||||
BodyRoot: v1alpha1Hdr.BodyRoot,
|
||||
}
|
||||
}
|
||||
|
||||
// V1HeaderToV1Alpha1 converts a v1 beacon block header to v1alpha1.
|
||||
func V1HeaderToV1Alpha1(v1Header *ethpbv1.BeaconBlockHeader) *ethpbalpha.BeaconBlockHeader {
|
||||
if v1Header == nil {
|
||||
return ðpbalpha.BeaconBlockHeader{}
|
||||
}
|
||||
return ðpbalpha.BeaconBlockHeader{
|
||||
Slot: v1Header.Slot,
|
||||
ProposerIndex: v1Header.ProposerIndex,
|
||||
ParentRoot: v1Header.ParentRoot,
|
||||
StateRoot: v1Header.StateRoot,
|
||||
BodyRoot: v1Header.BodyRoot,
|
||||
}
|
||||
}
|
||||
|
||||
// V1ValidatorToV1Alpha1 converts a v1 validator to v1alpha1.
|
||||
func V1ValidatorToV1Alpha1(v1Validator *ethpbv1.Validator) *ethpbalpha.Validator {
|
||||
if v1Validator == nil {
|
||||
|
||||
@@ -886,25 +886,6 @@ func genPayloadDeneb() *enginev1.ExecutionPayloadDeneb {
|
||||
|
||||
var genPayloadElectra = genPayloadDeneb
|
||||
|
||||
func genPayloadHeader() *enginev1.ExecutionPayloadHeader {
|
||||
return &enginev1.ExecutionPayloadHeader{
|
||||
ParentHash: bytes(32),
|
||||
FeeRecipient: bytes(32),
|
||||
StateRoot: bytes(32),
|
||||
ReceiptsRoot: bytes(32),
|
||||
LogsBloom: bytes(32),
|
||||
PrevRandao: bytes(32),
|
||||
BlockNumber: 1,
|
||||
GasLimit: 2,
|
||||
GasUsed: 3,
|
||||
Timestamp: 4,
|
||||
ExtraData: bytes(32),
|
||||
BaseFeePerGas: bytes(32),
|
||||
BlockHash: bytes(32),
|
||||
TransactionsRoot: bytes(32),
|
||||
}
|
||||
}
|
||||
|
||||
func genPayloadHeaderCapella() *enginev1.ExecutionPayloadHeaderCapella {
|
||||
return &enginev1.ExecutionPayloadHeaderCapella{
|
||||
ParentHash: bytes(32),
|
||||
@@ -949,14 +930,6 @@ func genPayloadHeaderDeneb() *enginev1.ExecutionPayloadHeaderDeneb {
|
||||
|
||||
var genPayloadHeaderElectra = genPayloadHeaderDeneb
|
||||
|
||||
func genWithdrawals(num int) []*enginev1.Withdrawal {
|
||||
ws := make([]*enginev1.Withdrawal, num)
|
||||
for i := 0; i < num; i++ {
|
||||
ws[i] = genWithdrawal()
|
||||
}
|
||||
return ws
|
||||
}
|
||||
|
||||
func genWithdrawal() *enginev1.Withdrawal {
|
||||
return &enginev1.Withdrawal{
|
||||
Index: 123456,
|
||||
|
||||
Reference in New Issue
Block a user