From 89de9d895f1a55f1b6134e5c2b102b7b3504f947 Mon Sep 17 00:00:00 2001 From: sh-agents <350651734+sh-agents@users.noreply.github.com> Date: Mon, 9 Nov 2026 11:39:22 +0000 Subject: [PATCH 1/7] store: close a failed paid name order and record its refund --- apps/simplex-store-service/README.md | 44 ++++++++-- .../src/StoreService/Names/Balances.hs | 37 +++++++-- .../src/StoreService/Names/Worker.hs | 50 +++++++++++- .../src/StoreService/Service.hs | 50 +++++++++--- tests/Bots/StoreService/BotTests.hs | 2 +- .../StoreService/GroupIntegrationTests.hs | 41 +++++++++- tests/Bots/StoreService/NamesBalancesTests.hs | 2 +- tests/Bots/StoreService/NamesWorkerTests.hs | 80 ++++++++++++++++++- 8 files changed, 270 insertions(+), 36 deletions(-) diff --git a/apps/simplex-store-service/README.md b/apps/simplex-store-service/README.md index 36f09667f8..1a20c04d70 100644 --- a/apps/simplex-store-service/README.md +++ b/apps/simplex-store-service/README.md @@ -1149,8 +1149,8 @@ psql "postgresql://simplex@127.0.0.1:5432/badge_service" -c "SELECT registrar_no An order sends at most 5 commits, 5 terms acceptances and 5 registers, its moves included, since an owner who changes their terms acceptance on chain can make each acceptance and register revert at the -service's gas. Past that the order fails, Try again and a move answer `400 bad_request`, and support refunds it -at the provider: `//refund` records nothing for such an order, which has no balance. +service's gas. Past that the order fails, Try again and a move answer `400 bad_request`, and support closes it +with `//close` (see [Closing a failed order](#closing-a-failed-order)). The log line is `[WARN …] names worker: registration failed: it sent transactions of one kind`. Try again or a move of a failed order, and the worker's judgment of a register that did not go @@ -1279,8 +1279,9 @@ were already given out, and the command answers with an error. A multi-use code be revoked, which stops the uses that remain. Core parses `//...` into `CustomChatCommand` and leaves it to the service's `preCmdHook`, which is -why issuing codes lives in the service rather than in core. `//refund`, the other command of this -console, is in [Refunding a name balance](#refunding-a-name-balance). +why issuing codes lives in the service rather than in core. `//refund` and `//close`, the other +commands of this console, are in [Refunding a name balance](#refunding-a-name-balance) and +[Closing a failed order](#closing-a-failed-order). ### From the group @@ -1420,7 +1421,7 @@ expiry unless money reached the invoice: once the invoice expires and the poller, in service mode, closes the order. Run the command again then. - `its invoice expired at