Skip to content

Commit

Permalink
refactor: simplify decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
peterslany committed Jul 3, 2023
1 parent 1f54ddd commit 3d8fe9d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/parachain/amm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,9 @@ export class DefaultAMMAPI implements AMMAPI {
private async _getFarmingRewardCurrencyIds(
lpTokenCurrencyId: InterbtcPrimitivesCurrencyId
): Promise<Array<InterbtcPrimitivesCurrencyId>> {
const rewardCurrencies: Array<InterbtcPrimitivesCurrencyId> = [];

const rewardCurrenciesRaw = await this.api.query.farmingRewards.rewardCurrencies(lpTokenCurrencyId);
rewardCurrenciesRaw.forEach((rewardCurrencyId: InterbtcPrimitivesCurrencyId) =>
rewardCurrencies.push(rewardCurrencyId)
);

const rewardCurrencies = Array.from(rewardCurrenciesRaw.values());

return rewardCurrencies;
}
Expand Down

0 comments on commit 3d8fe9d

Please sign in to comment.