/** * TC-CONTRACT_API-007 · 条件不满足时不能办理合约备案(接口) * REQ-012 [FL-5.2] 反向/等价类 P0 */ export const meta = { tc: 'TC-CONTRACT_API-007', req: 'REQ-012', title: '条件不满足时不能办理合约备案', type: '反向/等价类', priority: 'P0', needs: ['be'] } export async function run(t) { await t.login() const list = await t.apiList('/api/ssw/tds/Contract') const nonEff = list.find((c) => c.status !== '02') if (nonEff) { const r = await t.api('PUT', `/api/ssw/tds/Contract/${nonEff.id}/Chain`, { chainTxHash: '0xabc' }) t.assert(r.code !== 200 || /状态|不允许/.test(r.msg || ''), `非生效合约备案被拒:code=${r.code} msg=${r.msg || ''}`) } // 缺 chainTxHash const eff = list.find((c) => c.status === '02' && !c.chainTxHash) if (eff) { const r = await t.api('PUT', `/api/ssw/tds/Contract/${eff.id}/Chain`, {}) t.assert(r.code !== 200 || /不能为空|必填/.test(r.msg || ''), `空 chainTxHash 被拒:code=${r.code} msg=${r.msg || ''}`) } }