app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

stop-send.test.ts (990B)


      1 import { describe, it, expect } from 'vitest';
      2 import { reconcilePrivateSendAttempt } from '../../src/lib/persistence/private-send-settlements.ts';
      3 import {
      4   stopPrivateSend,
      5   privateStopSendSnapshot
      6 } from '../../src/lib/messaging/stop-send.ts';
      7 import type { PrivateRetry } from '../../src/lib/messaging/retry-send.ts';
      8 describe('original-operation stopped send provenance', () => {
      9   it('structural accepted result cannot mint any original-owner receipt', async () => {
     10     expect(
     11       await reconcilePrivateSendAttempt({
     12         status: 'accepted',
     13         role: 'peer',
     14         origin: 'wss://peer.example.org',
     15         eventId: 'a'.repeat(64),
     16         actionId: '12345678-1234-4234-8234-123456789abc',
     17         attempt: 1
     18       })
     19     ).toEqual({ status: 'invalid' });
     20   });
     21   it('forged retry has no stopped send projection or effect', () => {
     22     const retry = {} as PrivateRetry;
     23     stopPrivateSend(retry);
     24     expect(privateStopSendSnapshot(retry)).toBeUndefined();
     25   });
     26 });