Skip to content

Commit

Permalink
simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
mrq1911 committed Mar 19, 2024
1 parent 5d47e9d commit d903dbd
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ class MultiCurrencyPaymentRoutes extends PolkadotExecutor {
.filter(({ section }) => section === 'router')
.filter(({ asset_in, asset_out }) => [asset_in, asset_out].sort() )
.map(({ args }) => args)
.filter(({ asset_in, asset_out }) => !onchain.find(({ assets }) => {
const [a, b] = assets;
return (a === asset_in && b === asset_out) || (a === asset_out && b === asset_in);
}))
.filter(({ asset_in, asset_out }) => !onchain.find(({ assets: [a, b] }) => (a === asset_in && b === asset_out) || (a === asset_out && b === asset_in)))
.map(({ asset_in, asset_out, route }) =>
api.tx.router.setRoute([asset_in, asset_out], route)
);
Expand Down

0 comments on commit d903dbd

Please sign in to comment.