Skip to content
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

Counterfactual Safes deletion endpoints #1795

Merged
merged 20 commits into from
Aug 5, 2024

Conversation

hectorgomezv
Copy link
Member

Depends on #1789

Summary

This PR adds a subset of the Counterfactual Safes storage controller endpoints. Specifically:

DELETE /v1/accounts/:address/storage/counterfactual-safes/:chainId/:predictedAddress
DELETE /v1/accounts/:address/storage/counterfactual-safes

The first one deletes an existing Counterfactual Safe by the creator's account address, the chain ID, and the predicted address of the Safe to be deployed.

The second deletes all the Counterfactual Safes associated with the address, i.e.: the address being the creator of the Counterfactual Safes.

Changes

  • Add DELETE /v1/accounts/:address/storage/counterfactual-safes/:chainId/:predictedAddress
  • Add DELETE /v1/accounts/:address/storage/counterfactual-safes

@hectorgomezv hectorgomezv self-assigned this Jul 31, 2024
@hectorgomezv hectorgomezv requested a review from a team as a code owner July 31, 2024 14:29
@hectorgomezv hectorgomezv changed the title Counterfactual safes deletion routes Counterfactual Safes deletion routes Jul 31, 2024
@hectorgomezv hectorgomezv changed the title Counterfactual Safes deletion routes Counterfactual Safes deletion endpoints Jul 31, 2024
@coveralls
Copy link

coveralls commented Jul 31, 2024

Pull Request Test Coverage Report for Build 10217581347

Details

  • 3 of 17 (17.65%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.08%) to 48.102%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/routes/accounts/counterfactual-safes/counterfactual-safes.controller.ts 3 5 60.0%
src/routes/accounts/counterfactual-safes/counterfactual-safes.service.ts 0 2 0.0%
src/domain/accounts/counterfactual-safes/counterfactual-safes.repository.ts 0 10 0.0%
Totals Coverage Status
Change from base Build 10182886410: -0.08%
Covered Lines: 4421
Relevant Lines: 7415

💛 - Coveralls

).not.toHaveBeenCalled();
});

it('returns 403 if chain_id is not a valid chain ID', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding another test case that ensure the token is valid if signed on a different chain?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 650d3f6

@@ -584,4 +584,337 @@ describe('CounterfactualSafesController', () => {
).not.toHaveBeenCalled();
});
});

describe('Delete Counterfactual Safe', () => {
it('should delete a Counterfactual Safe', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add test coverage regarding a datasource error. These assume that deletion was successful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 650d3f6 (I've added that test also to the rest of endpoints)

Base automatically changed from counterfactual-safes-domain-and-routes to main July 31, 2024 15:12
@hectorgomezv hectorgomezv merged commit c7d5f55 into main Aug 5, 2024
16 checks passed
@hectorgomezv hectorgomezv deleted the counterfactual-safes-deletion-routes branch August 5, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants