Skip to content

Commit

Permalink
changing to if else;
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz Gustavo Abou Hatem De Liz committed Aug 8, 2023
1 parent 57e0421 commit e388da6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions balancer-js/src/modules/data/gyro-config/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ export class GyroConfigRepositoryImpl implements GyroConfigRepository {
const [, [hasSpecificKey, hasPoolTypeKey, hasDefaultKey]] =
await this.multicall.callStatic.aggregate(payload);

const keyToBeUsed = hasSpecificKey
? encodedPoolSpecificKey
: hasPoolTypeKey
? encodedPoolTypeKey
: hasDefaultKey
? protocolFeePercKey
: undefined;
if (keyToBeUsed) {
if (hasSpecificKey) {
fee = parseFloat(
formatFixed(await this.gyroConfig.getUint(keyToBeUsed), 18)
formatFixed(await this.gyroConfig.getUint(encodedPoolSpecificKey), 18)
);
} else if (hasPoolTypeKey) {
fee = parseFloat(
formatFixed(await this.gyroConfig.getUint(encodedPoolTypeKey), 18)
);
} else if (hasDefaultKey) {
fee = parseFloat(
formatFixed(await this.gyroConfig.getUint(protocolFeePercKey), 18)
);
} else {
fee = 0;
Expand Down

0 comments on commit e388da6

Please sign in to comment.