Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit a1f36ce

Browse files
committed
Only check fixed fee if NOT percentage type
1 parent 0dfe41a commit a1f36ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/profile.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"encoding/json"
77
"errors"
88
"fmt"
9+
910
"github.com/OpenBazaar/openbazaar-go/ipfs"
1011
"github.com/OpenBazaar/openbazaar-go/repo"
1112

@@ -361,7 +362,7 @@ func ValidateProfile(profile *pb.Profile) error {
361362
}
362363
}
363364
if profile.ModeratorInfo.Fee != nil {
364-
if profile.ModeratorInfo.Fee.FixedFee != nil &&
365+
if profile.ModeratorInfo.Fee.FeeType != pb.Moderator_Fee_PERCENTAGE && profile.ModeratorInfo.Fee.FixedFee != nil &&
365366
len(profile.ModeratorInfo.Fee.FixedFee.AmountCurrency.Code) > repo.WordMaxCharacters {
366367
return fmt.Errorf("moderator fee currency code character length is greater than the max of %d", repo.WordMaxCharacters)
367368
}

0 commit comments

Comments
 (0)