prysm-pulse/cmd/prysmctl/p2p/mock_chain.go
terence 5a66807989
Update to V5 (#13622)
* First take at updating everything to v5

* Patch gRPC gateway to use prysm v5

Fix patch

* Update go ssz

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
2024-02-15 05:46:47 +00:00

37 lines
778 B
Go

package p2p
import (
"time"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/forkchoice"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/time/slots"
)
type mockChain struct {
currentFork *ethpb.Fork
genesisValsRoot [32]byte
genesisTime time.Time
}
func (m *mockChain) ForkChoicer() forkchoice.ForkChoicer {
return nil
}
func (m *mockChain) CurrentFork() *ethpb.Fork {
return m.currentFork
}
func (m *mockChain) GenesisValidatorsRoot() [32]byte {
return m.genesisValsRoot
}
func (m *mockChain) GenesisTime() time.Time {
return m.genesisTime
}
func (m *mockChain) CurrentSlot() primitives.Slot {
return slots.SinceGenesis(m.genesisTime)
}