This repository was archived by the owner on Mar 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +0
-24
lines changed Expand file tree Collapse file tree 2 files changed +0
-24
lines changed Original file line number Diff line number Diff line change 12
12
// ErrModeratorInfoMissing indicates when the moderator information is
13
13
// missing while also indicating they are a moderator
14
14
ErrModeratorInfoMissing = errors .New ("moderator is enabled but information is missing" )
15
- // ErrNonModeratorShouldNotHaveInfo indicates when the moderator information
16
- // is present, but not indicating moderator is enabled
17
- ErrNonModeratorShouldNotHaveInfo = errors .New ("moderator information is provided but moderator is not enabled" )
18
15
// ErrMissingModeratorFee indicates the fee schedule is missing
19
16
ErrMissingModeratorFee = errors .New ("moderator info is missing fee schedule" )
20
17
// ErrUnknownModeratorFeeType indicates the feeType is unknown
@@ -101,9 +98,6 @@ func (p *Profile) validateModeratorFees() error {
101
98
if p .Moderator && p .ModeratorInfo == nil {
102
99
return ErrModeratorInfoMissing
103
100
}
104
- if ! p .Moderator && p .ModeratorInfo != nil {
105
- return ErrNonModeratorShouldNotHaveInfo
106
- }
107
101
108
102
// Moderator is true, Info is present
109
103
if p .ModeratorInfo .Fee == nil {
Original file line number Diff line number Diff line change @@ -358,24 +358,6 @@ func TestProfileInvalidAsModeratorWithoutInfo(t *testing.T) {
358
358
}
359
359
}
360
360
361
- func TestProfileInvalidAsUserWithModeratorInfo (t * testing.T ) {
362
- p := factory .NewProfile ()
363
- p .Moderator = false
364
- p .ModeratorInfo = & repo.ModeratorInfo {
365
- Fee : & repo.ModeratorFee {
366
- FeeType : pb .Moderator_Fee_PERCENTAGE .String (),
367
- Percentage : 1.1 ,
368
- FixedFee : nil ,
369
- },
370
- }
371
-
372
- if err := p .Valid (); err == nil {
373
- t .Errorf ("expected regular user with moderator info to be invalid" )
374
- } else if err != repo .ErrNonModeratorShouldNotHaveInfo {
375
- t .Errorf ("expected ErrNonModeratorShouldNotHaveInfo error, but got (%s)" , err .Error ())
376
- }
377
- }
378
-
379
361
func TestProfileSetModeratorFixedFee (t * testing.T ) {
380
362
p := factory .NewProfile ()
381
363
p .ModeratorInfo .Fee .FeeType = pb .Moderator_Fee_FIXED_PLUS_PERCENTAGE .String ()
You can’t perform that action at this time.
0 commit comments