consensus

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package consensus is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consensus

type Consensus interface {
	// CurrentHeight returns the current greenfield height - 1,
	CurrentHeight(ctx context.Context) (uint64, error)
	// HasAccount returns an indicator whether the account has been created.
	HasAccount(ctx context.Context, account string) (bool, error)
	// ListSPs returns all SP info.
	ListSPs(ctx context.Context) ([]*sptypes.StorageProvider, error)
	// QuerySP returns the sp info by operator address.
	QuerySP(context.Context, string) (*sptypes.StorageProvider, error)
	// QuerySPByID returns the sp info by sp id.
	QuerySPByID(context.Context, uint32) (*sptypes.StorageProvider, error)
	// QuerySPFreeQuota returns the sp free quota by operator address.
	QuerySPFreeQuota(context.Context, string) (uint64, error)
	// QuerySPPrice returns the sp price info
	QuerySPPrice(ctx context.Context, operatorAddress string) (sptypes.SpStoragePrice, error)
	// ListBondedValidators returns all bonded validators info.
	ListBondedValidators(ctx context.Context) ([]stakingtypes.Validator, error)
	// ListVirtualGroupFamilies return all virtual group family which primary sp is spID.
	ListVirtualGroupFamilies(ctx context.Context, spID uint32) ([]*virtualgrouptypes.GlobalVirtualGroupFamily, error)
	// QueryVirtualGroupFamily return the virtual group family info.
	QueryVirtualGroupFamily(ctx context.Context, vgfID uint32) (*virtualgrouptypes.GlobalVirtualGroupFamily, error)
	// QueryGlobalVirtualGroup returns the global virtual group info.
	QueryGlobalVirtualGroup(ctx context.Context, gvgID uint32) (*virtualgrouptypes.GlobalVirtualGroup, error)
	// ListGlobalVirtualGroupsByFamilyID returns gvg list by family.
	ListGlobalVirtualGroupsByFamilyID(ctx context.Context, vgfID uint32) ([]*virtualgrouptypes.GlobalVirtualGroup, error)
	// AvailableGlobalVirtualGroupFamilies submits a list global virtual group families Id to chain and return the filtered families which are able to serve create bucket request.
	AvailableGlobalVirtualGroupFamilies(ctx context.Context, globalVirtualGroupFamiliesIDs []uint32) ([]uint32, error)
	// QueryVirtualGroupParams returns the virtual group params.
	QueryVirtualGroupParams(ctx context.Context) (*virtualgrouptypes.Params, error)
	// QueryStorageParams returns the storage params.
	QueryStorageParams(ctx context.Context) (params *storagetypes.Params, err error)
	// QueryStorageParamsByTimestamp returns the storage params by block create time.
	QueryStorageParamsByTimestamp(ctx context.Context, timestamp int64) (params *storagetypes.Params, err error)
	// QueryBucketInfo returns the bucket info by bucket name.
	QueryBucketInfo(ctx context.Context, bucket string) (*storagetypes.BucketInfo, error)
	// QueryBucketInfoById returns the bucket info by bucket id.
	QueryBucketInfoById(ctx context.Context, bucketId uint64) (bucketInfo *storagetypes.BucketInfo, err error)
	// QueryObjectInfo returns the object info by bucket and object name.
	QueryObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.ObjectInfo, error)
	// QueryObjectInfoByID returns the object info by object ID.
	QueryObjectInfoByID(ctx context.Context, objectID string) (*storagetypes.ObjectInfo, error)
	// QueryBucketInfoAndObjectInfo returns the bucket and object info by bucket and object name.
	QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*storagetypes.BucketInfo, *storagetypes.ObjectInfo, error)
	// QueryPaymentStreamRecord returns the account payment status.
	QueryPaymentStreamRecord(ctx context.Context, account string) (*paymenttypes.StreamRecord, error)
	// VerifyGetObjectPermission returns an indicator whether the account has permission to get object.
	VerifyGetObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
	// VerifyPutObjectPermission returns an indicator whether the account has permission to put object.
	VerifyPutObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)
	// ListenObjectSeal returns an indicator whether the object is successfully sealed before timeOutHeight.
	ListenObjectSeal(ctx context.Context, objectID uint64, timeOutHeight int) (bool, error)
	// ListenRejectUnSealObject returns an indication of the object is rejected.
	ListenRejectUnSealObject(ctx context.Context, objectID uint64, timeoutHeight int) (bool, error)
	// ConfirmTransaction is used to confirm whether the transaction is on the chain.
	ConfirmTransaction(ctx context.Context, txHash string) (*sdk.TxResponse, error)
	// WaitForNextBlock is used to chain generate a new block.
	WaitForNextBlock(ctx context.Context) error
	// Close the Consensus interface.
	Close() error
}

