Documentation ¶
Index ¶
- Constants
- type MockSentry
- func Mock(tb testing.TB) *MockSentry
- func MockWithEverything(tb testing.TB, gspec *types.Genesis, key *ecdsa.PrivateKey, prune prune.Mode, ...) *MockSentry
- func MockWithGenesis(tb testing.TB, gspec *types.Genesis, key *ecdsa.PrivateKey, ...) *MockSentry
- func MockWithGenesisEngine(tb testing.TB, gspec *types.Genesis, engine consensus.Engine, ...) *MockSentry
- func MockWithGenesisPruneMode(tb testing.TB, gspec *types.Genesis, key *ecdsa.PrivateKey, ...) *MockSentry
- func MockWithTxPool(t *testing.T) *MockSentry
- func MockWithZeroTTD(t *testing.T, withPosDownloader bool) *MockSentry
- func MockWithZeroTTDGnosis(t *testing.T, withPosDownloader bool) *MockSentry
- func (ms *MockSentry) BlocksIO() (services.FullBlockReader, *blockio.BlockWriter)
- func (ms *MockSentry) CalcStateRoot(tx kv.Tx) libcommon.Hash
- func (ms *MockSentry) Close()
- func (ms *MockSentry) EnableLogs()
- func (ms *MockSentry) HandShake(ctx context.Context, in *emptypb.Empty) (*proto_sentry.HandShakeReply, error)
- func (ms *MockSentry) HeaderDownload() *headerdownload.HeaderDownload
- func (ms *MockSentry) HistoryV3Components() *libstate.AggregatorV3
- func (ms *MockSentry) InsertChain(chain *core.ChainPack) error
- func (ms *MockSentry) Messages(req *proto_sentry.MessagesRequest, stream proto_sentry.Sentry_MessagesServer) error
- func (ms *MockSentry) NewHistoryStateReader(blockNum uint64, tx kv.Tx) state.StateReader
- func (ms *MockSentry) NewStateReader(tx kv.Tx) state.StateReader
- func (ms *MockSentry) NewStateWriter(tx kv.RwTx, blockNum uint64) state.StateWriter
- func (ms *MockSentry) NodeInfo(context.Context, *emptypb.Empty) (*ptypes.NodeInfoReply, error)
- func (ms *MockSentry) PeerById(context.Context, *proto_sentry.PeerByIdRequest) (*proto_sentry.PeerByIdReply, error)
- func (ms *MockSentry) PeerCount(context.Context, *proto_sentry.PeerCountRequest) (*proto_sentry.PeerCountReply, error)
- func (ms *MockSentry) PeerEvents(req *proto_sentry.PeerEventsRequest, ...) error
- func (ms *MockSentry) PeerMinBlock(context.Context, *proto_sentry.PeerMinBlockRequest) (*emptypb.Empty, error)
- func (ms *MockSentry) Peers(context.Context, *emptypb.Empty) (*proto_sentry.PeersReply, error)
- func (ms *MockSentry) PenalizePeer(context.Context, *proto_sentry.PenalizePeerRequest) (*emptypb.Empty, error)
- func (ms *MockSentry) Send(req *proto_sentry.InboundMessage) (errs []error)
- func (ms *MockSentry) SendMessageById(_ context.Context, r *proto_sentry.SendMessageByIdRequest) (*proto_sentry.SentPeers, error)
- func (ms *MockSentry) SendMessageByMinBlock(_ context.Context, r *proto_sentry.SendMessageByMinBlockRequest) (*proto_sentry.SentPeers, error)
- func (ms *MockSentry) SendMessageToAll(_ context.Context, r *proto_sentry.OutboundMessageData) (*proto_sentry.SentPeers, error)
- func (ms *MockSentry) SendMessageToRandomPeers(_ context.Context, r *proto_sentry.SendMessageToRandomPeersRequest) (*proto_sentry.SentPeers, error)
- func (ms *MockSentry) SentMessage(i int) *proto_sentry.OutboundMessageData
- func (ms *MockSentry) SetStatus(context.Context, *proto_sentry.StatusData) (*proto_sentry.SetStatusReply, error)
Constants ¶
View Source
const MockInsertAsInitialCycle = false
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockSentry ¶
type MockSentry struct { proto_sentry.UnimplementedSentryServer Ctx context.Context Log log.Logger DB kv.RwDB Dirs datadir.Dirs Engine consensus.Engine ChainConfig *chain.Config Sync *stagedsync.Sync MiningSync *stagedsync.Sync PendingBlocks chan *types.Block MinedBlocks chan *types.Block Key *ecdsa.PrivateKey Genesis *types.Block SentryClient direct.SentryClient PeerId *ptypes.H512 UpdateHead func(Ctx context.Context, headHeight, headTime uint64, hash libcommon.Hash, td *uint256.Int) StreamWg sync.WaitGroup ReceiveWg sync.WaitGroup Address libcommon.Address Eth1ExecutionService *eth1.EthereumExecutionModule Notifications *shards.Notifications // TxPool TxPoolFetch *txpool.Fetch TxPoolSend *txpool.Send TxPoolGrpcServer *txpool.GrpcServer TxPool *txpool.TxPool HistoryV3 bool BlockSnapshots *freezeblocks.RoSnapshots BlockReader services.FullBlockReader // contains filtered or unexported fields }
func Mock ¶
func Mock(tb testing.TB) *MockSentry
Mock is convenience function to create a mock with some pre-set values
func MockWithEverything ¶
func MockWithGenesis ¶
func MockWithGenesis(tb testing.TB, gspec *types.Genesis, key *ecdsa.PrivateKey, withPosDownloader bool) *MockSentry
func MockWithGenesisEngine ¶
func MockWithTxPool ¶
func MockWithTxPool(t *testing.T) *MockSentry
func MockWithZeroTTD ¶
func MockWithZeroTTD(t *testing.T, withPosDownloader bool) *MockSentry
func MockWithZeroTTDGnosis ¶
func MockWithZeroTTDGnosis(t *testing.T, withPosDownloader bool) *MockSentry
func (*MockSentry) BlocksIO ¶
func (ms *MockSentry) BlocksIO() (services.FullBlockReader, *blockio.BlockWriter)
func (*MockSentry) CalcStateRoot ¶
func (ms *MockSentry) CalcStateRoot(tx kv.Tx) libcommon.Hash
func (*MockSentry) Close ¶
func (ms *MockSentry) Close()
func (*MockSentry) EnableLogs ¶
func (ms *MockSentry) EnableLogs()
func (*MockSentry) HandShake ¶
func (ms *MockSentry) HandShake(ctx context.Context, in *emptypb.Empty) (*proto_sentry.HandShakeReply, error)
func (*MockSentry) HeaderDownload ¶
func (ms *MockSentry) HeaderDownload() *headerdownload.HeaderDownload
func (*MockSentry) HistoryV3Components ¶
func (ms *MockSentry) HistoryV3Components() *libstate.AggregatorV3
func (*MockSentry) InsertChain ¶
func (ms *MockSentry) InsertChain(chain *core.ChainPack) error
func (*MockSentry) Messages ¶
func (ms *MockSentry) Messages(req *proto_sentry.MessagesRequest, stream proto_sentry.Sentry_MessagesServer) error
func (*MockSentry) NewHistoryStateReader ¶
func (ms *MockSentry) NewHistoryStateReader(blockNum uint64, tx kv.Tx) state.StateReader
func (*MockSentry) NewStateReader ¶
func (ms *MockSentry) NewStateReader(tx kv.Tx) state.StateReader
func (*MockSentry) NewStateWriter ¶
func (ms *MockSentry) NewStateWriter(tx kv.RwTx, blockNum uint64) state.StateWriter
func (*MockSentry) NodeInfo ¶
func (ms *MockSentry) NodeInfo(context.Context, *emptypb.Empty) (*ptypes.NodeInfoReply, error)
func (*MockSentry) PeerById ¶
func (ms *MockSentry) PeerById(context.Context, *proto_sentry.PeerByIdRequest) (*proto_sentry.PeerByIdReply, error)
func (*MockSentry) PeerCount ¶
func (ms *MockSentry) PeerCount(context.Context, *proto_sentry.PeerCountRequest) (*proto_sentry.PeerCountReply, error)
func (*MockSentry) PeerEvents ¶
func (ms *MockSentry) PeerEvents(req *proto_sentry.PeerEventsRequest, server proto_sentry.Sentry_PeerEventsServer) error
func (*MockSentry) PeerMinBlock ¶
func (ms *MockSentry) PeerMinBlock(context.Context, *proto_sentry.PeerMinBlockRequest) (*emptypb.Empty, error)
func (*MockSentry) Peers ¶
func (ms *MockSentry) Peers(context.Context, *emptypb.Empty) (*proto_sentry.PeersReply, error)
func (*MockSentry) PenalizePeer ¶
func (ms *MockSentry) PenalizePeer(context.Context, *proto_sentry.PenalizePeerRequest) (*emptypb.Empty, error)
func (*MockSentry) Send ¶
func (ms *MockSentry) Send(req *proto_sentry.InboundMessage) (errs []error)
Stream returns stream, waiting if necessary
func (*MockSentry) SendMessageById ¶
func (ms *MockSentry) SendMessageById(_ context.Context, r *proto_sentry.SendMessageByIdRequest) (*proto_sentry.SentPeers, error)
func (*MockSentry) SendMessageByMinBlock ¶
func (ms *MockSentry) SendMessageByMinBlock(_ context.Context, r *proto_sentry.SendMessageByMinBlockRequest) (*proto_sentry.SentPeers, error)
func (*MockSentry) SendMessageToAll ¶
func (ms *MockSentry) SendMessageToAll(_ context.Context, r *proto_sentry.OutboundMessageData) (*proto_sentry.SentPeers, error)
func (*MockSentry) SendMessageToRandomPeers ¶
func (ms *MockSentry) SendMessageToRandomPeers(_ context.Context, r *proto_sentry.SendMessageToRandomPeersRequest) (*proto_sentry.SentPeers, error)
func (*MockSentry) SentMessage ¶
func (ms *MockSentry) SentMessage(i int) *proto_sentry.OutboundMessageData
func (*MockSentry) SetStatus ¶
func (ms *MockSentry) SetStatus(context.Context, *proto_sentry.StatusData) (*proto_sentry.SetStatusReply, error)
Click to show internal directories.
Click to hide internal directories.