Skip to content

Commit

Permalink
Merge pull request #1153 from bnb-chain/develop
Browse files Browse the repository at this point in the history
release: prepare release for v0.2.6-alpha.2
  • Loading branch information
BarryTong65 authored Sep 19, 2023
2 parents aeeac54 + b536a1b commit 7b88f04
Show file tree
Hide file tree
Showing 12 changed files with 1,011 additions and 651 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.2.6-alpha.2

BUGFIX
* [#1151](https://github.com/bnb-chain/greenfield-storage-provider/pull/1151) fix: update new logic of metadata apis

## v0.2.6-alpha.1

FEATURES
Expand Down
4 changes: 2 additions & 2 deletions base/gfspclient/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type MetadataAPI interface {
GetPaymentByBucketName(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*payment_types.StreamRecord, error)
GetPaymentByBucketID(ctx context.Context, bucketID int64, includePrivate bool, opts ...grpc.DialOption) (*payment_types.StreamRecord, error)
VerifyPermission(ctx context.Context, Operator string, bucketName string, objectName string, actionType permission_types.ActionType, opts ...grpc.DialOption) (*permission_types.Effect, error)
GetBucketMeta(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*types.Bucket, *payment_types.StreamRecord, error)
GetBucketMeta(ctx context.Context, bucketName string, includePrivate bool, opts ...grpc.DialOption) (*types.VGFInfoBucket, *payment_types.StreamRecord, error)
GetEndpointBySpID(ctx context.Context, spID uint32, opts ...grpc.DialOption) (string, error)
GetBucketReadQuota(ctx context.Context, bucket *storagetypes.BucketInfo, yearMonth string, opts ...grpc.DialOption) (uint64, uint64, uint64, uint64, error)
ListBucketReadRecord(ctx context.Context, bucket *storagetypes.BucketInfo, startTimestampUs, endTimestampUs, maxRecordNum int64, opts ...grpc.DialOption) ([]*types.ReadRecord, int64, error)
Expand Down Expand Up @@ -129,7 +129,7 @@ type MetadataAPI interface {
GetUserOwnedGroups(ctx context.Context, accountID string, startAfter uint64, limit uint32, opts ...grpc.DialOption) ([]*types.GroupMember, error)
ListObjectPolicies(ctx context.Context, objectName, bucketName string, startAfter uint64, actionType int32, limit uint32, opts ...grpc.DialOption) ([]*types.Policy, error)
ListPaymentAccountStreams(ctx context.Context, paymentAccount string, opts ...grpc.DialOption) ([]*types.Bucket, error)
ListUserPaymentAccounts(ctx context.Context, accountID string, opts ...grpc.DialOption) ([]*types.StreamRecordMeta, error)
ListUserPaymentAccounts(ctx context.Context, accountID string, opts ...grpc.DialOption) ([]*types.PaymentAccountMeta, error)
ListGroupsByIDs(ctx context.Context, groupIDs []uint64, opts ...grpc.DialOption) (map[uint64]*types.Group, error)
GetSPMigratingBucketNumber(ctx context.Context, spID uint32, opts ...grpc.DialOption) (uint64, error)
VerifyMigrateGVGPermission(ctx context.Context, bucketID uint64, gvgID, dstSpID uint32, opts ...grpc.DialOption) (*permission_types.Effect, error)
Expand Down
148 changes: 46 additions & 102 deletions base/gfspclient/interface_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions base/gfspclient/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (s *GfSpClient) VerifyPermission(ctx context.Context, Operator string, buck

// GetBucketMeta get bucket info along with its related info such as payment
func (s *GfSpClient) GetBucketMeta(ctx context.Context, bucketName string, includePrivate bool,
opts ...grpc.DialOption) (*types.Bucket, *payment_types.StreamRecord, error) {
opts ...grpc.DialOption) (*types.VGFInfoBucket, *payment_types.StreamRecord, error) {
conn, err := s.Connection(ctx, s.metadataEndpoint, opts...)
if err != nil {
return nil, nil, ErrRPCUnknownWithDetail("client failed to connect metadata, error: " + err.Error())
Expand Down Expand Up @@ -870,7 +870,7 @@ func (s *GfSpClient) ListPaymentAccountStreams(ctx context.Context, paymentAccou
return resp.Buckets, nil
}

func (s *GfSpClient) ListUserPaymentAccounts(ctx context.Context, accountID string, opts ...grpc.DialOption) ([]*types.StreamRecordMeta, error) {
func (s *GfSpClient) ListUserPaymentAccounts(ctx context.Context, accountID string, opts ...grpc.DialOption) ([]*types.PaymentAccountMeta, error) {
conn, connErr := s.Connection(ctx, s.metadataEndpoint, opts...)
if connErr != nil {
log.CtxErrorw(ctx, "client failed to connect metadata", "error", connErr)
Expand All @@ -883,7 +883,7 @@ func (s *GfSpClient) ListUserPaymentAccounts(ctx context.Context, accountID stri
log.CtxErrorw(ctx, "client failed to list payment accounts by owner address", "error", err)
return nil, ErrRPCUnknownWithDetail("client failed to list payment accounts by owner address, error: " + err.Error())
}
return resp.StreamRecords, nil
return resp.PaymentAccounts, nil
}

func (s *GfSpClient) ListGroupsByIDs(ctx context.Context, groupIDs []uint64, opts ...grpc.DialOption) (map[uint64]*types.Group, error) {
Expand Down
Loading

0 comments on commit 7b88f04

Please sign in to comment.