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

refactor: ERC-20 deposit #21

Merged
merged 5 commits into from
Jan 16, 2024
Merged

Conversation

brunomenezes
Copy link
Collaborator

Summary

Some refactoring was done to the logic handling the erc-20 deposit, previously done by a public method called handlePayload(). After adding code for erc-721 deposits, the idea is to have the same method naming to deal with its own piece of logic. Also, method visibility was applied, so each prepare*() is private, so tests should only be done through the handle() method and then expectations are checked.

Changelog:

  • Move erc-20 deposit logic handling to the prepareErc20Deposit(), including its storage setting and related logging.
  • Remove the handlePayload() method.
  • Set params for both prepare*() methods as a const tuple and use spread to pass down to each method.
  • Set both prepare* method visibility to private.
  • Remove tests that were targeting implementation details in the past, i.e. handlePayload().
  • Also applied a bit of refactoring in the testing setups and mockings in general.

@brunomenezes
Copy link
Collaborator Author

That is odd. The Overall Coverage dropped. That is for the OwnershipTransferred, let me check a case.

@brunomenezes brunomenezes force-pushed the refactor/erc-20-deposit-handling branch from 3c39b34 to 792e8ce Compare December 19, 2023 01:46
@brunomenezes brunomenezes force-pushed the refactor/erc-20-deposit-handling branch from 792e8ce to 8422d8e Compare December 19, 2023 01:48
@brunomenezes brunomenezes self-assigned this Dec 20, 2023
dandheedge
dandheedge previously approved these changes Jan 12, 2024
src/handlers/InputAdded.ts Outdated Show resolved Hide resolved
@dandheedge dandheedge merged commit 0b91cb4 into main Jan 16, 2024
2 checks passed
@dandheedge dandheedge deleted the refactor/erc-20-deposit-handling branch January 16, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants