Orgchain v1.5: beats pay the holding, and test BTC moves down the tree
Each beat pays its 50 test BTC block reward to the holding being worked in, at its SegWit (BIP-84) address. Send moves test BTC between active nodes of a holding, signed by the sender's BIP-84 key, with the toy chain's 500-sat fee: at most two coins in and one block reward out. Sends land like acts, and Beat now mines a beat even when nothing is cued. A graduation moves each re-keyed node's money to its new address with its inscription. Balances follow the slider, the timeline lists every reward and send, and Inspect shows exact amounts and the raw transaction. The sample passes some of yolopreneur's rewards down its tree. The engine's one local change: the toy chain also takes P2WPKH outputs and SIGHASH_ALL P2WPKH spends (BIP-143), in src/adapters/chain.js. Super Testnet's tests pass unchanged; tests/money.test.js covers the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H4upF5LVwmPDDqrhdUfnXh
This commit is contained in:
1 parent
aeb11d334f
commit
6d5806d45b
12 files changed
+590
-59
No files matched your search
+59
-2
@@ -71,9 +71,9 @@ test('a timed tempo cues acts; Beat now and the clock land them', async ({ page
|
||||
await expect(page.locator('#clock-cued')).toContainText('2 cued · next beat in');
|
||||
await expect(row(page, 'b')).toContainText('cued');
|
||||
await page.locator('#beat-now').click();
|
||||
await expect(say(page)).toHaveText('Beat 3: 2 cued acts landed.');
|
||||
await expect(say(page)).toHaveText('Beat 3: 2 cued acts landed, and acme earned 50 tBTC.');
|
||||
await birth(page, 'c');
|
||||
await expect(say(page)).toHaveText('Beat 4: 1 cued act landed.', { timeout: 15_000 });
|
||||
await expect(say(page)).toHaveText('Beat 4: 1 cued act landed, and acme earned 50 tBTC.', { timeout: 15_000 });
|
||||
await page.locator('[data-tempo="manual"]').click();
|
||||
await birth(page, 'd');
|
||||
await expect(page.locator('#clock-cued')).toHaveText('1 cued · waiting for Beat now');
|
||||
@@ -83,6 +83,61 @@ test('a timed tempo cues acts; Beat now and the clock land them', async ({ page
|
||||
expect(problems).toEqual([]);
|
||||
});
|
||||
|
||||
test('beats pay the holding, and test BTC moves down its tree', async ({ page }) => {
|
||||
const problems = await open(page), inspect = page.locator('#inspect-body');
|
||||
await found(page, 'acme');
|
||||
await expect(row(page, 'acme')).toContainText('50 tBTC');
|
||||
await expect(page.locator('#clock-pays')).toHaveText('beats pay acme');
|
||||
await birth(page, 'ops');
|
||||
await row(page, 'ops').click();
|
||||
await birth(page, 'bot', 'agent');
|
||||
await verb(page, 'send');
|
||||
await expect(page.locator('#act-why')).toHaveText('ops has no test BTC to send yet. Each beat pays acme, which can send some down.');
|
||||
await row(page, 'acme').click();
|
||||
await verb(page, 'send');
|
||||
await expect(page.locator('#send-has')).toHaveText('150 tBTC');
|
||||
await expect(page.locator('#act-key')).toHaveText("Signs as acme: acme root · m/84'/1'/0'/0/0");
|
||||
await page.locator('#send-to').selectOption({ label: 'acme / ops' });
|
||||
await page.locator('#send-amount').fill('12.5');
|
||||
await submit(page, 'send');
|
||||
await expect(say(page)).toHaveText('acme sent 12.5 tBTC to ops, at beat 5.');
|
||||
await expect(row(page, 'ops')).toContainText('12.5 tBTC');
|
||||
await expect(row(page, 'acme')).toContainText('≈187.5 tBTC');
|
||||
await row(page, 'ops').click();
|
||||
await verb(page, 'send');
|
||||
await page.locator('#send-to').selectOption({ label: 'acme / ops / bot (agent)' });
|
||||
await page.locator('#send-max').click();
|
||||
await expect(page.locator('#send-amount')).toHaveValue('12.499995');
|
||||
await page.locator('#send-amount').fill('1');
|
||||
await submit(page, 'send');
|
||||
await expect(say(page)).toHaveText('ops sent 1 tBTC to bot, at beat 6.');
|
||||
await expect(row(page, 'bot')).toContainText('1 tBTC');
|
||||
await page.locator('#timeline-list .ev', { hasText: 'ops → bot' }).click();
|
||||
for (const text of ['500 sats, retired', '11.499995 tBTC back to ops', "ops's SegWit key (BIP-143, SIGHASH_ALL)"]) await expect(inspect).toContainText(text);
|
||||
await page.locator('#beat-now').click();
|
||||
await expect(say(page)).toHaveText('Beat 7: acme earned 50 tBTC.');
|
||||
await page.locator('[data-tempo="manual"]').click();
|
||||
await row(page, 'acme').click();
|
||||
await verb(page, 'send');
|
||||
await page.locator('#send-to').selectOption({ label: 'acme / ops / bot (agent)' });
|
||||
await page.locator('#send-amount').fill('0.25');
|
||||
await submit(page, 'send');
|
||||
await expect(say(page)).toHaveText('acme sent 0.25 tBTC to bot, cued for the next beat.');
|
||||
await expect(page.locator('#clock-cued')).toHaveText('1 cued · waiting for Beat now');
|
||||
await page.locator('#beat-now').click();
|
||||
await expect(say(page)).toHaveText('Beat 8: 1 cued send landed, and acme earned 50 tBTC.');
|
||||
await expect(row(page, 'bot')).toContainText('1.25 tBTC');
|
||||
await slide(page, 4);
|
||||
await expect(row(page, 'ops')).not.toContainText('tBTC');
|
||||
await expect(row(page, 'acme')).toContainText('150 tBTC');
|
||||
await row(page, 'acme').click();
|
||||
await expect(inspect).toContainText('as of beat 4');
|
||||
await page.locator('#to-now').click();
|
||||
await expect(page.locator('#holdings-list')).toContainText('tBTC');
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true);
|
||||
expect(problems).toEqual([]);
|
||||
});
|
||||
|
||||
test('the sample replays, any beat can be inspected, and the lab survives a reload', async ({ page }) => {
|
||||
const problems = await open(page);
|
||||
await page.locator('#sample').click();
|
||||
@@ -90,6 +145,8 @@ test('the sample replays, any beat can be inspected, and the lab survives a relo
|
||||
await expect(page.locator('#tree-rows .sel')).toHaveCount(12);
|
||||
await expect(page.locator('#beat-label')).toHaveText('Now · beat 7');
|
||||
await expect(row(page, 'lineage')).toContainText('graduated');
|
||||
await expect(row(page, 'time')).toContainText('≈38.5 tBTC');
|
||||
await expect(page.locator('#timeline-list')).toContainText('40 tBTC yolopreneur → time');
|
||||
await expect(page.locator('#sample')).toBeDisabled();
|
||||
await slide(page, 3);
|
||||
await expect(page.locator('#beat-label')).toHaveText('Beat 3 of 7');
|
||||
|
||||
Reference in new issue
Block a user