satellite/console : remove code for creating user credit in CreateUser, skip TestUserCredits (#3680)

* remove code for creating user credit in CreateUser, skip TestUserCredits
This commit is contained in:
Cameron 2019-12-02 15:23:12 -05:00 committed by GitHub
parent b1fa7cdfbb
commit 52851026a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 15 deletions

View File

@ -368,21 +368,23 @@ func (s *Service) CreateUser(ctx context.Context, user CreateUser, tokenSecret R
}
if currentReward != nil {
var refID *uuid.UUID
if refUserID != "" {
refID, err = uuid.Parse(refUserID)
if err != nil {
return Error.Wrap(err)
}
}
newCredit, err := NewCredit(currentReward, Invitee, u.ID, refID)
if err != nil {
return err
}
err = tx.UserCredits().Create(ctx, *newCredit)
if err != nil {
return err
}
_ = currentReward
// NB: Uncomment this block when UserCredits().Create is cockroach compatible
// var refID *uuid.UUID
// if refUserID != "" {
// refID, err = uuid.Parse(refUserID)
// if err != nil {
// return Error.Wrap(err)
// }
// }
// newCredit, err := NewCredit(currentReward, Invitee, u.ID, refID)
// if err != nil {
// return err
// }
// err = tx.UserCredits().Create(ctx, *newCredit)
// if err != nil {
// return err
// }
}
return nil

View File

@ -20,6 +20,7 @@ import (
)
func TestUserCredits(t *testing.T) {
t.Skip("Skip until usercredits.Create method is cockroach compatible. https://github.com/cockroachdb/cockroach/issues/42881")
satellitedbtest.Run(t, func(t *testing.T, db satellite.DB) {
ctx := testcontext.New(t)
defer ctx.Cleanup()