clawchain/x/marketplace/keeper/reputation_adapter.go
caelum0x cc12b2b899 feat: core chain updates — clawchain, governance, marketplace, tokenfactory, IBC, build
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>
2026-03-16 22:14:09 +03:00

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
}