mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Refactor Exported Names to Follow Golang Best Practices (#13075)
* Fix exported names that start with a package name * A few more renames * Fix exported names that start with a package name * A few more renames * Radek's feedback * Fix conflict * fix keymanager test * Fix comments --------- Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
@@ -25,7 +25,7 @@ import (
|
||||
func (km *Keymanager) listenForAccountChanges(ctx context.Context) {
|
||||
debounceFileChangesInterval := features.Get().KeystoreImportDebounceInterval
|
||||
accountsFilePath := filepath.Join(km.wallet.AccountsDir(), AccountsPath, AccountsKeystoreFileName)
|
||||
if !file.FileExists(accountsFilePath) {
|
||||
if !file.Exists(accountsFilePath) {
|
||||
return
|
||||
}
|
||||
watcher, err := fsnotify.NewWatcher()
|
||||
|
||||
@@ -45,7 +45,7 @@ func TestMapAggregateAndProof(t *testing.T) {
|
||||
},
|
||||
want: &v1.AggregateAndProof{
|
||||
AggregatorIndex: "0",
|
||||
Aggregate: mock.MockAttestation(),
|
||||
Aggregate: mock.Attestation(),
|
||||
SelectionProof: make([]byte, fieldparams.BLSSignatureLength),
|
||||
},
|
||||
wantErr: false,
|
||||
@@ -92,7 +92,7 @@ func TestMapAttestation(t *testing.T) {
|
||||
Signature: make([]byte, 96),
|
||||
},
|
||||
},
|
||||
want: mock.MockAttestation(),
|
||||
want: mock.Attestation(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -133,7 +133,7 @@ func TestMapAttestationData(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
want: mock.MockAttestation().Data,
|
||||
want: mock.Attestation().Data,
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -194,8 +194,8 @@ func TestMapAttesterSlashing(t *testing.T) {
|
||||
},
|
||||
},
|
||||
want: &v1.AttesterSlashing{
|
||||
Attestation1: mock.MockIndexedAttestation(),
|
||||
Attestation2: mock.MockIndexedAttestation(),
|
||||
Attestation1: mock.IndexedAttestation(),
|
||||
Attestation2: mock.IndexedAttestation(),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
@@ -331,12 +331,12 @@ func TestMapBeaconBlockAltair(t *testing.T) {
|
||||
},
|
||||
SyncAggregate: ðpb.SyncAggregate{
|
||||
SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength),
|
||||
SyncCommitteeBits: mock.MockSyncComitteeBits(),
|
||||
SyncCommitteeBits: mock.SyncComitteeBits(),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
want: mock.MockBeaconBlockAltair(),
|
||||
want: mock.BeaconBlockAltair(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -466,7 +466,7 @@ func TestMapBeaconBlockBody(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
want: mock.MockBeaconBlockBody(),
|
||||
want: mock.BeaconBlockBody(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -503,13 +503,13 @@ func TestMapContributionAndProof(t *testing.T) {
|
||||
Slot: 0,
|
||||
BlockRoot: make([]byte, fieldparams.RootLength),
|
||||
SubcommitteeIndex: 0,
|
||||
AggregationBits: mock.MockAggregationBits(),
|
||||
AggregationBits: mock.AggregationBits(),
|
||||
Signature: make([]byte, fieldparams.BLSSignatureLength),
|
||||
},
|
||||
SelectionProof: make([]byte, fieldparams.BLSSignatureLength),
|
||||
},
|
||||
},
|
||||
want: mock.MockContributionAndProof(),
|
||||
want: mock.ContributionAndProof(),
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
@@ -544,7 +544,7 @@ func TestMapForkInfo(t *testing.T) {
|
||||
slot: 0,
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockForkInfo(),
|
||||
want: mock.ForkInfo(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
//////////////// Mock Requests //////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
func MockSyncComitteeBits() []byte {
|
||||
func SyncComitteeBits() []byte {
|
||||
currSize := new(eth.SyncAggregate).SyncCommitteeBits.Len()
|
||||
switch currSize {
|
||||
case 512:
|
||||
@@ -30,7 +30,7 @@ func MockSyncComitteeBits() []byte {
|
||||
}
|
||||
}
|
||||
|
||||
func MockAggregationBits() []byte {
|
||||
func AggregationBits() []byte {
|
||||
currSize := new(eth.SyncCommitteeContribution).AggregationBits.Len()
|
||||
switch currSize {
|
||||
case 128:
|
||||
@@ -322,7 +322,7 @@ func GetMockSignRequest(t string) *validatorpb.SignRequest {
|
||||
},
|
||||
SyncAggregate: ð.SyncAggregate{
|
||||
SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength),
|
||||
SyncCommitteeBits: MockSyncComitteeBits(),
|
||||
SyncCommitteeBits: SyncComitteeBits(),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -405,7 +405,7 @@ func GetMockSignRequest(t string) *validatorpb.SignRequest {
|
||||
Slot: 0,
|
||||
BlockRoot: make([]byte, fieldparams.RootLength),
|
||||
SubcommitteeIndex: 0,
|
||||
AggregationBits: MockAggregationBits(),
|
||||
AggregationBits: AggregationBits(),
|
||||
Signature: make([]byte, fieldparams.BLSSignatureLength),
|
||||
},
|
||||
SelectionProof: make([]byte, fieldparams.BLSSignatureLength),
|
||||
@@ -513,73 +513,73 @@ func GetMockSignRequest(t string) *validatorpb.SignRequest {
|
||||
}
|
||||
}
|
||||
|
||||
// MockAggregationSlotSignRequest is a mock implementation of the AggregationSlotSignRequest.
|
||||
func MockAggregationSlotSignRequest() *v1.AggregationSlotSignRequest {
|
||||
// AggregationSlotSignRequest is a mock implementation of the AggregationSlotSignRequest.
|
||||
func AggregationSlotSignRequest() *v1.AggregationSlotSignRequest {
|
||||
return &v1.AggregationSlotSignRequest{
|
||||
Type: "AGGREGATION_SLOT",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
AggregationSlot: &v1.AggregationSlot{Slot: "0"},
|
||||
}
|
||||
}
|
||||
|
||||
// MockAggregateAndProofSignRequest is a mock implementation of the AggregateAndProofSignRequest.
|
||||
func MockAggregateAndProofSignRequest() *v1.AggregateAndProofSignRequest {
|
||||
// AggregateAndProofSignRequest is a mock implementation of the AggregateAndProofSignRequest.
|
||||
func AggregateAndProofSignRequest() *v1.AggregateAndProofSignRequest {
|
||||
return &v1.AggregateAndProofSignRequest{
|
||||
Type: "AGGREGATE_AND_PROOF",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
AggregateAndProof: &v1.AggregateAndProof{
|
||||
AggregatorIndex: "0",
|
||||
Aggregate: MockAttestation(),
|
||||
Aggregate: Attestation(),
|
||||
SelectionProof: make([]byte, fieldparams.BLSSignatureLength),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// MockAttestationSignRequest is a mock implementation of the AttestationSignRequest.
|
||||
func MockAttestationSignRequest() *v1.AttestationSignRequest {
|
||||
// AttestationSignRequest is a mock implementation of the AttestationSignRequest.
|
||||
func AttestationSignRequest() *v1.AttestationSignRequest {
|
||||
return &v1.AttestationSignRequest{
|
||||
Type: "ATTESTATION",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
Attestation: MockAttestation().Data,
|
||||
Attestation: Attestation().Data,
|
||||
}
|
||||
}
|
||||
|
||||
// MockBlockSignRequest is a mock implementation of the BlockSignRequest.
|
||||
func MockBlockSignRequest() *v1.BlockSignRequest {
|
||||
// BlockSignRequest is a mock implementation of the BlockSignRequest.
|
||||
func BlockSignRequest() *v1.BlockSignRequest {
|
||||
return &v1.BlockSignRequest{
|
||||
Type: "BLOCK",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
Block: &v1.BeaconBlock{
|
||||
Slot: "0",
|
||||
ProposerIndex: "0",
|
||||
ParentRoot: make([]byte, fieldparams.RootLength),
|
||||
StateRoot: make([]byte, fieldparams.RootLength),
|
||||
Body: MockBeaconBlockBody(),
|
||||
Body: BeaconBlockBody(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// MockBlockV2AltairSignRequest is a mock implementation of the BlockAltairSignRequest.
|
||||
func MockBlockV2AltairSignRequest() *v1.BlockAltairSignRequest {
|
||||
// BlockV2AltairSignRequest is a mock implementation of the BlockAltairSignRequest.
|
||||
func BlockV2AltairSignRequest() *v1.BlockAltairSignRequest {
|
||||
return &v1.BlockAltairSignRequest{
|
||||
Type: "BLOCK_V2",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
BeaconBlock: &v1.BeaconBlockAltairBlockV2{
|
||||
Version: "ALTAIR",
|
||||
Block: MockBeaconBlockAltair(),
|
||||
Block: BeaconBlockAltair(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func MockBlockV2BlindedSignRequest(bodyRoot []byte, version string) *v1.BlockV2BlindedSignRequest {
|
||||
func BlockV2BlindedSignRequest(bodyRoot []byte, version string) *v1.BlockV2BlindedSignRequest {
|
||||
return &v1.BlockV2BlindedSignRequest{
|
||||
Type: "BLOCK_V2",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
BeaconBlock: &v1.BeaconBlockV2Blinded{
|
||||
Version: version,
|
||||
@@ -594,11 +594,11 @@ func MockBlockV2BlindedSignRequest(bodyRoot []byte, version string) *v1.BlockV2B
|
||||
}
|
||||
}
|
||||
|
||||
// MockRandaoRevealSignRequest is a mock implementation of the RandaoRevealSignRequest.
|
||||
func MockRandaoRevealSignRequest() *v1.RandaoRevealSignRequest {
|
||||
// RandaoRevealSignRequest is a mock implementation of the RandaoRevealSignRequest.
|
||||
func RandaoRevealSignRequest() *v1.RandaoRevealSignRequest {
|
||||
return &v1.RandaoRevealSignRequest{
|
||||
Type: "RANDAO_REVEAL",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
RandaoReveal: &v1.RandaoReveal{
|
||||
Epoch: "0",
|
||||
@@ -606,21 +606,21 @@ func MockRandaoRevealSignRequest() *v1.RandaoRevealSignRequest {
|
||||
}
|
||||
}
|
||||
|
||||
// MockSyncCommitteeContributionAndProofSignRequest is a mock implementation of the SyncCommitteeContributionAndProofSignRequest.
|
||||
func MockSyncCommitteeContributionAndProofSignRequest() *v1.SyncCommitteeContributionAndProofSignRequest {
|
||||
// SyncCommitteeContributionAndProofSignRequest is a mock implementation of the SyncCommitteeContributionAndProofSignRequest.
|
||||
func SyncCommitteeContributionAndProofSignRequest() *v1.SyncCommitteeContributionAndProofSignRequest {
|
||||
return &v1.SyncCommitteeContributionAndProofSignRequest{
|
||||
Type: "SYNC_COMMITTEE_CONTRIBUTION_AND_PROOF",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
ContributionAndProof: MockContributionAndProof(),
|
||||
ContributionAndProof: ContributionAndProof(),
|
||||
}
|
||||
}
|
||||
|
||||
// MockSyncCommitteeMessageSignRequest is a mock implementation of the SyncCommitteeMessageSignRequest.
|
||||
func MockSyncCommitteeMessageSignRequest() *v1.SyncCommitteeMessageSignRequest {
|
||||
// SyncCommitteeMessageSignRequest is a mock implementation of the SyncCommitteeMessageSignRequest.
|
||||
func SyncCommitteeMessageSignRequest() *v1.SyncCommitteeMessageSignRequest {
|
||||
return &v1.SyncCommitteeMessageSignRequest{
|
||||
Type: "SYNC_COMMITTEE_MESSAGE",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
SyncCommitteeMessage: &v1.SyncCommitteeMessage{
|
||||
BeaconBlockRoot: make([]byte, fieldparams.RootLength),
|
||||
@@ -629,11 +629,11 @@ func MockSyncCommitteeMessageSignRequest() *v1.SyncCommitteeMessageSignRequest {
|
||||
}
|
||||
}
|
||||
|
||||
// MockSyncCommitteeSelectionProofSignRequest is a mock implementation of the SyncCommitteeSelectionProofSignRequest.
|
||||
func MockSyncCommitteeSelectionProofSignRequest() *v1.SyncCommitteeSelectionProofSignRequest {
|
||||
// SyncCommitteeSelectionProofSignRequest is a mock implementation of the SyncCommitteeSelectionProofSignRequest.
|
||||
func SyncCommitteeSelectionProofSignRequest() *v1.SyncCommitteeSelectionProofSignRequest {
|
||||
return &v1.SyncCommitteeSelectionProofSignRequest{
|
||||
Type: "SYNC_COMMITTEE_SELECTION_PROOF",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
SyncAggregatorSelectionData: &v1.SyncAggregatorSelectionData{
|
||||
Slot: "0",
|
||||
@@ -642,11 +642,11 @@ func MockSyncCommitteeSelectionProofSignRequest() *v1.SyncCommitteeSelectionProo
|
||||
}
|
||||
}
|
||||
|
||||
// MockVoluntaryExitSignRequest is a mock implementation of the VoluntaryExitSignRequest.
|
||||
func MockVoluntaryExitSignRequest() *v1.VoluntaryExitSignRequest {
|
||||
// VoluntaryExitSignRequest is a mock implementation of the VoluntaryExitSignRequest.
|
||||
func VoluntaryExitSignRequest() *v1.VoluntaryExitSignRequest {
|
||||
return &v1.VoluntaryExitSignRequest{
|
||||
Type: "VOLUNTARY_EXIT",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
VoluntaryExit: &v1.VoluntaryExit{
|
||||
Epoch: "0",
|
||||
@@ -655,8 +655,8 @@ func MockVoluntaryExitSignRequest() *v1.VoluntaryExitSignRequest {
|
||||
}
|
||||
}
|
||||
|
||||
// MockValidatorRegistrationSignRequest is a mock implementation of the ValidatorRegistrationSignRequest.
|
||||
func MockValidatorRegistrationSignRequest() *v1.ValidatorRegistrationSignRequest {
|
||||
// ValidatorRegistrationSignRequest is a mock implementation of the ValidatorRegistrationSignRequest.
|
||||
func ValidatorRegistrationSignRequest() *v1.ValidatorRegistrationSignRequest {
|
||||
return &v1.ValidatorRegistrationSignRequest{
|
||||
Type: "VALIDATOR_REGISTRATION",
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
@@ -669,8 +669,8 @@ func MockValidatorRegistrationSignRequest() *v1.ValidatorRegistrationSignRequest
|
||||
}
|
||||
}
|
||||
|
||||
// MockBlobSidecarSignRequest is a mock implementation of the BlobSidecarSignRequest.
|
||||
func MockBlobSidecarSignRequest() *v1.BlobSidecarSignRequest {
|
||||
// BlobSidecarSignRequest is a mock implementation of the BlobSidecarSignRequest.
|
||||
func BlobSidecarSignRequest() *v1.BlobSidecarSignRequest {
|
||||
blobRoot, err := ssz.ByteSliceRoot(make([]byte, fieldparams.BlobLength), fieldparams.BlobLength)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
@@ -678,7 +678,7 @@ func MockBlobSidecarSignRequest() *v1.BlobSidecarSignRequest {
|
||||
}
|
||||
return &v1.BlobSidecarSignRequest{
|
||||
Type: "BLOB_SIDECAR",
|
||||
ForkInfo: MockForkInfo(),
|
||||
ForkInfo: ForkInfo(),
|
||||
SigningRoot: make([]byte, fieldparams.RootLength),
|
||||
BlobSidecar: &v1.BlobSidecar{
|
||||
BlockRoot: make([]byte, fieldparams.RootLength),
|
||||
@@ -697,8 +697,8 @@ func MockBlobSidecarSignRequest() *v1.BlobSidecarSignRequest {
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// MockForkInfo is a mock implementation of the ForkInfo.
|
||||
func MockForkInfo() *v1.ForkInfo {
|
||||
// ForkInfo is a mock implementation of the ForkInfo.
|
||||
func ForkInfo() *v1.ForkInfo {
|
||||
return &v1.ForkInfo{
|
||||
Fork: &v1.Fork{
|
||||
PreviousVersion: make([]byte, 4),
|
||||
@@ -709,8 +709,8 @@ func MockForkInfo() *v1.ForkInfo {
|
||||
}
|
||||
}
|
||||
|
||||
// MockAttestation is a mock implementation of the Attestation.
|
||||
func MockAttestation() *v1.Attestation {
|
||||
// Attestation is a mock implementation of the Attestation.
|
||||
func Attestation() *v1.Attestation {
|
||||
return &v1.Attestation{
|
||||
AggregationBits: []byte(bitfield.Bitlist{0b1101}),
|
||||
Data: &v1.AttestationData{
|
||||
@@ -730,7 +730,7 @@ func MockAttestation() *v1.Attestation {
|
||||
}
|
||||
}
|
||||
|
||||
func MockIndexedAttestation() *v1.IndexedAttestation {
|
||||
func IndexedAttestation() *v1.IndexedAttestation {
|
||||
return &v1.IndexedAttestation{
|
||||
AttestingIndices: []string{"0", "1", "2"},
|
||||
Data: &v1.AttestationData{
|
||||
@@ -750,7 +750,7 @@ func MockIndexedAttestation() *v1.IndexedAttestation {
|
||||
}
|
||||
}
|
||||
|
||||
func MockBeaconBlockAltair() *v1.BeaconBlockAltair {
|
||||
func BeaconBlockAltair() *v1.BeaconBlockAltair {
|
||||
return &v1.BeaconBlockAltair{
|
||||
Slot: "0",
|
||||
ProposerIndex: "0",
|
||||
@@ -790,12 +790,12 @@ func MockBeaconBlockAltair() *v1.BeaconBlockAltair {
|
||||
},
|
||||
AttesterSlashings: []*v1.AttesterSlashing{
|
||||
{
|
||||
Attestation1: MockIndexedAttestation(),
|
||||
Attestation2: MockIndexedAttestation(),
|
||||
Attestation1: IndexedAttestation(),
|
||||
Attestation2: IndexedAttestation(),
|
||||
},
|
||||
},
|
||||
Attestations: []*v1.Attestation{
|
||||
MockAttestation(),
|
||||
Attestation(),
|
||||
},
|
||||
Deposits: []*v1.Deposit{
|
||||
{
|
||||
@@ -819,13 +819,13 @@ func MockBeaconBlockAltair() *v1.BeaconBlockAltair {
|
||||
},
|
||||
SyncAggregate: &v1.SyncAggregate{
|
||||
SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength),
|
||||
SyncCommitteeBits: MockSyncComitteeBits(),
|
||||
SyncCommitteeBits: SyncComitteeBits(),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func MockBeaconBlockBody() *v1.BeaconBlockBody {
|
||||
func BeaconBlockBody() *v1.BeaconBlockBody {
|
||||
return &v1.BeaconBlockBody{
|
||||
RandaoReveal: make([]byte, 32),
|
||||
Eth1Data: &v1.Eth1Data{
|
||||
@@ -860,12 +860,12 @@ func MockBeaconBlockBody() *v1.BeaconBlockBody {
|
||||
},
|
||||
AttesterSlashings: []*v1.AttesterSlashing{
|
||||
{
|
||||
Attestation1: MockIndexedAttestation(),
|
||||
Attestation2: MockIndexedAttestation(),
|
||||
Attestation1: IndexedAttestation(),
|
||||
Attestation2: IndexedAttestation(),
|
||||
},
|
||||
},
|
||||
Attestations: []*v1.Attestation{
|
||||
MockAttestation(),
|
||||
Attestation(),
|
||||
},
|
||||
Deposits: []*v1.Deposit{
|
||||
{
|
||||
@@ -890,14 +890,14 @@ func MockBeaconBlockBody() *v1.BeaconBlockBody {
|
||||
}
|
||||
}
|
||||
|
||||
func MockContributionAndProof() *v1.ContributionAndProof {
|
||||
func ContributionAndProof() *v1.ContributionAndProof {
|
||||
return &v1.ContributionAndProof{
|
||||
AggregatorIndex: "0",
|
||||
Contribution: &v1.SyncCommitteeContribution{
|
||||
Slot: "0",
|
||||
BeaconBlockRoot: make([]byte, fieldparams.RootLength),
|
||||
SubcommitteeIndex: "0",
|
||||
AggregationBits: MockAggregationBits(),
|
||||
AggregationBits: AggregationBits(),
|
||||
Signature: make([]byte, fieldparams.BLSSignatureLength),
|
||||
},
|
||||
SelectionProof: make([]byte, fieldparams.BLSSignatureLength),
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestGetAggregateAndProofSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("AGGREGATE_AND_PROOF"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockAggregateAndProofSignRequest(),
|
||||
want: mock.AggregateAndProofSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -64,7 +64,7 @@ func TestGetAggregationSlotSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("AGGREGATION_SLOT"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockAggregationSlotSignRequest(),
|
||||
want: mock.AggregationSlotSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -99,7 +99,7 @@ func TestGetAttestationSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("ATTESTATION"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockAttestationSignRequest(),
|
||||
want: mock.AttestationSignRequest(),
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
@@ -133,7 +133,7 @@ func TestGetBlockSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("BLOCK"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockBlockSignRequest(),
|
||||
want: mock.BlockSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -168,7 +168,7 @@ func TestGetBlockV2AltairSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("BLOCK_V2"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockBlockV2AltairSignRequest(),
|
||||
want: mock.BlockV2AltairSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -203,7 +203,7 @@ func TestGetRandaoRevealSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("RANDAO_REVEAL"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockRandaoRevealSignRequest(),
|
||||
want: mock.RandaoRevealSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -238,7 +238,7 @@ func TestGetSyncCommitteeContributionAndProofSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("SYNC_COMMITTEE_CONTRIBUTION_AND_PROOF"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockSyncCommitteeContributionAndProofSignRequest(),
|
||||
want: mock.SyncCommitteeContributionAndProofSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -273,7 +273,7 @@ func TestGetSyncCommitteeMessageSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("SYNC_COMMITTEE_MESSAGE"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockSyncCommitteeMessageSignRequest(),
|
||||
want: mock.SyncCommitteeMessageSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -308,7 +308,7 @@ func TestGetSyncCommitteeSelectionProofSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("SYNC_COMMITTEE_SELECTION_PROOF"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockSyncCommitteeSelectionProofSignRequest(),
|
||||
want: mock.SyncCommitteeSelectionProofSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -343,7 +343,7 @@ func TestGetVoluntaryExitSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("VOLUNTARY_EXIT"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockVoluntaryExitSignRequest(),
|
||||
want: mock.VoluntaryExitSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -378,7 +378,7 @@ func TestGetBlockV2BlindedSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("BLOCK_V2_BELLATRIX"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockBlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
want: mock.BlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
bytevalue, err := hexutil.Decode("0xcd7c49966ebe72b1214e6d4733adf6bf06935c5fbc3b3ad08e84e3085428b82f")
|
||||
require.NoError(t, err)
|
||||
return bytevalue
|
||||
@@ -391,7 +391,7 @@ func TestGetBlockV2BlindedSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("BLOCK_V2_BLINDED_BELLATRIX"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockBlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
want: mock.BlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
bytevalue, err := hexutil.Decode("0xbabb9c2d10dd3f16dc50e31fd6eb270c9c5e95a6dcb5a1eb34389ef28194285b")
|
||||
require.NoError(t, err)
|
||||
return bytevalue
|
||||
@@ -404,7 +404,7 @@ func TestGetBlockV2BlindedSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("BLOCK_V2_CAPELLA"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockBlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
want: mock.BlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
bytevalue, err := hexutil.Decode("0x74b4bb048d39c75f175fbb2311062eb9867d79b712907f39544fcaf2d7e1b433")
|
||||
require.NoError(t, err)
|
||||
return bytevalue
|
||||
@@ -417,7 +417,7 @@ func TestGetBlockV2BlindedSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("BLOCK_V2_BLINDED_CAPELLA"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockBlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
want: mock.BlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
bytevalue, err := hexutil.Decode("0x54797f27f45a91d2cf4d73e509c62e464d648ec34e07ddba946adee742039e76")
|
||||
require.NoError(t, err)
|
||||
return bytevalue
|
||||
@@ -430,7 +430,7 @@ func TestGetBlockV2BlindedSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("BLOCK_V2_DENEB"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockBlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
want: mock.BlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
bytevalue, err := hexutil.Decode("0xbce73ee2c617851846af2b3ea2287e3b686098e18ae508c7271aaa06ab1d06cd")
|
||||
require.NoError(t, err)
|
||||
return bytevalue
|
||||
@@ -443,7 +443,7 @@ func TestGetBlockV2BlindedSignRequest(t *testing.T) {
|
||||
request: mock.GetMockSignRequest("BLOCK_V2_BLINDED_DENEB"),
|
||||
genesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
},
|
||||
want: mock.MockBlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
want: mock.BlockV2BlindedSignRequest(func(t *testing.T) []byte {
|
||||
bytevalue, err := hexutil.Decode("0xfeb1f7e4f704e72544f4f097b36cb3f3af83043765ad9ad3c3a6cd7fac605055")
|
||||
require.NoError(t, err)
|
||||
return bytevalue
|
||||
@@ -480,7 +480,7 @@ func TestGetBlobSignRequest(t *testing.T) {
|
||||
args: args{
|
||||
request: mock.GetMockSignRequest("BLOB_SIDECAR"),
|
||||
},
|
||||
want: mock.MockBlobSidecarSignRequest(),
|
||||
want: mock.BlobSidecarSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
@@ -488,7 +488,7 @@ func TestGetBlobSignRequest(t *testing.T) {
|
||||
args: args{
|
||||
request: mock.GetMockSignRequest("BLINDED_BLOB_SIDECAR"),
|
||||
},
|
||||
want: mock.MockBlobSidecarSignRequest(),
|
||||
want: mock.BlobSidecarSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
@@ -521,7 +521,7 @@ func TestGetValidatorRegistrationSignRequest(t *testing.T) {
|
||||
args: args{
|
||||
request: mock.GetMockSignRequest("VALIDATOR_REGISTRATION"),
|
||||
},
|
||||
want: mock.MockValidatorRegistrationSignRequest(),
|
||||
want: mock.ValidatorRegistrationSignRequest(),
|
||||
wantErr: false,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user