Consensus is the interface to query greenfield consensus data. the consensus data can come from validator, full-node, or other off-chain data service

type MockConsensus added in v0.2.4

type MockConsensus struct {
	// contains filtered or unexported fields
}

MockConsensus is a mock of Consensus interface.

func NewMockConsensus added in v0.2.4

func NewMockConsensus(ctrl *gomock.Controller) *MockConsensus

NewMockConsensus creates a new mock instance.

func (*MockConsensus) AvailableGlobalVirtualGroupFamilies added in v0.2.4

func (m *MockConsensus) AvailableGlobalVirtualGroupFamilies(ctx context.Context, globalVirtualGroupFamiliesIDs []uint32) ([]uint32, error)

AvailableGlobalVirtualGroupFamilies mocks base method.

func (*MockConsensus) Close added in v0.2.4

func (m *MockConsensus) Close() error

Close mocks base method.

func (*MockConsensus) ConfirmTransaction added in v0.2.4

func (m *MockConsensus) ConfirmTransaction(ctx context.Context, txHash string) (*types3.TxResponse, error)

ConfirmTransaction mocks base method.

func (*MockConsensus) CurrentHeight added in v0.2.4

func (m *MockConsensus) CurrentHeight(ctx context.Context) (uint64, error)

CurrentHeight mocks base method.

func (*MockConsensus) EXPECT added in v0.2.4

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockConsensus) HasAccount added in v0.2.4

func (m *MockConsensus) HasAccount(ctx context.Context, account string) (bool, error)

HasAccount mocks base method.

func (*MockConsensus) ListBondedValidators added in v0.2.4

func (m *MockConsensus) ListBondedValidators(ctx context.Context) ([]types4.Validator, error)

ListBondedValidators mocks base method.

func (*MockConsensus) ListGlobalVirtualGroupsByFamilyID added in v0.2.4

func (m *MockConsensus) ListGlobalVirtualGroupsByFamilyID(ctx context.Context, vgfID uint32) ([]*types2.GlobalVirtualGroup, error)

ListGlobalVirtualGroupsByFamilyID mocks base method.

func (*MockConsensus) ListSPs added in v0.2.4

func (m *MockConsensus) ListSPs(ctx context.Context) ([]*types0.StorageProvider, error)

ListSPs mocks base method.

func (*MockConsensus) ListVirtualGroupFamilies added in v0.2.4

func (m *MockConsensus) ListVirtualGroupFamilies(ctx context.Context, spID uint32) ([]*types2.GlobalVirtualGroupFamily, error)

ListVirtualGroupFamilies mocks base method.

func (*MockConsensus) ListenObjectSeal added in v0.2.4

func (m *MockConsensus) ListenObjectSeal(ctx context.Context, objectID uint64, timeOutHeight int) (bool, error)

ListenObjectSeal mocks base method.

func (*MockConsensus) ListenRejectUnSealObject added in v0.2.4

func (m *MockConsensus) ListenRejectUnSealObject(ctx context.Context, objectID uint64, timeoutHeight int) (bool, error)

ListenRejectUnSealObject mocks base method.

func (*MockConsensus) QueryBucketInfo added in v0.2.4

func (m *MockConsensus) QueryBucketInfo(ctx context.Context, bucket string) (*types1.BucketInfo, error)

