fix: 天河链存证 upload 成功即生效,不再走对存证交易不适用的确认接口
- 实测接口5/9对纯存证交易一律 500 数组越界(仅适用 token 交易),非偶发异常 - attest 改 confirmationRequired=false 直接 ONCHAIN,凭据为 txHash+digest+UDFS 存证链接 - 更新单测与问题清单/项目记忆,存量 CONFIRMING 数据已修正
This commit is contained in:
@@ -60,9 +60,10 @@ describe('TianheProvider', () => {
|
||||
expect(result.txHash).toBe(response.data.transactionHash);
|
||||
expect(result.explorerUrl).toBe(response.data.url);
|
||||
expect(result.raw.digest).toBe(response.data.digest);
|
||||
expect(result.raw.transactionStatus).toBe('submitted');
|
||||
expect(result.confirmationRequired).toBe(true);
|
||||
// upload 不返回区块信息,由 confirm 阶段补齐
|
||||
// upload 成功即存证生效:确认接口仅适用 token 交易,对纯存证不适用(联调定稿)
|
||||
expect(result.raw.transactionStatus).toBe('onchain');
|
||||
expect(result.confirmationRequired).toBe(false);
|
||||
// 存证交易拿不到区块信息,凭据以 txHash + digest + 存证链接为准
|
||||
expect(result.blockHash).toBeNull();
|
||||
expect(result.blockHeight).toBeNull();
|
||||
});
|
||||
|
||||
@@ -242,7 +242,8 @@ export class TianheProvider implements AttestationProvider {
|
||||
return {
|
||||
dataHash: payload.dataHash,
|
||||
txHash,
|
||||
// upload 接口不返回区块信息,blockHash/blockHeight 由后续 confirm 阶段补齐
|
||||
// upload 不返回区块信息;确认接口(5/9)仅适用 token 交易、对纯存证交易结构性不适用(实测数组越界),
|
||||
// 故存证场景拿不到区块哈希/高度,保持 null,凭据以 txHash + digest + 存证链接为准。
|
||||
blockHash: null,
|
||||
blockHeight: null,
|
||||
chainName: '天河链',
|
||||
@@ -253,10 +254,13 @@ export class TianheProvider implements AttestationProvider {
|
||||
response: raw,
|
||||
digest,
|
||||
proofUrl,
|
||||
transactionStatus: 'submitted',
|
||||
transactionStatusNote: '天河链接口成功仅表示交易已提交;最终链上结果需通过交易查询接口确认。',
|
||||
transactionStatus: 'onchain',
|
||||
transactionStatusNote:
|
||||
'upload 返回成功即存证生效(文件已入链上分布式存储 UDFS,链接可公开验证);' +
|
||||
'交易确认接口仅适用于 mint/transfer/burn 类 token 交易,对纯存证交易不适用(2026-07-10 测试环境实测定稿)。',
|
||||
},
|
||||
confirmationRequired: true,
|
||||
// 存证无需(也无法)二次确认:upload 成功 = 存证完成
|
||||
confirmationRequired: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user