keeper

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetNegFlows added in v0.0.7

func GetNegFlows(flows []types.OutFlow) (negFlows []types.OutFlow)

func MergeSecondarySpObjectsSize added in v0.0.7

func MergeSecondarySpObjectsSize(list []storagetypes.SecondarySpObjectsSize) []storagetypes.SecondarySpObjectsSize

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type CancelCreateObjectOptions added in v0.0.7

type CancelCreateObjectOptions struct {
	SourceType types.SourceType
}

type CopyObjectOptions added in v0.0.7

type CopyObjectOptions struct {
	SourceType        types.SourceType
	IsPublic          bool
	PrimarySpApproval *types.Approval
	ApprovalMsgBytes  []byte
}

type CreateBucketOptions added in v0.0.7

type CreateBucketOptions struct {
	IsPublic          bool
	SourceType        types.SourceType
	ReadQuota         uint64
	PaymentAddress    string
	PrimarySpApproval *types.Approval
	ApprovalMsgBytes  []byte
}

type CreateGroupOptions added in v0.0.7

type CreateGroupOptions struct {
	Members    []string
	SourceType types.SourceType
}

type CreateObjectOptions added in v0.0.7

type CreateObjectOptions struct {
	IsPublic             bool
	ContentType          string
	SourceType           types.SourceType
	RedundancyType       types.RedundancyType
	Checksums            [][]byte
	SecondarySpAddresses []string
	PrimarySpApproval    *types.Approval
	ApprovalMsgBytes     []byte
}

type DeleteBucketOptions added in v0.0.7

type DeleteBucketOptions struct {
	SourceType types.SourceType
}

type DeleteGroupOptions added in v0.0.7

type DeleteGroupOptions struct {
	types.SourceType
}

type DeleteObjectOptions added in v0.0.7

type DeleteObjectOptions struct {
	SourceType types.SourceType
}

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	accountKeeper types.AccountKeeper,
	spKeeper types.SpKeeper,
	paymentKeeper types.PaymentKeeper,
	permKeeper types.PermissionKeeper,

) *Keeper

func (Keeper) CancelCreateObject added in v0.0.7

func (k Keeper) CancelCreateObject(
	ctx sdk.Context, ownAcc sdk.AccAddress,
	bucketName, objectName string, opts CancelCreateObjectOptions) error

func (Keeper) ChargeAccordingToBillChange added in v0.0.7

func (k Keeper) ChargeAccordingToBillChange(ctx sdk.Context, prev, current types.UserFlows) error

func (Keeper) ChargeDeleteObject added in v0.0.7

func (k Keeper) ChargeDeleteObject(ctx sdk.Context, bucketInfo *storagetypes.BucketInfo, objectInfo *storagetypes.ObjectInfo) error

func (Keeper) ChargeInitialReadFee added in v0.0.7

func (k Keeper) ChargeInitialReadFee(ctx sdk.Context, bucketInfo *storagetypes.BucketInfo) error

func (Keeper) ChargeViaBucketChange added in v0.0.7

func (k Keeper) ChargeViaBucketChange(ctx sdk.Context, bucketInfo *storagetypes.BucketInfo, changeFunc func(bucketInfo *storagetypes.BucketInfo) error) error

func (Keeper) CopyObject added in v0.0.7

func (k Keeper) CopyObject(
	ctx sdk.Context, operator sdk.AccAddress, srcBucketName, srcObjectName, dstBucketName, dstObjectName string,
	opts CopyObjectOptions) (sdkmath.Uint, error)

func (Keeper) CreateBucket

func (k Keeper) CreateBucket(
	ctx sdk.Context, ownerAcc sdk.AccAddress, bucketName string,
	primarySpAcc sdk.AccAddress, opts CreateBucketOptions) (sdkmath.Uint, error)

func (Keeper) CreateGroup

func (k Keeper) CreateGroup(
	ctx sdk.Context, owner sdk.AccAddress,
	groupName string, opts CreateGroupOptions) (sdkmath.Uint, error)

func (Keeper) CreateObject

func (k Keeper) CreateObject(
	ctx sdk.Context, ownerAcc sdk.AccAddress, bucketName, objectName string,
	payloadSize uint64, opts CreateObjectOptions) (sdkmath.Uint, error)

func (Keeper) DeleteBucket

func (k Keeper) DeleteBucket(ctx sdk.Context, operator sdk.AccAddress, bucketName string, opts DeleteBucketOptions) error

func (Keeper) DeleteGroup

func (k Keeper) DeleteGroup(ctx sdk.Context, operator sdk.AccAddress, groupName string, opts DeleteGroupOptions) error

