Skip to content

Commit

Permalink
adjust comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Nov 9, 2023
1 parent 61166e2 commit 5284fad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions e2e/tests/permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ func (s *StorageTestSuite) TestExpiredAccountPolicyGCAndRePut() {
Actions: []types.ActionType{types.ACTION_DELETE_BUCKET},
Effect: types.EFFECT_ALLOW,
}
expirationTime := time.Now().Add(5 * time.Second)
expirationTime := time.Now().Add(3 * time.Second)

msgPutBucketPolicy := storagetypes.NewMsgPutPolicy(owner.GetAddr(), types2.NewBucketGRN(bucketName).String(),
principal, []*types.Statement{bucketStatement}, &expirationTime)
Expand Down Expand Up @@ -1990,7 +1990,7 @@ func (s *StorageTestSuite) TestExpiredGroupPolicyGCAndRePut() {

principal := types.NewPrincipalWithGroupId(headGroupResponse.GroupInfo.Id)
// Put bucket policy for group
expirationTime := time.Now().Add(5 * time.Second)
expirationTime := time.Now().Add(3 * time.Second)

bucketStatement := &types.Statement{
Actions: []types.ActionType{types.ACTION_DELETE_BUCKET},
Expand Down
2 changes: 1 addition & 1 deletion x/virtualgroup/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (k msgServer) CreateGlobalVirtualGroup(goCtx context.Context, req *types.Ms
if len(req.GetSecondarySpIds()) != expectSecondarySPNum {
return nil, types.ErrInvalidSecondarySPCount.Wrapf("the number of secondary sp in the Global virtual group should be %d", expectSecondarySPNum)
}
spIdSet := make(map[uint32]struct{})
spIdSet := make(map[uint32]struct{}, len(req.GetSecondarySpIds()))
for _, spId := range req.GetSecondarySpIds() {
if _, ok := spIdSet[spId]; ok {
return nil, types.ErrDuplicateSecondarySP.Wrapf("the SP(id=%d) is duplicate in the Global virtual group.", spId)
Expand Down

0 comments on commit 5284fad

Please sign in to comment.