[C28-67][@ant] fix: spec адаптера расходов — убраны стейл-кейсы authExp/declineExp
Контроллерный tsc --noEmit (CI) падал: spec тестировал adapter.authExp / adapter.declineExp, которых нет в ExpensesBlockchainAdapter по дизайну. authexp/declexp исполняет контракт soviet как callbacks решения совета — backend-адаптер несёт только 6 прямых actions (createexp/payexp/reportexp/ returnexp/overspendexp/closeexp). Зафиксировано в port, mutations-service и комментарии адаптера. Прав код — приводим тест к дизайну, удаляя два кейса. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+2
-13
@@ -67,14 +67,8 @@ describe('ExpensesBlockchainAdapter', () => {
|
||||
assertTransactShape(ExpenseContract.Actions.CreateExp.actionName)
|
||||
})
|
||||
|
||||
it('authExp → transact(expense, authexp, ...)', async () => {
|
||||
await adapter.authExp({
|
||||
coopname,
|
||||
proposal_hash: '0xabc',
|
||||
decision: fakeDoc2,
|
||||
})
|
||||
assertTransactShape(ExpenseContract.Actions.AuthExp.actionName)
|
||||
})
|
||||
// authexp/declexp исполняет контракт soviet как callbacks решения совета —
|
||||
// в backend-адаптере их нет по дизайну (см. expenses-blockchain.port.ts).
|
||||
|
||||
it('payExp → transact(expense, payexp, [{coopname, active}])', async () => {
|
||||
await adapter.payExp({
|
||||
@@ -116,11 +110,6 @@ describe('ExpensesBlockchainAdapter', () => {
|
||||
assertTransactShape(ExpenseContract.Actions.CloseExp.actionName)
|
||||
})
|
||||
|
||||
it('declineExp → transact(expense, declexp, ...)', async () => {
|
||||
await adapter.declineExp({ coopname, proposal_hash: '0xabc', reason: 'нет' })
|
||||
assertTransactShape(ExpenseContract.Actions.DeclineExp.actionName)
|
||||
})
|
||||
|
||||
it('бросает 502, если vault не отдал ключ', async () => {
|
||||
vault.getWif.mockResolvedValueOnce(null)
|
||||
await expect(adapter.closeExp({ coopname, proposal_hash: '0xabc' })).rejects.toThrow(
|
||||
|
||||
Reference in New Issue
Block a user