explorer icon indicating copy to clipboard operation
explorer copied to clipboard

Refactor transaction related code

Open AnthonyLaw opened this issue 3 years ago • 0 comments

You can see that many common files need to be touched when adding a new transaction. Examples are CreateTransaction.js, TransactionService.js, etc.

It could be possible to have a TransactionTypeHandler interface and a TransactionTypeManager object that controls instances of the interface.

The manager selects the right handler by transaction type (and probably version) and delegates the different methods. Then, adding a new transaction type is just creating a new implementation of TransactionTypeHandler and registering it to the TransactionTypeManager.

I move your comment here, in case i forget :)

CC: @fboucquez

AnthonyLaw avatar Nov 24 '21 16:11 AnthonyLaw