Skip to content

Commit

Permalink
Merge pull request #677 from Sifchain/staging
Browse files Browse the repository at this point in the history
[hotfix] v2.7.3
  • Loading branch information
alanrsoares authored May 24, 2022
2 parents 1af5865 + 92e7ad6 commit ce60705
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 65 deletions.
3 changes: 2 additions & 1 deletion app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Release 2022.05.24

- Re-enable UST and LUNA
- Enable cancelling unbonding requests
- Re-enable UST and LUNA
- Fix pool share & pool value display

## Release 2022.05.12

Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "2.7.2",
"version": "2.7.3",
"private": true,
"scripts": {
"bump": "bump patch --tag --commit 'testnet release '",
Expand Down
2 changes: 1 addition & 1 deletion app/src/business/usecases/clp/syncPools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function SyncPools(
throw new Error("Missing liquidity provider");
}

const lp = LiquidityProvider(
const lp = new LiquidityProvider(
asset,
Amount(lpItem.liquidityProvider.liquidityProviderUnits),
address,
Expand Down
6 changes: 1 addition & 5 deletions app/src/views/PoolPage/PoolItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Competition,
CompetitionsLookup,
} from "../LeaderboardPage/useCompetitionData";
import { COLUMNS_LOOKUP, PoolRewardProgram } from "./usePoolPageData";
import { COLUMNS_LOOKUP } from "./usePoolPageData";
import { useUserPoolData } from "./useUserPoolData";

export default defineComponent({
Expand Down Expand Up @@ -60,10 +60,6 @@ export default defineComponent({
type: Object as PropType<AccountPool>,
required: false,
},
bonusRewardPrograms: {
type: Array as PropType<PoolRewardProgram[]>,
required: true,
},
competitionsLookup: {
type: Object as PropType<CompetitionsLookup>,
required: false,
Expand Down
57 changes: 1 addition & 56 deletions app/src/views/PoolPage/PoolPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@ import {
useRemoveLiquidityMutation,
} from "@/domains/clp/mutation/liquidity";
import { useCurrentRewardPeriod } from "@/domains/clp/queries/params";
import { useNativeChain } from "@/hooks/useChains";
import { flagsStore, isAssetFlaggedDisabled } from "@/store/modules/flags";
import BigNumber from "bignumber.js";
import { formatDistance } from "date-fns";
import { computed, defineComponent } from "vue";
import { RouterView } from "vue-router";
import {
CompetitionsBySymbolLookup,
useLeaderboardCompetitions,
} from "../LeaderboardPage/useCompetitionData";
import PoolItem from "./PoolItem";
import {
COLUMNS,
PoolPageColumnId,
PoolRewardProgram,
usePoolPageData,
} from "./usePoolPageData";
import { COLUMNS, PoolPageColumnId, usePoolPageData } from "./usePoolPageData";

export default defineComponent({
name: "PoolsPage",
Expand All @@ -47,7 +37,6 @@ export default defineComponent({
}),
cancelLiquidityUnlockMutation: useCancelLiquidityUnlockMutation(),
currentRewardPeriod,
competitionsRes: useLeaderboardCompetitions(),
rewardProgramsRes: data.rewardProgramsRes,
allPoolsData: data.allPoolsData,
isLoading: computed(
Expand All @@ -56,39 +45,6 @@ export default defineComponent({
};
},
computed: {
poolRewardProgramLookup(): Record<string, PoolRewardProgram[]> {
const lookup: Record<string, PoolRewardProgram[]> = {};

this.rewardProgramsRes.data.value?.forEach((program) => {
if (program.isUniversal) return;

if (
new Date() < new Date(program.startDateTimeISO ?? "") ||
new Date() > new Date(program.endDateTimeISO ?? "")
) {
return;
}

program.incentivizedPoolSymbols.forEach((symbol) => {
const asset = useNativeChain().findAssetWithLikeSymbol(symbol);

if (asset) {
let list = lookup[asset.symbol];
if (!list) list = lookup[asset.symbol] = [];
list.push(program);
}
});
});

for (const symbol in lookup) {
lookup[symbol.slice(1)] = lookup[symbol];
}

return lookup;
},
symbolCompetitionsLookup(): CompetitionsBySymbolLookup | null {
return this.competitionsRes.data?.value || null;
},
sanitizedPoolData(): ReturnType<
typeof usePoolPageData
>["allPoolsData"]["value"] {
Expand Down Expand Up @@ -231,11 +187,6 @@ export default defineComponent({
}
>
{this.sanitizedPoolData.map((item) => {
const rewardsPrograms =
this.poolRewardProgramLookup[
item.pool.externalAmount!.symbol
] ?? [];

const itemLp = item.liquidityProvider?.liquidityProvider;
const filteredUnlock =
item.liquidityProvider?.liquidityProvider?.unlocks.filter(
Expand Down Expand Up @@ -313,12 +264,6 @@ export default defineComponent({
}),
}
}
bonusRewardPrograms={rewardsPrograms}
competitionsLookup={
this.symbolCompetitionsLookup?.[
item.pool.externalAmount!.symbol
]
}
pool={item.pool}
poolStat={item.poolStat}
accountPool={item.accountPool}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sifchain-ui",
"version": "2.7.2",
"version": "2.7.3",
"private": true,
"license": "UNLICENSED",
"packageManager": "[email protected]",
Expand Down

1 comment on commit ce60705

@vercel
Copy link

@vercel vercel bot commented on ce60705 May 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.