Skip to content

Commit

Permalink
Merge pull request #490 from HausDAO/fix/multicall-tx-order
Browse files Browse the repository at this point in the history
Fix multicall tx ordering
  • Loading branch information
skuhlmann authored Apr 3, 2024
2 parents 89b1af4 + 0cd370b commit d7a5f63
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libs/tx-builder/src/utils/multicall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,13 @@ const handleMulticallFormActions = ({
if (!validTxs.length) {
throw new Error('No actions found');
}
// TODO: sort by tx.actionId.index
return validTxs.map((actionId: string) => {
const sortedTxs = validTxs.sort((actionA: string, actionB: string) =>
Number(appState.formValues.tx[actionA].index) >
Number(appState.formValues.tx[actionB].index)
? 1
: -1
);
return sortedTxs.map((actionId: string) => {
const action = appState.formValues.tx[actionId];
const { to, data, value, operation } = action;
return {
Expand Down

0 comments on commit d7a5f63

Please sign in to comment.