Reward tiers off by default (flat $0.25 at launch); hub-blocked sponsors are skipped (pass-up)
- config: REWARD_TIERS defaults to none (the every-25th $2.50 tier stays available as a setting); the "bigger tiers" sentence only shows when a tier is configured. - hubline: the walk reads the raw hub answer so it continues past a blocked sponsor instead of stopping; entries carry `blocked`. /api/my/order skips blocked members like no-wallet ones, so the level passes up. - e2e: B -> no-wallet -> hub-blocked (with a wallet) -> O -> S: both skipped, O and S each get 10%, the blocked one gets nothing; tiers off checked. 63/63. Chatbot QA 108/108. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+5
-2
@@ -15,10 +15,13 @@ async function walk(person, max) {
|
||||
for (let depth = 1; depth <= max; depth++) {
|
||||
if (!p.sponsor || !p.sponsor.id) return { ok: true, line };
|
||||
if (seen.has(p.sponsor.id)) return { ok: true, line, loop: true }; // a loop in the hub data: stop
|
||||
const r = await hubpeople.sponsorOf(p); if (!r.ok) return { ok: false, line };
|
||||
// the raw hub answer (blocked people included) so the walk goes on past a blocked sponsor; callers skip `blocked` entries
|
||||
// (Boost orders: a blocked member earns nothing and the level passes up, Marty 2026-11-17)
|
||||
if (!/^h_[0-9a-f]{16}$/.test(String(p.sponsor.id))) return { ok: true, line };
|
||||
const r = await hubpeople.resolve({ id: String(p.sponsor.id) }); if (!r.ok) return { ok: false, line };
|
||||
if (!r.person) return { ok: true, line };
|
||||
seen.add(r.person.id);
|
||||
line.push({ depth, id: r.person.id, username: r.person.username ? String(r.person.username) : null, wallet: hubpeople.wallet(r.person) });
|
||||
line.push({ depth, id: r.person.id, username: r.person.username ? String(r.person.username) : null, wallet: hubpeople.wallet(r.person), blocked: !!r.person.blocked });
|
||||
p = r.person;
|
||||
}
|
||||
return { ok: true, line };
|
||||
|
||||
Reference in New Issue
Block a user