Problem
The TCK server does not implement deleteFile, so the TCK driver's FileDeleteTransaction suite cannot run against the Python SDK. The SDK transaction (src/hiero_sdk_python/file/file_delete_transaction.py) already exists.
Blocked by hiero-ledger#2488 (createFile) — this handler goes in the file-service TCK modules hiero-ledger#2488 creates, and the driver needs a created file to delete. Implementing this also unblocks a currently-skipped test in the appendFile spec ("Appends to a deleted file — Skipped (delete file not implemented)").
Solution
Add a deleteFile handler wrapping FileDeleteTransaction, modelled on the existing deleteTopic handler in tck/handlers/topic.py — same shape, substituting FileDeleteTransaction and set_file_id(FileId.from_string(...)).
Method contract (from the spec):
| Input |
Type |
Required |
Notes |
fileID |
string |
optional |
Capital ID — see trap below |
commonTransactionParams |
object |
optional |
|
Output: status — reuse StatusOnlyResponse from tck/response/base.py.
Implementation steps:
- Add
DeleteFileParams(BaseTransactionParams) to tck/param/file.py.
- Add the handler to
tck/handlers/file.py (mirror deleteTopic).
- Add a unit test under
tests/tck/.
Two traps — both are spec-conformance issues that will fail driver tests if missed:
-
The spec's parameter is fileID, not fileId. Every other file-service method uses fileId; this one alone uses fileID. Bind the JSON key verbatim (params.get("fileID")) or the driver's parameter won't map. Leave a comment so a future reader doesn't "fix" the inconsistency.
-
Empty string vs. omitted must behave differently. The spec's property tests expect:
fileId="" → SDK internal error
fileId omitted entirely → network INVALID_FILE_ID
The SDK raises ValueError("Missing required FileID") for an unset file ID (file_delete_transaction.py, _require check before building), which would collapse both cases into a local error. The handler must therefore: pass "" through in a way that triggers SDK-side validation (e.g. attempt FileId.from_string(""), which raises), but when the param is absent, do not short-circuit — submit without a file ID so the network returns INVALID_FILE_ID. If the SDK's local ValueError makes the omitted case impossible to send, note that in the PR and raise it — that's a genuine SDK/spec conformance question, not something to paper over in the handler.
Other spec expectations to test: delete without the file's admin key in signers → INVALID_SIGNATURE; delete an already-deleted file → FILE_DELETED.
Acceptance criteria
Spec: https://github.com/hiero-ledger/hiero-sdk-tck/blob/main/docs/test-specifications/file-service/FileDeleteTransaction.md
JS reference: https://github.com/hiero-ledger/hiero-sdk-js/blob/main/tck/methods/file.ts (deleteFile)
Problem
The TCK server does not implement
deleteFile, so the TCK driver'sFileDeleteTransactionsuite cannot run against the Python SDK. The SDK transaction (src/hiero_sdk_python/file/file_delete_transaction.py) already exists.Blocked by hiero-ledger#2488 (
createFile) — this handler goes in the file-service TCK modules hiero-ledger#2488 creates, and the driver needs a created file to delete. Implementing this also unblocks a currently-skipped test in theappendFilespec ("Appends to a deleted file — Skipped (delete file not implemented)").Solution
Add a
deleteFilehandler wrappingFileDeleteTransaction, modelled on the existingdeleteTopichandler intck/handlers/topic.py— same shape, substitutingFileDeleteTransactionandset_file_id(FileId.from_string(...)).Method contract (from the spec):
fileIDID— see trap belowcommonTransactionParamsOutput:
status— reuseStatusOnlyResponsefromtck/response/base.py.Implementation steps:
DeleteFileParams(BaseTransactionParams)totck/param/file.py.tck/handlers/file.py(mirrordeleteTopic).tests/tck/.Two traps — both are spec-conformance issues that will fail driver tests if missed:
The spec's parameter is
fileID, notfileId. Every other file-service method usesfileId; this one alone usesfileID. Bind the JSON key verbatim (params.get("fileID")) or the driver's parameter won't map. Leave a comment so a future reader doesn't "fix" the inconsistency.Empty string vs. omitted must behave differently. The spec's property tests expect:
fileId=""→ SDK internal errorfileIdomitted entirely → networkINVALID_FILE_IDThe SDK raises
ValueError("Missing required FileID")for an unset file ID (file_delete_transaction.py,_requirecheck before building), which would collapse both cases into a local error. The handler must therefore: pass""through in a way that triggers SDK-side validation (e.g. attemptFileId.from_string(""), which raises), but when the param is absent, do not short-circuit — submit without a file ID so the network returnsINVALID_FILE_ID. If the SDK's localValueErrormakes the omitted case impossible to send, note that in the PR and raise it — that's a genuine SDK/spec conformance question, not something to paper over in the handler.Other spec expectations to test: delete without the file's admin key in
signers→INVALID_SIGNATURE; delete an already-deleted file →FILE_DELETED.Acceptance criteria
deleteFileregistered and dispatchable, bound to thefileID(capital ID) parameterfileID=""→ SDK internal error;fileIDomitted → networkINVALID_FILE_ID(or SDK limitation documented in PR)INVALID_SIGNATURE; double delete →FILE_DELETEDuv run pytest tests/tck -qpassesSpec: https://github.com/hiero-ledger/hiero-sdk-tck/blob/main/docs/test-specifications/file-service/FileDeleteTransaction.md
JS reference: https://github.com/hiero-ledger/hiero-sdk-js/blob/main/tck/methods/file.ts (
deleteFile)