Documentation ¶
Index ¶
- func StartAdminApiServer(t *testing.T, service *AdminServiceMock) string
- func StartServer(t *testing.T, services map[string]interface{}) string
- func StartStateApiServer(t *testing.T, service *StateServiceMock) string
- type AdminServiceMock
- type Option
- func WithError(err error) Option
- func WithInfoResponse(infoResponse *abrpc.NodeInfoResponse) Option
- func WithOwnerUnit(unit *abrpc.Unit[any]) Option
- func WithRoundNumber(roundNumber uint64) Option
- func WithTxProof(txHash []byte, txProof *abrpc.TransactionRecordAndProof) Option
- func WithUnit(unit *abrpc.Unit[any]) Option
- func WithUnits(units ...*abrpc.Unit[any]) Option
- type Options
- type StateServiceMock
- func (s *StateServiceMock) GetBlock(ctx context.Context, roundNumber types.Uint64) (types.Bytes, error)
- func (s *StateServiceMock) GetRoundNumber(ctx context.Context) (types.Uint64, error)
- func (s *StateServiceMock) GetTransactionProof(ctx context.Context, txHash types.Bytes) (*abrpc.TransactionRecordAndProof, error)
- func (s *StateServiceMock) GetUnit(unitID types.UnitID, includeStateProof bool) (*abrpc.Unit[any], error)
- func (s *StateServiceMock) GetUnitsByOwnerID(ownerID types.Bytes) ([]types.UnitID, error)
- func (s *StateServiceMock) Reset()
- func (s *StateServiceMock) SendTransaction(ctx context.Context, tx types.Bytes) (types.Bytes, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartAdminApiServer ¶
func StartAdminApiServer(t *testing.T, service *AdminServiceMock) string
func StartStateApiServer ¶
func StartStateApiServer(t *testing.T, service *StateServiceMock) string
Types ¶
type AdminServiceMock ¶
type AdminServiceMock struct {
InfoResponse *abrpc.NodeInfoResponse
}
func NewAdminServiceMock ¶
func NewAdminServiceMock(opts ...Option) *AdminServiceMock
func (*AdminServiceMock) GetNodeInfo ¶
func (s *AdminServiceMock) GetNodeInfo() (*abrpc.NodeInfoResponse, error)
type Option ¶
type Option func(*Options)
func WithInfoResponse ¶
func WithInfoResponse(infoResponse *abrpc.NodeInfoResponse) Option
func WithRoundNumber ¶
func WithTxProof ¶
func WithTxProof(txHash []byte, txProof *abrpc.TransactionRecordAndProof) Option
type StateServiceMock ¶
type StateServiceMock struct { RoundNumber uint64 Units map[string]*abrpc.Unit[any] OwnerUnitIDs map[string][]types.UnitID TxProofs map[string]*abrpc.TransactionRecordAndProof Block types.Bytes SentTxs map[string]*types.TransactionOrder Err error }
func NewStateServiceMock ¶
func NewStateServiceMock(opts ...Option) *StateServiceMock
func (*StateServiceMock) GetRoundNumber ¶
func (*StateServiceMock) GetTransactionProof ¶
func (s *StateServiceMock) GetTransactionProof(ctx context.Context, txHash types.Bytes) (*abrpc.TransactionRecordAndProof, error)
func (*StateServiceMock) GetUnitsByOwnerID ¶
func (*StateServiceMock) Reset ¶
func (s *StateServiceMock) Reset()
func (*StateServiceMock) SendTransaction ¶
Click to show internal directories.
Click to hide internal directories.