You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The need of creating a batch not only in the normal flow "createTransaction" but also in the counterfactual deployment created some duplicated logic that should be reviewed.
createTransactionBatch was intended to handle the batch encoding given a set of transactions which could be used as an util in the necessary methods. As it consumes several components form the Safe class that couldn't be referenced inside of an util at the moment the method was created first on the Safe class for speed and convenience.
Once the package was published, the method is exposed to developers which get it autosuggested when they type createTransaction adding confusion to which of those they should use as both accept an array of transactions.
Proposed solution
Refactor createTransactionBatch to be an internal util at transactions/utils
Change the function props to be an object containing the following: contractManager, transactions, transactionOptions, callOnly = true
Passing the contractManager this.contractManager should be enough to remove the dependencies with all the properties of the Safe class.
Check the current batch implementation inside of createTransaction which uses this approach already.
The text was updated successfully, but these errors were encountered:
Context / issue
The need of creating a batch not only in the normal flow "createTransaction" but also in the counterfactual deployment created some duplicated logic that should be reviewed.
createTransactionBatch
was intended to handle the batch encoding given a set of transactions which could be used as an util in the necessary methods. As it consumes several components form the Safe class that couldn't be referenced inside of an util at the moment the method was created first on the Safe class for speed and convenience.Once the package was published, the method is exposed to developers which get it autosuggested when they type
createTransaction
adding confusion to which of those they should use as both accept an array of transactions.Proposed solution
Refactor
createTransactionBatch
to be an internal util attransactions/utils
Change the function props to be an object containing the following:
contractManager, transactions, transactionOptions, callOnly = true
Passing the contractManager
this.contractManager
should be enough to remove the dependencies with all the properties of the Safe class.Check the current batch implementation inside of
createTransaction
which uses this approach already.The text was updated successfully, but these errors were encountered: