mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 08:37:37 +00:00
d17996f8b0
* Update V3 from V4 * Fix build v3 -> v4 * Update ssz * Update beacon_chain.pb.go * Fix formatter import * Update update-mockgen.sh comment to v4 * Fix conflicts. Pass build and tests * Fix test
37 lines
778 B
Go
37 lines
778 B
Go
package p2p
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/forkchoice"
|
|
"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
|
|
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/v4/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)
|
|
}
|