Documentation ¶
Overview ¶
Package blockchain is a generated GoMock package.
Index ¶
- type Blockchain
- type MockBlockchain
- func (m *MockBlockchain) AddBlock(arg0 context.Context, arg1 *types.Block, arg2 types.Receipts) error
- func (m *MockBlockchain) EXPECT() *MockBlockchainMockRecorder
- func (m *MockBlockchain) GetBlockByHash(arg0 context.Context, arg1 common.Hash) (*types.Block, error)
- func (m *MockBlockchain) GetBlockByNumber(arg0 context.Context, arg1 uint64) (*types.Block, error)
- func (m *MockBlockchain) GetFinalized(arg0 context.Context) (*types.Block, bool, error)
- func (m *MockBlockchain) GetHead(arg0 context.Context) (*types.Block, error)
- func (m *MockBlockchain) GetHeaderByHash(arg0 context.Context, arg1 common.Hash) (*types.Header, error)
- func (m *MockBlockchain) GetHeaderByNumber(arg0 context.Context, arg1 uint64) (*types.Header, error)
- func (m *MockBlockchain) GetReceipt(arg0 context.Context, arg1 common.Hash) (*types.Receipt, common.Hash, uint64, bool, error)
- func (m *MockBlockchain) GetSafe(arg0 context.Context) (*types.Block, bool, error)
- func (m *MockBlockchain) GetTransaction(arg0 context.Context, arg1 common.Hash) (*types.Transaction, common.Hash, uint64, bool, error)
- func (m *MockBlockchain) HasBlock(arg0 context.Context, arg1 common.Hash) (bool, error)
- func (m *MockBlockchain) SetFinalized(arg0 context.Context, arg1 common.Hash) error
- func (m *MockBlockchain) SetHead(arg0 context.Context, arg1 common.Hash) error
- func (m *MockBlockchain) SetSafe(arg0 context.Context, arg1 common.Hash) error
- func (m *MockBlockchain) Shutdown()
- type MockBlockchainMockRecorder
- func (mr *MockBlockchainMockRecorder) AddBlock(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetBlockByHash(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetBlockByNumber(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetFinalized(arg0 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetHead(arg0 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetHeaderByHash(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetHeaderByNumber(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetReceipt(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetSafe(arg0 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) GetTransaction(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) HasBlock(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) SetFinalized(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) SetHead(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) SetSafe(arg0, arg1 any) *gomock.Call
- func (mr *MockBlockchainMockRecorder) Shutdown() *gomock.Call
- type Opts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type Blockchain interface { // HasBlock returns if blockchain contains the block corresponding to the block hash. HasBlock(context.Context, common.Hash) (bool, error) // GetBlockByHash returns the block corresponding to the block hash. GetBlockByHash(context.Context, common.Hash) (*types.Block, error) // GetBlockByNumber returns the block corresponding to the block height. GetBlockByNumber(context.Context, uint64) (*types.Block, error) // GetHeaderByHash returns the header corresponding to the block hash. GetHeaderByHash(context.Context, common.Hash) (*types.Header, error) // GetHeaderByNumber returns the header corresponding to the block height. GetHeaderByNumber(context.Context, uint64) (*types.Header, error) // GetTransaction gets the transaction for given tx hash. GetTransaction(context.Context, common.Hash) (*types.Transaction, common.Hash, uint64, bool, error) // GetReceipt gets the receipt for given tx hash. GetReceipt(context.Context, common.Hash) (*types.Receipt, common.Hash, uint64, bool, error) // GetHead returns the head block. GetHead(context.Context) (*types.Block, error) // GetHead returns the finalized block. GetFinalized(context.Context) (*types.Block, bool, error) // GetSafe returns the safe block. GetSafe(context.Context) (*types.Block, bool, error) // AddBlock adds a *validated* block to the blockchain. AddBlock(context.Context, *types.Block, types.Receipts) error // SetHead sets the head of the chain. SetHead(context.Context, common.Hash) error // SetFinalized sets the finalized block of this chain. SetFinalized(context.Context, common.Hash) error // SetSafe sets the safe block of this chain. SetSafe(context.Context, common.Hash) error // Shutdown safely shuts the blockchain down. Shutdown() }
func NewBlockchainImpl ¶
NewBlockchainImpl creates a new Blockchain.
type MockBlockchain ¶
type MockBlockchain struct {
// contains filtered or unexported fields
}
MockBlockchain is a mock of Blockchain interface.
func NewMockBlockchain ¶
func NewMockBlockchain(ctrl *gomock.Controller) *MockBlockchain
NewMockBlockchain creates a new mock instance.
func (*MockBlockchain) AddBlock ¶
func (m *MockBlockchain) AddBlock(arg0 context.Context, arg1 *types.Block, arg2 types.Receipts) error
AddBlock mocks base method.
func (*MockBlockchain) EXPECT ¶
func (m *MockBlockchain) EXPECT() *MockBlockchainMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBlockchain) GetBlockByHash ¶
func (m *MockBlockchain) GetBlockByHash(arg0 context.Context, arg1 common.Hash) (*types.Block, error)
GetBlockByHash mocks base method.
func (*MockBlockchain) GetBlockByNumber ¶
GetBlockByNumber mocks base method.
func (*MockBlockchain) GetFinalized ¶
GetFinalized mocks base method.
func (*MockBlockchain) GetHeaderByHash ¶
func (m *MockBlockchain) GetHeaderByHash(arg0 context.Context, arg1 common.Hash) (*types.Header, error)
GetHeaderByHash mocks base method.
func (*MockBlockchain) GetHeaderByNumber ¶
func (m *MockBlockchain) GetHeaderByNumber(arg0 context.Context, arg1 uint64) (*types.Header, error)
GetHeaderByNumber mocks base method.
func (*MockBlockchain) GetReceipt ¶
func (m *MockBlockchain) GetReceipt(arg0 context.Context, arg1 common.Hash) (*types.Receipt, common.Hash, uint64, bool, error)
GetReceipt mocks base method.
func (*MockBlockchain) GetTransaction ¶
func (m *MockBlockchain) GetTransaction(arg0 context.Context, arg1 common.Hash) (*types.Transaction, common.Hash, uint64, bool, error)
GetTransaction mocks base method.
func (*MockBlockchain) SetFinalized ¶
SetFinalized mocks base method.
type MockBlockchainMockRecorder ¶
type MockBlockchainMockRecorder struct {
// contains filtered or unexported fields
}
MockBlockchainMockRecorder is the mock recorder for MockBlockchain.
func (*MockBlockchainMockRecorder) AddBlock ¶
func (mr *MockBlockchainMockRecorder) AddBlock(arg0, arg1, arg2 any) *gomock.Call
AddBlock indicates an expected call of AddBlock.
func (*MockBlockchainMockRecorder) GetBlockByHash ¶
func (mr *MockBlockchainMockRecorder) GetBlockByHash(arg0, arg1 any) *gomock.Call
GetBlockByHash indicates an expected call of GetBlockByHash.
func (*MockBlockchainMockRecorder) GetBlockByNumber ¶
func (mr *MockBlockchainMockRecorder) GetBlockByNumber(arg0, arg1 any) *gomock.Call
GetBlockByNumber indicates an expected call of GetBlockByNumber.
func (*MockBlockchainMockRecorder) GetFinalized ¶
func (mr *MockBlockchainMockRecorder) GetFinalized(arg0 any) *gomock.Call
GetFinalized indicates an expected call of GetFinalized.
func (*MockBlockchainMockRecorder) GetHead ¶
func (mr *MockBlockchainMockRecorder) GetHead(arg0 any) *gomock.Call
GetHead indicates an expected call of GetHead.
func (*MockBlockchainMockRecorder) GetHeaderByHash ¶
func (mr *MockBlockchainMockRecorder) GetHeaderByHash(arg0, arg1 any) *gomock.Call
GetHeaderByHash indicates an expected call of GetHeaderByHash.
func (*MockBlockchainMockRecorder) GetHeaderByNumber ¶
func (mr *MockBlockchainMockRecorder) GetHeaderByNumber(arg0, arg1 any) *gomock.Call
GetHeaderByNumber indicates an expected call of GetHeaderByNumber.
func (*MockBlockchainMockRecorder) GetReceipt ¶
func (mr *MockBlockchainMockRecorder) GetReceipt(arg0, arg1 any) *gomock.Call
GetReceipt indicates an expected call of GetReceipt.
func (*MockBlockchainMockRecorder) GetSafe ¶
func (mr *MockBlockchainMockRecorder) GetSafe(arg0 any) *gomock.Call
GetSafe indicates an expected call of GetSafe.
func (*MockBlockchainMockRecorder) GetTransaction ¶
func (mr *MockBlockchainMockRecorder) GetTransaction(arg0, arg1 any) *gomock.Call
GetTransaction indicates an expected call of GetTransaction.
func (*MockBlockchainMockRecorder) HasBlock ¶
func (mr *MockBlockchainMockRecorder) HasBlock(arg0, arg1 any) *gomock.Call
HasBlock indicates an expected call of HasBlock.
func (*MockBlockchainMockRecorder) SetFinalized ¶
func (mr *MockBlockchainMockRecorder) SetFinalized(arg0, arg1 any) *gomock.Call
SetFinalized indicates an expected call of SetFinalized.
func (*MockBlockchainMockRecorder) SetHead ¶
func (mr *MockBlockchainMockRecorder) SetHead(arg0, arg1 any) *gomock.Call
SetHead indicates an expected call of SetHead.
func (*MockBlockchainMockRecorder) SetSafe ¶
func (mr *MockBlockchainMockRecorder) SetSafe(arg0, arg1 any) *gomock.Call
SetSafe indicates an expected call of SetSafe.
func (*MockBlockchainMockRecorder) Shutdown ¶
func (mr *MockBlockchainMockRecorder) Shutdown() *gomock.Call
Shutdown indicates an expected call of Shutdown.