// node --test : ledger reason -> payment kind (2026-09-22 fields) 'use strict'; const test = require('node:test'); const assert = require('node:assert'); const L = require('../ladder'); test('paymentKind classifies ladder payouts and refunds, everything else is other', () => { assert.equal(L.paymentKind('Forecast ladder round 1 payout, rank 1 of 2 (Brier 0.0875): the whole pot'), 'ladder_payout'); assert.equal(L.paymentKind('Forecast ladder round 0 payout, rank 2 of 4'), 'ladder_payout'); assert.equal(L.paymentKind('Forecast ladder round 1: return of two surplus stakes (2 x 0.16 XNO)'), 'ladder_refund'); assert.equal(L.paymentKind('Ladder round 2: return of a surplus stake (block F49EA1FC…, ledger #186).'), 'ladder_refund'); assert.equal(L.paymentKind('Seeded pair bounty: pyfile-toolkit x402nano exact seller'), 'other'); assert.equal(L.paymentKind(''), 'other'); assert.equal(L.paymentKind(null), 'other'); });