Documentation ¶
Overview ¶
Package serviceblock is a generated GoMock package.
Index ¶
- type BlockService
- func (svc *BlockService) GetBlockByHash(ctx context.Context, hash common.Hash) (*models.Block, error)
- func (svc *BlockService) GetBlockByNumber(ctx context.Context, number *big.Int) (*models.Block, error)
- func (svc *BlockService) GetBlockHeaderByHash(ctx context.Context, hash common.Hash) (*models.Block, error)
- func (svc *BlockService) GetBlockHeaderByNumber(ctx context.Context, number *big.Int) (*models.Block, error)
- type MockRepository
- func (m *MockRepository) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (m *MockRepository) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (m *MockRepository) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) BlockByHash(ctx, hash interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) BlockByNumber(ctx, number interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) HeaderByHash(ctx, hash interface{}) *gomock.Call
- func (mr *MockRepositoryMockRecorder) HeaderByNumber(ctx, number interface{}) *gomock.Call
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockService ¶
type BlockService struct {
// contains filtered or unexported fields
}
BlockService is a block service.
func (*BlockService) GetBlockByHash ¶
func (svc *BlockService) GetBlockByHash(ctx context.Context, hash common.Hash) (*models.Block, error)
GetBlockByHash returns block by hash from repository.
func (*BlockService) GetBlockByNumber ¶
func (svc *BlockService) GetBlockByNumber(ctx context.Context, number *big.Int) (*models.Block, error)
GetBlockByNumber returns block by number from repository.
func (*BlockService) GetBlockHeaderByHash ¶
func (svc *BlockService) GetBlockHeaderByHash(ctx context.Context, hash common.Hash) (*models.Block, error)
GetBlockHeaderByHash returns block by hash from repository.
func (*BlockService) GetBlockHeaderByNumber ¶
func (svc *BlockService) GetBlockHeaderByNumber(ctx context.Context, number *big.Int) (*models.Block, error)
GetBlockHeaderByNumber returns block header by number from repository.
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface.
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance.
func (*MockRepository) BlockByHash ¶
BlockByHash mocks base method.
func (*MockRepository) BlockByNumber ¶
BlockByNumber mocks base method.
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRepository) HeaderByHash ¶
HeaderByHash mocks base method.
func (*MockRepository) HeaderByNumber ¶
func (m *MockRepository) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
HeaderByNumber mocks base method.
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository.
func (*MockRepositoryMockRecorder) BlockByHash ¶
func (mr *MockRepositoryMockRecorder) BlockByHash(ctx, hash interface{}) *gomock.Call
BlockByHash indicates an expected call of BlockByHash.
func (*MockRepositoryMockRecorder) BlockByNumber ¶
func (mr *MockRepositoryMockRecorder) BlockByNumber(ctx, number interface{}) *gomock.Call
BlockByNumber indicates an expected call of BlockByNumber.
func (*MockRepositoryMockRecorder) HeaderByHash ¶
func (mr *MockRepositoryMockRecorder) HeaderByHash(ctx, hash interface{}) *gomock.Call
HeaderByHash indicates an expected call of HeaderByHash.
func (*MockRepositoryMockRecorder) HeaderByNumber ¶
func (mr *MockRepositoryMockRecorder) HeaderByNumber(ctx, number interface{}) *gomock.Call
HeaderByNumber indicates an expected call of HeaderByNumber.
type Repository ¶
type Repository interface { BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) }
Repository is a block repository.