2024-01-06 23:47:09 +00:00
|
|
|
package verification
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2024-02-15 05:46:47 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
|
2024-01-06 23:47:09 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type MockBlobVerifier struct {
|
|
|
|
ErrBlobIndexInBounds error
|
|
|
|
ErrSlotTooEarly error
|
|
|
|
ErrSlotAboveFinalized error
|
|
|
|
ErrValidProposerSignature error
|
|
|
|
ErrSidecarParentSeen error
|
|
|
|
ErrSidecarParentValid error
|
|
|
|
ErrSidecarParentSlotLower error
|
|
|
|
ErrSidecarDescendsFromFinalized error
|
|
|
|
ErrSidecarInclusionProven error
|
|
|
|
ErrSidecarKzgProofVerified error
|
|
|
|
ErrSidecarProposerExpected error
|
|
|
|
cbVerifiedROBlob func() (blocks.VerifiedROBlob, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) VerifiedROBlob() (blocks.VerifiedROBlob, error) {
|
|
|
|
return m.cbVerifiedROBlob()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) BlobIndexInBounds() (err error) {
|
|
|
|
return m.ErrBlobIndexInBounds
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) NotFromFutureSlot() (err error) {
|
|
|
|
return m.ErrSlotTooEarly
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) SlotAboveFinalized() (err error) {
|
|
|
|
return m.ErrSlotAboveFinalized
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) ValidProposerSignature(_ context.Context) (err error) {
|
|
|
|
return m.ErrValidProposerSignature
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) SidecarParentSeen(_ func([32]byte) bool) (err error) {
|
|
|
|
return m.ErrSidecarParentSeen
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) SidecarParentValid(_ func([32]byte) bool) (err error) {
|
|
|
|
return m.ErrSidecarParentValid
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) SidecarParentSlotLower() (err error) {
|
|
|
|
return m.ErrSidecarParentSlotLower
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) SidecarDescendsFromFinalized() (err error) {
|
|
|
|
return m.ErrSidecarDescendsFromFinalized
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) SidecarInclusionProven() (err error) {
|
|
|
|
return m.ErrSidecarInclusionProven
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) SidecarKzgProofVerified() (err error) {
|
|
|
|
return m.ErrSidecarKzgProofVerified
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *MockBlobVerifier) SidecarProposerExpected(_ context.Context) (err error) {
|
|
|
|
return m.ErrSidecarProposerExpected
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*MockBlobVerifier) SatisfyRequirement(_ Requirement) {}
|
|
|
|
|
|
|
|
var _ BlobVerifier = &MockBlobVerifier{}
|