/** * TC-CONTRACT_API-006 · 正常办理合约备案(接口) * REQ-012 [FL-5.2] 正向/场景法 P0 */ export const meta = { tc: 'TC-CONTRACT_API-006', 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 target = list.find((c) => c.status === '02' && !c.chainTxHash) if (!target) t.skip('库中无待上链合约') const before = (await t.apiList('/api/ssw/tds/ChainEvidence/List')).length const r = await t.api('PUT', `/api/ssw/tds/Contract/${target.id}/Chain`, { chainTxHash: '0x' + 'b'.repeat(64) }) t.assert(r.code === 200, `合约备案调用:code=${r.code} msg=${r.msg || ''}`) await t.waitIdle() const after = (await t.apiList('/api/ssw/tds/ChainEvidence/List')).length t.assert(after === before + 1, `存证记录 +1(${before} → ${after})`) }