Updates across core modules, app wiring, IBC config, governance execution tests, tokenfactory keeper/module, Makefile build targets, release CI, and dependency updates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
23 lines
503 B
Go
23 lines
503 B
Go
package keeper
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
"cosmossdk.io/collections"
|
|
)
|
|
|
|
// HasPurchased checks whether buyer has purchased from seller.
|
|
// Used by x/reputation for purchase-gated rating checks.
|
|
func (k Keeper) HasPurchased(ctx context.Context, buyer, seller string) (bool, error) {
|
|
purchaseKey := buyer + "|" + seller
|
|
has, err := k.Purchases.Get(ctx, purchaseKey)
|
|
if err != nil {
|
|
if errors.Is(err, collections.ErrNotFound) {
|
|
return false, nil
|
|
}
|
|
return false, err
|
|
}
|
|
return has, nil
|
|
}
|