Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Refactor createTransaction/processTransaction #3187

Closed
katspaugh opened this issue Dec 16, 2021 · 0 comments 路 Fixed by #3239
Closed

Refactor createTransaction/processTransaction #3187

katspaugh opened this issue Dec 16, 2021 · 0 comments 路 Fixed by #3239
Assignees
Labels
Tech-debt 馃毀 Technical debt

Comments

@katspaugh
Copy link
Member

katspaugh commented Dec 16, 2021

These two functions are problematic for many reasons.

  • They share a lot of duplicate code with slight differences
  • The functions are very long 馃崫
  • Logic is intertwined with UI notifications
  • A mixture of promises, web3 events and async-await
  • Lots of external parameters that could be better served by calling separate functions (e.g. execution vs signing)

Solution

  • Break down the two big functions into smaller functions
  • Decouple separate pieces of logic
  • Extract side-effects like notifications
  • Unify duplicated code across the two functions
  • Create a more sensible API for components, separate the calls into:
    • tx creation w/o execution
    • off-chain signing
    • execution/on-chain signing
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Tech-debt 馃毀 Technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants