Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix: revert rebindLabel on curve (#771)
Browse files Browse the repository at this point in the history
  • Loading branch information
xdrdak authored Jun 27, 2022
1 parent 71edf22 commit b142def
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/apps/curve/helpers/curve.pool.token-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ type CurvePoolTokenHelperParams<T = CurveToken, V = Erc20> = {
}) => Promise<number>;
};

const labelAllowList = ['3pool', '2pool', 'tricrypto2', 'tricrypto'];
function rebindLabel(opt: { expectedLabel?: string; fallbackLabel: string }) {
if (opt.expectedLabel && labelAllowList.includes(opt.expectedLabel.toLowerCase())) {
return opt.expectedLabel;
}

return opt.fallbackLabel;
}

const isMetaPool = (token: Token) =>
token.type === ContractType.APP_TOKEN &&
token.appId === CURVE_DEFINITION.id &&
Expand Down Expand Up @@ -151,10 +142,7 @@ export class CurvePoolTokenHelper {

// Display Properties
const underlyingLabels = tokens.map(v => (isMetaPool(v) ? getLabelFromToken(v) : v.symbol)); // Flatten metapool label
const label = rebindLabel({
expectedLabel: definition.label,
fallbackLabel: underlyingLabels.join(' / '),
});
const label = definition.label ?? underlyingLabels.join(' / ');
const secondaryLabel = reservePercentages.map(p => `${Math.floor(p * 100)}%`).join(' / ');
const images = underlyingTokens.map(t => getImagesFromToken(t)).flat();

Expand Down

0 comments on commit b142def

Please sign in to comment.