QueryBucketInfo mocks base method.

func (*MockConsensus) QueryBucketInfoAndObjectInfo added in v0.2.4

func (m *MockConsensus) QueryBucketInfoAndObjectInfo(ctx context.Context, bucket, object string) (*types1.BucketInfo, *types1.ObjectInfo, error)

QueryBucketInfoAndObjectInfo mocks base method.

func (*MockConsensus) QueryBucketInfoById added in v0.2.4

func (m *MockConsensus) QueryBucketInfoById(ctx context.Context, bucketId uint64) (*types1.BucketInfo, error)

QueryBucketInfoById mocks base method.

func (*MockConsensus) QueryGlobalVirtualGroup added in v0.2.4

func (m *MockConsensus) QueryGlobalVirtualGroup(ctx context.Context, gvgID uint32) (*types2.GlobalVirtualGroup, error)

QueryGlobalVirtualGroup mocks base method.

func (*MockConsensus) QueryObjectInfo added in v0.2.4

func (m *MockConsensus) QueryObjectInfo(ctx context.Context, bucket, object string) (*types1.ObjectInfo, error)

QueryObjectInfo mocks base method.

func (*MockConsensus) QueryObjectInfoByID added in v0.2.4

func (m *MockConsensus) QueryObjectInfoByID(ctx context.Context, objectID string) (*types1.ObjectInfo, error)

QueryObjectInfoByID mocks base method.

func (*MockConsensus) QueryPaymentStreamRecord added in v0.2.4

func (m *MockConsensus) QueryPaymentStreamRecord(ctx context.Context, account string) (*types.StreamRecord, error)

QueryPaymentStreamRecord mocks base method.

func (*MockConsensus) QuerySP added in v0.2.4

func (m *MockConsensus) QuerySP(arg0 context.Context, arg1 string) (*types0.StorageProvider, error)

QuerySP mocks base method.

func (*MockConsensus) QuerySPByID added in v0.2.4

func (m *MockConsensus) QuerySPByID(arg0 context.Context, arg1 uint32) (*types0.StorageProvider, error)

QuerySPByID mocks base method.

func (*MockConsensus) QuerySPFreeQuota added in v0.2.4

func (m *MockConsensus) QuerySPFreeQuota(arg0 context.Context, arg1 string) (uint64, error)

QuerySPFreeQuota mocks base method.

func (*MockConsensus) QuerySPPrice added in v0.2.4

func (m *MockConsensus) QuerySPPrice(ctx context.Context, operatorAddress string) (types0.SpStoragePrice, error)

QuerySPPrice mocks base method.

func (*MockConsensus) QueryStorageParams added in v0.2.4

func (m *MockConsensus) QueryStorageParams(ctx context.Context) (*types1.Params, error)

QueryStorageParams mocks base method.

func (*MockConsensus) QueryStorageParamsByTimestamp added in v0.2.4

func (m *MockConsensus) QueryStorageParamsByTimestamp(ctx context.Context, timestamp int64) (*types1.Params, error)

QueryStorageParamsByTimestamp mocks base method.

func (*MockConsensus) QueryVirtualGroupFamily added in v0.2.4

func (m *MockConsensus) QueryVirtualGroupFamily(ctx context.Context, vgfID uint32) (*types2.GlobalVirtualGroupFamily, error)

QueryVirtualGroupFamily mocks base method.

func (*MockConsensus) QueryVirtualGroupParams added in v0.2.4

func (m *MockConsensus) QueryVirtualGroupParams(ctx context.Context) (*types2.Params, error)

QueryVirtualGroupParams mocks base method.

func (*MockConsensus) VerifyGetObjectPermission added in v0.2.4

func (m *MockConsensus) VerifyGetObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)

VerifyGetObjectPermission mocks base method.

func (*MockConsensus) VerifyPutObjectPermission added in v0.2.4

func (m *MockConsensus) VerifyPutObjectPermission(ctx context.Context, account, bucket, object string) (bool, error)

