Skip to content

Commit

Permalink
test added for verifier.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Redidacove committed Jul 21, 2024
1 parent c0ff839 commit 8b98ae6
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions consensus-types/payload-attestation/verifier_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package payloadattestation

import (
"testing"

"github.com/prysmaticlabs/prysm/v5/beacon-chain/startup"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/testing/assert"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
)

func TestVerifyCurrentSlot(t *testing.T){
clock:=&startup.Clock{}
verifier:=&PayloadVerifier{
Resources: Resources{
clock: clock,
},
}
assert.Equal(t, verifier.VerifyCurrentSlot(), ErrMismatchCurrentSlot)
}

func TestVerifyKnownPayloadStatus(t *testing.T){
ptcstatus:= primitives.PTCStatus(4)
verifier:=&PayloadVerifier{
payloadAtt: ReadOnlyPayloadAtt{
message: &ethpb.PayloadAttestationMessage{
Data: &ethpb.PayloadAttestationData{
PayloadStatus:ptcstatus,
},
},
},
}
assert.Equal(t, verifier.VerifyKnownPayloadStatus(), ErrUnknownPayloadStatus)
}

0 comments on commit 8b98ae6

Please sign in to comment.