-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add transaction deletion endpoint #1063
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! 👏 I've left comments related to minor things only.
DELETE_TRANSACTION_DTO_SCHEMA_ID, | ||
deleteTransactionDtoSchema, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: missing newline between functions 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 731824e.
); | ||
} | ||
transform(data: unknown): DeleteTransactionDto { | ||
return this.genericValidator.validate(this.isValid, data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should set the error status (400 - bad request) here, what do you think?
It's done that way in other ValidationPipes and I think it makes sense to communicate that a validation error at this level is a client-side error (400).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I've added it in 731824e but in a type safe way (adjusted in other PRs).
This adds the
DELETE
chains/:chainId/transactions/:safeTxHash
endpoint for deleting transactions (in accordance with theDELETE
/v1/transactions/{safe_tx_hash}
endpoint of the Transaction Service) with associated test coverage.Changes
From "root" to call:
deleteTransaction
has been added to theTransactionApi
andITransactionApi
interfacedeleteTransaction
has been added to theSafeRepository
andISafeRepository
interfacedeleteTransaction
has been added to theTransactionsService
DELETE
chains/:chainId/transactions/:safeTxHash
has been added to theTransactionsController
, accepting theDeleteTransactionDto
(and validated by theDeleteTransactionDtoValidationPipe
)DeleteTransactionDto
According to the Transaction Service, the above is used as follows:
An EOA is required to sign the following EIP712 data:
The
totp
parameter is calculated with T0=0 and Tx=3600. It is calculated by taking the Unix UTC epoch time (without milliseconds) and dividing it by 3600 (natural division, no decimals).