Skip to content

Commit 33b5f0f

Browse files
committed
fix: errors.Is
1 parent 8924068 commit 33b5f0f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/adapters/dataproviders/database/mongo/liquidity_provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (repo *lpMongoRepository) AddTrustedAccount(ctx context.Context, account li
145145
existingAccount, err := repo.GetTrustedAccount(ctx, account.Address)
146146
if err == nil && existingAccount != nil {
147147
return liquidity_provider.ErrDuplicateAddress
148-
} else if err != nil && err != liquidity_provider.ErrTrustedAccountNotFound {
148+
} else if err != nil && !errors.Is(err, liquidity_provider.ErrTrustedAccountNotFound) {
149149
return err
150150
}
151151
_, err = collection.InsertOne(dbCtx, account)
@@ -161,7 +161,7 @@ func (repo *lpMongoRepository) UpdateTrustedAccount(ctx context.Context, account
161161
defer cancel()
162162
collection := repo.conn.Collection(TrustedAccountCollection)
163163
_, err := repo.GetTrustedAccount(ctx, account.Address)
164-
if err != nil && err != liquidity_provider.ErrTrustedAccountNotFound {
164+
if err != nil && !errors.Is(err, liquidity_provider.ErrTrustedAccountNotFound) {
165165
return err
166166
}
167167
filter := bson.M{"address": account.Address}

0 commit comments

Comments
 (0)