func (Keeper) DeleteObject

func (k Keeper) DeleteObject(
	ctx sdk.Context, operator sdk.AccAddress, bucketName, objectName string, opts DeleteObjectOptions) error

func (Keeper) DeletePolicy added in v0.0.7

func (k Keeper) DeletePolicy(ctx sdk.Context, operator sdk.AccAddress, principal *permtypes.Principal,
	grn types2.GRN) (math.Uint,
	error)

func (Keeper) GenNextBucketId added in v0.0.7

func (k Keeper) GenNextBucketId(ctx sdk.Context) sdkmath.Uint

func (Keeper) GenNextGroupId added in v0.0.7

func (k Keeper) GenNextGroupId(ctx sdk.Context) sdkmath.Uint

func (Keeper) GenNextObjectID added in v0.0.7

func (k Keeper) GenNextObjectID(ctx sdk.Context) sdkmath.Uint

func (Keeper) GetBucketBill added in v0.0.7

func (k Keeper) GetBucketBill(ctx sdk.Context, bucketInfo *storagetypes.BucketInfo) (userFlows types.UserFlows, err error)

func (Keeper) GetBucketInfo added in v0.0.7

func (k Keeper) GetBucketInfo(ctx sdk.Context, bucketName string) (*types.BucketInfo, bool)

func (Keeper) GetBucketInfoById added in v0.0.7

func (k Keeper) GetBucketInfoById(ctx sdk.Context, bucketId sdkmath.Uint) (*types.BucketInfo, bool)

func (Keeper) GetChargeSize added in v0.0.7

func (k Keeper) GetChargeSize(ctx sdk.Context, payloadSize uint64, _time int64) uint64

todo(Fynn): refactor when we have a way to record the min charge size parameter history

func (Keeper) GetGroupInfo added in v0.0.7

func (k Keeper) GetGroupInfo(ctx sdk.Context, ownerAddr sdk.AccAddress,
	groupName string) (*types.GroupInfo, bool)

func (Keeper) GetGroupInfoById added in v0.0.7

func (k Keeper) GetGroupInfoById(ctx sdk.Context, groupId sdkmath.Uint) (*types.GroupInfo, bool)

func (Keeper) GetObjectInfo added in v0.0.7

func (k Keeper) GetObjectInfo(ctx sdk.Context, bucketName string, objectName string) (*types.ObjectInfo, bool)

func (Keeper) GetObjectInfoById added in v0.0.7

func (k Keeper) GetObjectInfoById(ctx sdk.Context, objectId sdkmath.Uint) (*types.ObjectInfo, bool)

func (Keeper) GetObjectInfoCount added in v0.0.7

func (k Keeper) GetObjectInfoCount(ctx sdk.Context) sdkmath.Uint

func (Keeper) GetObjectLockFee added in v0.0.7

func (k Keeper) GetObjectLockFee(ctx sdk.Context, primarySpAddress string, priceTime int64, payloadSize uint64) (amount sdkmath.Int, err error)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetPolicy added in v0.0.7

func (Keeper) HeadBucket added in v0.0.6

func (Keeper) HeadBucketById added in v0.0.7

func (Keeper) HeadBucketNFT added in v0.0.7

func (k Keeper) HeadBucketNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryBucketNFTResponse, error)

func (Keeper) HeadGroupNFT added in v0.0.7

func (k Keeper) HeadGroupNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryGroupNFTResponse, error)

func (Keeper) HeadObject added in v0.0.6

func (Keeper) HeadObjectById added in v0.0.7

func (Keeper) HeadObjectNFT added in v0.0.7

func (k Keeper) HeadObjectNFT(goCtx context.Context, req *types.QueryNFTRequest) (*types.QueryObjectNFTResponse, error)

func (Keeper) LeaveGroup added in v0.0.7

func (k Keeper) LeaveGroup(
	ctx sdk.Context, member sdk.AccAddress, owner sdk.AccAddress,
	groupName string, opts LeaveGroupOptions) error

func (Keeper) ListBuckets added in v0.0.6

func (Keeper) ListObjects added in v0.0.6

func (Keeper) ListObjectsByBucketId added in v0.0.7

func (Keeper) LockStoreFee added in v0.0.7

func (k Keeper) LockStoreFee(ctx sdk.Context, bucketInfo *storagetypes.BucketInfo, objectInfo *storagetypes.ObjectInfo) error

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) MaxPayloadSize

func (k Keeper) MaxPayloadSize(ctx sdk.Context) (res uint64)

