2022-08-17 06:38:57 +00:00
|
|
|
package p2p
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2023-03-17 18:52:56 +00:00
|
|
|
"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"
|
2022-08-17 06:38:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2023-01-26 14:40:12 +00:00
|
|
|
func (m *mockChain) CurrentSlot() primitives.Slot {
|
2022-08-17 06:38:57 +00:00
|
|
|
return slots.SinceGenesis(m.genesisTime)
|
|
|
|
}
|