Skip to content

Commit

Permalink
fix: reduce commands
Browse files Browse the repository at this point in the history
Co-authored-by: Jesus Lanchas <[email protected]>
  • Loading branch information
web3rover and chechu authored Dec 24, 2024
1 parent 85e140f commit 53f1477
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion vips/vip-410/bscmainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,19 @@ const commands = emissions.map(emission => {
],
dstChainId: emission.chainId,
};
});
}).reduce((accumulator, currentValue) => {
const command = accumulator.find(
it => it.target == currentValue.target && it.dstChainId == currentValue.dstChainId,
);
if (!command) {
accumulator.push(currentValue);
} else {
command.params[0].push(currentValue.params[0][0]);
command.params[1].push(currentValue.params[1][0]);
command.params[2].push(currentValue.params[2][0]);
}
return accumulator;
}, []);

export const vip410 = () => {
const meta = {
Expand Down

0 comments on commit 53f1477

Please sign in to comment.