explorer
explorer copied to clipboard
Refactor transaction related code
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