VerifyPutObjectPermission mocks base method.

func (*MockConsensus) WaitForNextBlock added in v0.2.4

func (m *MockConsensus) WaitForNextBlock(ctx context.Context) error

WaitForNextBlock mocks base method.

type MockConsensusMockRecorder added in v0.2.4

type MockConsensusMockRecorder struct {
	// contains filtered or unexported fields
}

MockConsensusMockRecorder is the mock recorder for MockConsensus.

func (*MockConsensusMockRecorder) AvailableGlobalVirtualGroupFamilies added in v0.2.4

func (mr *MockConsensusMockRecorder) AvailableGlobalVirtualGroupFamilies(ctx, globalVirtualGroupFamiliesIDs interface{}) *gomock.Call

AvailableGlobalVirtualGroupFamilies indicates an expected call of AvailableGlobalVirtualGroupFamilies.

func (*MockConsensusMockRecorder) Close added in v0.2.4

func (mr *MockConsensusMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockConsensusMockRecorder) ConfirmTransaction added in v0.2.4

func (mr *MockConsensusMockRecorder) ConfirmTransaction(ctx, txHash interface{}) *gomock.Call

ConfirmTransaction indicates an expected call of ConfirmTransaction.

func (*MockConsensusMockRecorder) CurrentHeight added in v0.2.4

func (mr *MockConsensusMockRecorder) CurrentHeight(ctx interface{}) *gomock.Call

CurrentHeight indicates an expected call of CurrentHeight.

func (*MockConsensusMockRecorder) HasAccount added in v0.2.4

func (mr *MockConsensusMockRecorder) HasAccount(ctx, account interface{}) *gomock.Call

HasAccount indicates an expected call of HasAccount.

func (*MockConsensusMockRecorder) ListBondedValidators added in v0.2.4

func (mr *MockConsensusMockRecorder) ListBondedValidators(ctx interface{}) *gomock.Call

ListBondedValidators indicates an expected call of ListBondedValidators.

func (*MockConsensusMockRecorder) ListGlobalVirtualGroupsByFamilyID added in v0.2.4

func (mr *MockConsensusMockRecorder) ListGlobalVirtualGroupsByFamilyID(ctx, vgfID interface{}) *gomock.Call

ListGlobalVirtualGroupsByFamilyID indicates an expected call of ListGlobalVirtualGroupsByFamilyID.

func (*MockConsensusMockRecorder) ListSPs added in v0.2.4

func (mr *MockConsensusMockRecorder) ListSPs(ctx interface{}) *gomock.Call

ListSPs indicates an expected call of ListSPs.

func (*MockConsensusMockRecorder) ListVirtualGroupFamilies added in v0.2.4

func (mr *MockConsensusMockRecorder) ListVirtualGroupFamilies(ctx, spID interface{}) *gomock.Call

ListVirtualGroupFamilies indicates an expected call of ListVirtualGroupFamilies.

func (*MockConsensusMockRecorder) ListenObjectSeal added in v0.2.4

func (mr *MockConsensusMockRecorder) ListenObjectSeal(ctx, objectID, timeOutHeight interface{}) *gomock.Call

ListenObjectSeal indicates an expected call of ListenObjectSeal.

func (*MockConsensusMockRecorder) ListenRejectUnSealObject added in v0.2.4

func (mr *MockConsensusMockRecorder) ListenRejectUnSealObject(ctx, objectID, timeoutHeight interface{}) *gomock.Call

ListenRejectUnSealObject indicates an expected call of ListenRejectUnSealObject.

func (*MockConsensusMockRecorder) QueryBucketInfo added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryBucketInfo(ctx, bucket interface{}) *gomock.Call

QueryBucketInfo indicates an expected call of QueryBucketInfo.

func (*MockConsensusMockRecorder) QueryBucketInfoAndObjectInfo added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryBucketInfoAndObjectInfo(ctx, bucket, object interface{}) *gomock.Call

QueryBucketInfoAndObjectInfo indicates an expected call of QueryBucketInfoAndObjectInfo.

func (*MockConsensusMockRecorder) QueryBucketInfoById added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryBucketInfoById(ctx, bucketId interface{}) *gomock.Call

QueryBucketInfoById indicates an expected call of QueryBucketInfoById.

func (*MockConsensusMockRecorder) QueryGlobalVirtualGroup added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryGlobalVirtualGroup(ctx, gvgID interface{}) *gomock.Call

QueryGlobalVirtualGroup indicates an expected call of QueryGlobalVirtualGroup.

func (*MockConsensusMockRecorder) QueryObjectInfo added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryObjectInfo(ctx, bucket, object interface{}) *gomock.Call

QueryObjectInfo indicates an expected call of QueryObjectInfo.

func (*MockConsensusMockRecorder) QueryObjectInfoByID added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryObjectInfoByID(ctx, objectID interface{}) *gomock.Call

QueryObjectInfoByID indicates an expected call of QueryObjectInfoByID.

func (*MockConsensusMockRecorder) QueryPaymentStreamRecord added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryPaymentStreamRecord(ctx, account interface{}) *gomock.Call

QueryPaymentStreamRecord indicates an expected call of QueryPaymentStreamRecord.

func (*MockConsensusMockRecorder) QuerySP added in v0.2.4

func (mr *MockConsensusMockRecorder) QuerySP(arg0, arg1 interface{}) *gomock.Call

QuerySP indicates an expected call of QuerySP.

func (*MockConsensusMockRecorder) QuerySPByID added in v0.2.4

func (mr *MockConsensusMockRecorder) QuerySPByID(arg0, arg1 interface{}) *gomock.Call

QuerySPByID indicates an expected call of QuerySPByID.

func (*MockConsensusMockRecorder) QuerySPFreeQuota added in v0.2.4

func (mr *MockConsensusMockRecorder) QuerySPFreeQuota(arg0, arg1 interface{}) *gomock.Call

QuerySPFreeQuota indicates an expected call of QuerySPFreeQuota.

func (*MockConsensusMockRecorder) QuerySPPrice added in v0.2.4

func (mr *MockConsensusMockRecorder) QuerySPPrice(ctx, operatorAddress interface{}) *gomock.Call

QuerySPPrice indicates an expected call of QuerySPPrice.

func (*MockConsensusMockRecorder) QueryStorageParams added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryStorageParams(ctx interface{}) *gomock.Call

QueryStorageParams indicates an expected call of QueryStorageParams.

func (*MockConsensusMockRecorder) QueryStorageParamsByTimestamp added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryStorageParamsByTimestamp(ctx, timestamp interface{}) *gomock.Call

QueryStorageParamsByTimestamp indicates an expected call of QueryStorageParamsByTimestamp.

func (*MockConsensusMockRecorder) QueryVirtualGroupFamily added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryVirtualGroupFamily(ctx, vgfID interface{}) *gomock.Call

QueryVirtualGroupFamily indicates an expected call of QueryVirtualGroupFamily.

func (*MockConsensusMockRecorder) QueryVirtualGroupParams added in v0.2.4

func (mr *MockConsensusMockRecorder) QueryVirtualGroupParams(ctx interface{}) *gomock.Call

QueryVirtualGroupParams indicates an expected call of QueryVirtualGroupParams.

func (*MockConsensusMockRecorder) VerifyGetObjectPermission added in v0.2.4

func (mr *MockConsensusMockRecorder) VerifyGetObjectPermission(ctx, account, bucket, object interface{}) *gomock.Call

VerifyGetObjectPermission indicates an expected call of VerifyGetObjectPermission.

func (*MockConsensusMockRecorder) VerifyPutObjectPermission added in v0.2.4

func (mr *MockConsensusMockRecorder) VerifyPutObjectPermission(ctx, account, bucket, object interface{}) *gomock.Call

VerifyPutObjectPermission indicates an expected call of VerifyPutObjectPermission.

func (*MockConsensusMockRecorder) WaitForNextBlock added in v0.2.4