func (Keeper) MaxSegmentSize

func (k Keeper) MaxSegmentSize(ctx sdk.Context) (res uint64)

func (Keeper) MinChargeSize added in v0.0.7

func (k Keeper) MinChargeSize(ctx sdk.Context) (res uint64)

func (Keeper) Params

func (Keeper) PutPolicy added in v0.0.7

func (k Keeper) PutPolicy(ctx sdk.Context, operator sdk.AccAddress, grn types2.GRN,
	policy *permtypes.Policy) (math.Uint, error)

func (Keeper) RedundantDataChunkNum

func (k Keeper) RedundantDataChunkNum(ctx sdk.Context) (res uint32)

func (Keeper) RedundantParityChunkNum

func (k Keeper) RedundantParityChunkNum(ctx sdk.Context) (res uint32)

func (Keeper) RejectSealObject added in v0.0.7

func (k Keeper) RejectSealObject(ctx sdk.Context, operator sdk.AccAddress, bucketName, objectName string) error

func (Keeper) SealObject added in v0.0.7

func (k Keeper) SealObject(
	ctx sdk.Context, spSealAcc sdk.AccAddress,
	bucketName, objectName string, opts SealObjectOptions) error

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (Keeper) UnlockAndChargeStoreFee added in v0.0.7

func (k Keeper) UnlockAndChargeStoreFee(ctx sdk.Context, bucketInfo *storagetypes.BucketInfo, objectInfo *storagetypes.ObjectInfo) error

func (Keeper) UnlockStoreFee added in v0.0.7

func (k Keeper) UnlockStoreFee(ctx sdk.Context, bucketInfo *storagetypes.BucketInfo, objectInfo *storagetypes.ObjectInfo) error

UnlockStoreFee unlock store fee if the object is deleted in INIT state

func (Keeper) UpdateBucketInfo added in v0.0.7

func (k Keeper) UpdateBucketInfo(ctx sdk.Context, operator sdk.AccAddress, bucketName string, opts UpdateBucketOptions) error

func (Keeper) UpdateBucketInfoAndCharge added in v0.0.7

func (k Keeper) UpdateBucketInfoAndCharge(ctx sdk.Context, bucketInfo *storagetypes.BucketInfo, newPaymentAddr string, newReadQuota uint64) error

func (Keeper) UpdateGroupMember added in v0.0.7

func (k Keeper) UpdateGroupMember(ctx sdk.Context, operator sdk.AccAddress, groupName string, opts UpdateGroupMemberOptions) error

func (Keeper) VerifyBucketPermission added in v0.0.7

func (k Keeper) VerifyBucketPermission(ctx sdk.Context, bucketInfo *types.BucketInfo, operator sdk.AccAddress,
	action permtypes.ActionType, resource *string) permtypes.Effect

func (Keeper) VerifyGroupPermission added in v0.0.7

func (k Keeper) VerifyGroupPermission(ctx sdk.Context, groupInfo *types.GroupInfo, operator sdk.AccAddress,
	action permtypes.ActionType) permtypes.Effect

func (Keeper) VerifyObjectPermission added in v0.0.7

func (k Keeper) VerifyObjectPermission(ctx sdk.Context, bucketInfo *types.BucketInfo, objectInfo *types.ObjectInfo,
	operator sdk.AccAddress, action permtypes.ActionType) permtypes.Effect

func (Keeper) VerifyPaymentAccount added in v0.0.7

func (k Keeper) VerifyPaymentAccount(ctx sdk.Context, paymentAddress string, ownerAcc sdk.AccAddress) (sdk.AccAddress, error)

func (Keeper) VerifyPermission added in v0.0.7

func (Keeper) VerifySPAndSignature added in v0.0.6

func (k Keeper) VerifySPAndSignature(ctx sdk.Context, spAcc sdk.AccAddress, sigData []byte, signature []byte) error

type LeaveGroupOptions added in v0.0.7

type LeaveGroupOptions struct {
	SourceType types.SourceType
}

type SealObjectOptions added in v0.0.7

type SealObjectOptions struct {
	SecondarySpAddresses  []string
	SecondarySpSignatures [][]byte
}

type UpdateBucketOptions added in v0.0.7

type UpdateBucketOptions struct {
	SourceType     types.SourceType
	ReadQuota      uint64
	PaymentAddress string
}

type UpdateGroupMemberOptions added in v0.0.7

type UpdateGroupMemberOptions struct {
	SourceType      types.SourceType
	MembersToAdd    []string
	MembersToDelete []string
}

Jump to

Keyboard shortcuts

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