prysm-pulse/beacon-chain/p2p/testing/mock_metadataprovider.go
Radosław Kapka 2d75b12791
Implement GetIdentity in the node API (#8230)
* initial implementation

* register metadata provider

* final implementation

* tests

* fixed imports

* gazelle

* code review

* small cleanup

* change errors.Wrap to status.Errorf

* gazelle + goimports

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-01-14 20:48:40 +00:00

19 lines
411 B
Go

package testing
import pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
// MockMetadataProvider is a fake implementation of the MetadataProvider interface.
type MockMetadataProvider struct {
Data *pb.MetaData
}
// Metadata --
func (m *MockMetadataProvider) Metadata() *pb.MetaData {
return m.Data
}
// MetadataSeq --
func (m *MockMetadataProvider) MetadataSeq() uint64 {
return m.Data.SeqNumber
}