func (mr *MockConsensusMockRecorder) WaitForNextBlock(ctx interface{}) *gomock.Call

WaitForNextBlock indicates an expected call of WaitForNextBlock.

type NullConsensus

type NullConsensus struct{}

func (*NullConsensus) AvailableGlobalVirtualGroupFamilies added in v0.2.4

func (*NullConsensus) AvailableGlobalVirtualGroupFamilies(context.Context, []uint32) ([]uint32, error)

func (*NullConsensus) Close

func (*NullConsensus) Close() error

func (*NullConsensus) ConfirmTransaction added in v0.2.4

func (*NullConsensus) ConfirmTransaction(context.Context, string) (*sdk.TxResponse, error)

func (*NullConsensus) CurrentHeight

func (*NullConsensus) CurrentHeight(context.Context) (uint64, error)

func (*NullConsensus) HasAccount

func (*NullConsensus) HasAccount(context.Context, string) (bool, error)

func (*NullConsensus) ListBondedValidators

func (*NullConsensus) ListBondedValidators(context.Context) ([]stakingtypes.Validator, error)

func (*NullConsensus) ListGlobalVirtualGroupsByFamilyID added in v0.2.3

func (*NullConsensus) ListGlobalVirtualGroupsByFamilyID(context.Context, uint32) ([]*virtualgrouptypes.GlobalVirtualGroup, error)

func (*NullConsensus) ListSPs

func (*NullConsensus) ListVirtualGroupFamilies added in v0.2.3

func (*NullConsensus) ListenObjectSeal

func (*NullConsensus) ListenObjectSeal(context.Context, uint64, int) (bool, error)

func (*NullConsensus) ListenRejectUnSealObject

func (*NullConsensus) ListenRejectUnSealObject(context.Context, uint64, int) (bool, error)

func (*NullConsensus) QueryBucketInfo

func (*NullConsensus) QueryBucketInfoAndObjectInfo

func (*NullConsensus) QueryBucketInfoById added in v0.2.3

func (*NullConsensus) QueryBucketInfoById(context.Context, uint64) (*storagetypes.BucketInfo, error)

func (*NullConsensus) QueryGlobalVirtualGroup added in v0.2.3

func (*NullConsensus) QueryObjectInfo

func (*NullConsensus) QueryObjectInfoByID

func (*NullConsensus) QueryObjectInfoByID(context.Context, string) (*storagetypes.ObjectInfo, error)

func (*NullConsensus) QueryPaymentStreamRecord

func (*NullConsensus) QueryPaymentStreamRecord(context.Context, string) (*paymenttypes.StreamRecord, error)

func (*NullConsensus) QuerySP added in v0.2.3

func (*NullConsensus) QuerySPByID added in v0.2.3

func (*NullConsensus) QuerySPFreeQuota added in v0.2.3

func (*NullConsensus) QuerySPFreeQuota(context.Context, string) (uint64, error)

func (*NullConsensus) QuerySPPrice added in v0.2.3

func (*NullConsensus) QueryStorageParams

func (*NullConsensus) QueryStorageParams(context.Context) (*storagetypes.Params, error)

func (*NullConsensus) QueryStorageParamsByTimestamp

func (*NullConsensus) QueryStorageParamsByTimestamp(context.Context, int64) (*storagetypes.Params, error)

func (*NullConsensus) QueryVirtualGroupFamily added in v0.2.3

func (*NullConsensus) QueryVirtualGroupParams added in v0.2.3

func (*NullConsensus) QueryVirtualGroupParams(context.Context) (*virtualgrouptypes.Params, error)

func (*NullConsensus) VerifyGetObjectPermission

func (*NullConsensus) VerifyGetObjectPermission(context.Context, string, string, string) (bool, error)

func (*NullConsensus) VerifyPutObjectPermission

func (*NullConsensus) VerifyPutObjectPermission(context.Context, string, string, string) (bool, error)

func (*NullConsensus) WaitForNextBlock added in v0.2.4

func (*NullConsensus) WaitForNextBlock(context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL