LayerZero-Labs / devtools

LayerZero Developer Utilities
https://docs.layerzero.network/
97 stars 157 forks source link

🧹 Turn existing flows into flow factories #912

Closed janjakubnanista closed 1 month ago

janjakubnanista commented 1 month ago

In this PR

After arriving at the point of being able to create the wire flow, I realized that in the current setup, the wire flow would need to pass a lot of arguments through to these flows, e.g.

This would be an anti-pattern and could grow into a massive headache down the line. Instead, since the flows have not been released yet, I turned them into flow factories. This means that the internal information they need is encapsulated in a closure and the overarching flows don't need to care about the internals.

The only place that suffered is the hardhat setup where the subtasks (e.g. SUBTASK_LZ_SIGN_AND_SEND) now need to create and immediately execute these flows - nothing horrible, just a side effect of moving to the standalone CLI structure.

This PR consists mostly of indentation changes, sorry for the diff.