bitcat365 / oasisscan-backend

oasisscan.com backend
3 stars 4 forks source link

Incorrect transaction hash for regular ParaTime transactions #2

Closed kostko closed 2 years ago

kostko commented 2 years ago

It seems that the hash of regular ParaTime transactions is computed incorrectly. From looking at this part: https://github.com/bitcat365/oasisscan-backend/blob/dbb396145f3475c4c9dbd2945eb3b0004b82bd00/src/main/java/romever/scan/oasisscan/service/ScanRuntimeTransactionService.java#L111-L120

The raw field contains only the inner transaction body without the signature. And the hash is then computed like this: https://github.com/bitcat365/oasisscan-backend/blob/dbb396145f3475c4c9dbd2945eb3b0004b82bd00/src/main/java/romever/scan/oasisscan/service/ScanRuntimeTransactionService.java#L143

But the hash should be computed over the whole signed transaction blob (e.g. over r.getTx()).