Stack POL Pro: ANY $10+ package unlocks it automatically (Marty 2026-11-09: "Any $10 package or higher unlocks it"). No Get Pro order step; the member's own on-chain package of $10+ switches Pro on for good, rides along with a Game Pass or hero order the same package fulfils (never takes it from them), only packages from the Pro launch (21:30 UTC) count, credits never. Promo tools shows Buy a $10+ package; chatbot updated; my.js ?v=20261109pro4; qa/stackpro rewritten (11 pass).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+10
-19
@@ -38,26 +38,17 @@ try {
|
||||
let r = await api('/api/my/stackpol', null, ha); ok(r.status === 200 && r.j.on === true && r.j.url === 'https://stackpol.com/stacka' && r.j.pro && r.j.pro.pro === false, 'GET: on by default, url, not pro', JSON.stringify(r.j));
|
||||
r = await api('/api/my/stackpol', { data: { on: true } }, ha); ok(r.j.on === true && optin().users.stacka === true, 'switch on writes stack-optin.json');
|
||||
r = await api('/api/my/stackpol', { data: { on: false } }, ha); ok(r.j.on === false && optin().users.stacka === false, 'switch off');
|
||||
// a package with no Pro order unlocks nothing
|
||||
await buy(A, 1000); r = await api('/api/my/stackpol', null, ha); ok(r.j.pro.pro === false, 'a $10 package without a Pro order does not unlock Pro');
|
||||
// Get Pro opens a waiting order
|
||||
r = await api('/api/my/stackpol', { data: { pro: 'buy' } }, ha); ok(r.j.buy && r.j.buy.needPay === true && r.j.pro.waiting === true && r.j.buy.usd === 10, 'Get Pro opens a waiting order ($10)', JSON.stringify(r.j.buy));
|
||||
const orderTs = r.j.buy.orderTs;
|
||||
r = await api('/api/my/stackpol', { data: { pro: 'buy' } }, ha); ok(r.j.buy.reused === true, 'Get Pro twice reuses the same order');
|
||||
await buy(A, 500); r = await api('/api/my/stackpol', null, ha); ok(r.j.pro.pro === false && r.j.pro.waiting === true, 'a $5 package does not fulfil Pro');
|
||||
await buy(A, 2000, { minedAt: orderTs - 60000 }); r = await api('/api/my/stackpol', null, ha); ok(r.j.pro.pro === false, 'a package mined BEFORE the order does not fulfil Pro');
|
||||
const fx = await buy(A, 1000); r = await api('/api/my/stackpol', null, ha); ok(fx.j.order && fx.j.order.stackPro === true && r.j.pro.pro === true && r.j.pro.waiting === false, 'a $10 package after the order unlocks Pro', JSON.stringify(fx.j));
|
||||
// Marty 2026-11-09 evening: ANY $10+ package unlocks Pro, no order step; it rides along with whatever else the package fulfils
|
||||
await buy(A, 500); r = await api('/api/my/stackpol', null, ha); ok(r.j.pro.pro === false, 'a $5 package does not unlock Pro');
|
||||
const fx = await buy(A, 1000); r = await api('/api/my/stackpol', null, ha); ok(fx.j.order && fx.j.order.stackPro === true && r.j.pro.pro === true, 'a $10 package unlocks Pro with no order', JSON.stringify(fx.j));
|
||||
ok(optin().pro && optin().pro.stacka === true, 'Pro owner lands in stack-optin.json for the indexer');
|
||||
const tx = '0x' + 'ab'.repeat(32);
|
||||
// one package fulfils ONE order: B opens a pass AND a Pro order, a single $20 package unlocks only one (the higher price: Pro)
|
||||
await api('/api/my/stackpol', { data: { pro: 'buy' } }, hb);
|
||||
const gp = await api('/api/my/gamepass/buy', { data: {} }, hb); const gpw = await api('/api/my/gamepass', null, hb); ok(gpw.j.waiting === true || !gpw.j.enabled, 'B: a Game Pass order is waiting too (or passes are off locally)', JSON.stringify(gp.j).slice(0, 120));
|
||||
await buy(Bm, 2000, { tx }); r = await api('/api/my/stackpol', null, hb);
|
||||
const st = await api('/api/my/gamepass', null, hb);
|
||||
ok(r.j.pro.pro === true, 'B: the $20 package unlocked Pro (the higher-priced order)');
|
||||
ok(st.j.active === false && (st.j.waiting === true || !gpw.j.waiting), 'B: the same package did NOT also start a Game Pass (still waiting)', 'active=' + st.j.active + ' waiting=' + st.j.waiting);
|
||||
await buy(Bm, 2000, { tx }); const st2 = await api('/api/my/gamepass', null, hb); ok(st2.j.active === false, 'replaying the same tx fulfils nothing');
|
||||
r = await api('/api/my/stackpol', { data: { pro: 'cancel' } }, ha); ok(r.status === 200 && r.j.pro.pro === true, 'cancel after paying keeps Pro');
|
||||
const again = await buy(A, 2000); ok(!(again.j.order && again.j.order.stackPro), 'a second package does not re-grant Pro');
|
||||
// B: a Game Pass order waiting + a $20 package -> the pass starts AND Pro unlocks (Pro never takes the package from the pass)
|
||||
const gp = await api('/api/my/gamepass/buy', { data: {} }, hb); const gpw = await api('/api/my/gamepass', null, hb);
|
||||
const fb = await buy(Bm, 2000); r = await api('/api/my/stackpol', null, hb); const st = await api('/api/my/gamepass', null, hb);
|
||||
ok(r.j.pro.pro === true, 'B: the $20 package unlocked Pro', JSON.stringify(fb.j));
|
||||
ok(!gpw.j.enabled || st.j.active === true, 'B: the same package still started the waiting Game Pass', 'enabled=' + gpw.j.enabled + ' active=' + st.j.active);
|
||||
r = await api('/api/my/stackpol', { data: { on: false } }, hb); ok(r.j.on === false && r.j.pro.pro === true, 'switching the page off keeps Pro');
|
||||
} catch (e) { console.log('FAIL exception', e && e.stack || e); fails++; }
|
||||
finally { try { srv.kill(); } catch (e) {} try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} }
|
||||
if (fails) console.log(log.split('\n').filter(l => /stack|gamepass|error/i.test(l)).slice(-15).join('\n'));
|
||||
|
||||
Reference in New Issue
Block a user