Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/closers/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
loggingutils "github.com/brave-intl/bat-go/libs/logging"
)

// Log calls Close on the specified closer, panicing on error
// Log calls Close on the specified closer, panicking on error
func Log(ctx context.Context, c io.Closer) {
// get the logger from the context
logger := loggingutils.Logger(ctx, "closer.Log")
Expand Down
2 changes: 1 addition & 1 deletion libs/closers/panic.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/brave-intl/bat-go/libs/logging"
)

// Panic calls Close on the specified closer, panicing on error
// Panic calls Close on the specified closer, panicking on error
func Panic(ctx context.Context, c io.Closer) {
logger := logging.Logger(ctx, "closers.Panic")
if c == nil {
Expand Down
2 changes: 1 addition & 1 deletion libs/kv/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestMapKv(t *testing.T) {
}

if _, err := store.Get("DEAD"); err == nil {
t.Error("Get should return an error on nonexistant key")
t.Error("Get should return an error on nonexistent key")
}

if r, err := store.Delete("FOO"); !r || err != nil {
Expand Down
2 changes: 1 addition & 1 deletion services/ratios/cmd/rest_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func RestRun(command *cobra.Command, args []string) {
// setup the service now
ctx, s, err := ratios.InitService(ctx)
if err != nil {
logger.Fatal().Err(err).Msg("failed to initalize ratios service")
logger.Fatal().Err(err).Msg("failed to initialize ratios service")
}

// do rest endpoints
Expand Down
14 changes: 7 additions & 7 deletions services/ratios/inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type CoingeckoCoin struct {
coin string
}

// String - stringer implmentation
// String - stringer implementation
func (cc *CoingeckoCoin) String() string {
return string(cc.coin)
}
Expand Down Expand Up @@ -79,7 +79,7 @@ var (
// CoingeckoCoinList - type for coingecko coin list input
type CoingeckoCoinList []CoingeckoCoin

// String - stringer implmentation
// String - stringer implementation
func (ccl *CoingeckoCoinList) String() string {
var s []string
for _, coin := range *ccl {
Expand Down Expand Up @@ -127,7 +127,7 @@ func (ccl *CoingeckoCoinList) Validate(ctx context.Context) error {
// CoingeckoVsCurrency - type for coingecko vs currency input
type CoingeckoVsCurrency string

// String - stringer implmentation
// String - stringer implementation
func (cvc *CoingeckoVsCurrency) String() string {
return string(*cvc)
}
Expand Down Expand Up @@ -168,7 +168,7 @@ var (
// CoingeckoVsCurrencyList - type for coingecko vs currency list input
type CoingeckoVsCurrencyList []CoingeckoVsCurrency

// String - stringer implmentation
// String - stringer implementation
func (cvcl *CoingeckoVsCurrencyList) String() string {
var s []string
for _, vc := range *cvcl {
Expand Down Expand Up @@ -211,7 +211,7 @@ func (cvcl *CoingeckoVsCurrencyList) Validate(ctx context.Context) error {
// CoingeckoDuration - type for coingecko duration input
type CoingeckoDuration string

// String - stringer implmentation
// String - stringer implementation
func (cd *CoingeckoDuration) String() string {
return string(*cd)
}
Expand Down Expand Up @@ -289,12 +289,12 @@ func (cd *CoingeckoDuration) Validate(ctx context.Context) error {
// Note: we only will request the first page
type CoingeckoLimit int

// String - stringer implmentation
// String - stringer implementation
func (cl *CoingeckoLimit) String() string {
return strconv.Itoa(int(*cl))
}

// Int - int conversion implmentation
// Int - int conversion implementation
func (cl *CoingeckoLimit) Int() int {
return int(*cl)
}
Expand Down
2 changes: 1 addition & 1 deletion services/rewards/inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// BaseCurrency - type for base currency input
type BaseCurrency string

// String - stringer implmentation
// String - stringer implementation
func (rbc *BaseCurrency) String() string {
return string(*rbc)
}
Expand Down
8 changes: 4 additions & 4 deletions services/skus/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ func (s *Service) CreateTransactionFromRequest(ctx context.Context, req CreateTr
return nil, errorutils.Wrap(err, "error validating order is paid")
}

// If the transaction that was satisifies the order then let's update the status
// If the transaction that was satisfies the order then let's update the status
if isPaid {
err = s.Datastore.UpdateOrder(transaction.OrderID, "paid")
if err != nil {
Expand All @@ -1092,7 +1092,7 @@ func (s *Service) CreateTransactionFromRequest(ctx context.Context, req CreateTr
return transaction, err
}

// UpdateTransactionFromRequest queries the endpoints and creates a transaciton
// UpdateTransactionFromRequest queries the endpoints and creates a transaction
func (s *Service) UpdateTransactionFromRequest(ctx context.Context, req CreateTransactionRequest, orderID uuid.UUID, getCustodialTx getCustodialTxFn) (*Transaction, error) {

sublogger := logging.Logger(ctx, "payments").With().
Expand All @@ -1118,7 +1118,7 @@ func (s *Service) UpdateTransactionFromRequest(ctx context.Context, req CreateTr
return nil, errorutils.Wrap(err, "error validating order is paid")
}

// If the transaction that was satisifies the order then let's update the status
// If the transaction that was satisfies the order then let's update the status
if isPaid {
err = s.Datastore.UpdateOrder(transaction.OrderID, "paid")
if err != nil {
Expand Down Expand Up @@ -2245,7 +2245,7 @@ func (s *Service) redeemBlindedCred(ctx context.Context, w http.ResponseWriter,
case timeLimitedV2:
redeemFn = s.cbClient.RedeemCredentialV3
default:
return handlers.WrapError(fmt.Errorf("credential type %s not suppoted", kind), "unknown credential type %s", http.StatusBadRequest)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error and message is returned to clients so to be safe we should leave as is for now. In the past we have had issue with clients relying on the message it self to perform logic.

return handlers.WrapError(fmt.Errorf("credential type %s not supported", kind), "unknown credential type %s", http.StatusBadRequest)
}

// FIXME: we shouldn't be using the issuer as the payload, it ideally would be a unique request identifier
Expand Down
2 changes: 1 addition & 1 deletion services/skus/storage/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (r *Order) GetTimeBounds(ctx context.Context, dbi sqlx.QueryerContext, id u
// GetExpiresAtAfterISOPeriod returns a new value for expires_at that is last_paid_at plus ISO period.
//
// It falls back to now() when last_paid_at is NULL.
// It uses the maximum of the order items' valid_for_iso as inverval, and falls back to 1 month.
// It uses the maximum of the order items' valid_for_iso as interval, and falls back to 1 month.
func (r *Order) GetExpiresAtAfterISOPeriod(ctx context.Context, dbi sqlx.QueryerContext, id uuid.UUID) (time.Time, error) {
const q = `SELECT COALESCE(last_paid_at, now()) +
(SELECT COALESCE(MAX(valid_for_iso::interval), interval '1 month') FROM order_items WHERE order_id = $2)
Expand Down
2 changes: 1 addition & 1 deletion services/wallet/datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ func (pg *Postgres) ConnectCustodialWallet(ctx context.Context, cl *CustodianLin
); err != nil {
sublogger.Error().Err(err).
Msg("failed to update wallets with new deposit destination")
return fmt.Errorf("error updating wallets with new deposit desintation: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return fmt.Errorf("error updating wallets with new deposit destination: %w", err)
} else if r != nil {
count, _ := r.RowsAffected()
if count < 1 {
Expand Down
Loading