Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:balancer/frontend-v2 into feat/c…
Browse files Browse the repository at this point in the history
…hain-boost-sync
  • Loading branch information
alter-eggo committed Jun 26, 2023
2 parents 7b3d222 + a1d3c5f commit 8560cbb
Show file tree
Hide file tree
Showing 37 changed files with 837 additions and 519 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/allowlist-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Allowlist pool

on:
workflow_dispatch:
inputs:
network:
type: choice
description: Network
required: true
options:
- mainnet
- polygon
- arbitrum
- gnosis-chain
poolType:
type: choice
description: Pool Type
required: true
options:
- Weighted
- Stable
poolId:
type: string
description: Pool ID
required: true
poolDescription:
type: string
description: Pool Description
required: false

jobs:
allowlist-pool:
uses: ./.github/workflows/allowlist.yml
with:
network: ${{ github.event.inputs.network }}
poolType: ${{ github.event.inputs.poolType }}
poolId: ${{ github.event.inputs.poolId }}
poolDescription: ${{ github.event.inputs.poolDescription }}
14 changes: 14 additions & 0 deletions .github/workflows/allowlist-webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Allowlist Pool Webhook

on:
repository_dispatch:
types: ['allowlist_pool']

jobs:
allowlist-pool:
uses: ./.github/workflows/allowlist.yml
with:
network: ${{ github.event.client_payload.network }}
poolType: ${{ github.event.client_payload.poolType }}
poolId: ${{ github.event.client_payload.poolId }}
poolDescription: ${{ github.event.client_payload.poolDescription }}
27 changes: 7 additions & 20 deletions .github/workflows/allowlist.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
name: Allowlist pool

on:
workflow_dispatch:
workflow_call:
inputs:
network:
type: choice
description: Network
type: string
required: true
options:
- mainnet
- polygon
- arbitrum
- gnosis-chain
poolType:
type: choice
description: Pool Type
type: string
required: true
options:
- Weighted
- Stable
poolId:
type: string
description: Pool ID
required: true
poolDescription:
type: string
description: Pool Description
required: false

jobs:
allowlist-pool:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3
Expand All @@ -44,21 +31,21 @@ jobs:
- name: Install deps
run: npm install cac
- name: Run allowlist script
run: npx vite-node ./src/lib/scripts/automatic-prs/allowlist-pool.ts --network ${{github.event.inputs.network}} --poolType ${{github.event.inputs.poolType}} --poolId \"${{github.event.inputs.poolId}}\" --poolDescription "${{github.event.inputs.poolDescription}}"
run: npx vite-node ./src/lib/scripts/automatic-prs/allowlist-pool.ts --network ${{inputs.network}} --poolType ${{inputs.poolType}} --poolId \"${{inputs.poolId}}\" --poolDescription "${{inputs.poolDescription}}"
- name: Run eslint fix of updated config files
run: npm run lint:fix:config
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: Update allowlist'
commit-message: 'chore: Add ${{inputs.poolDescription}} pool to ${{inputs.network}} allowlist'
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: update-allowlist
branch: update-allowlist-${{inputs.network}}-${{inputs.poolId}}
base: master
delete-branch: true
title: 'Update pool allowlist'
title: 'Allowlist ${{inputs.poolDescription}} pool'
body: |
This PR was autogenerated by the allowlist manual Github action.
draft: false
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ FROM dependencies AS build
COPY . .
RUN npm run build:docker

FROM nginx:1.23.3-alpine as release
FROM nginx:1.25.1-alpine as release

COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=build /app/scripts/docker-init.sh /
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@balancer/frontend-v2",
"version": "1.107.3",
"version": "1.108.8",
"engines": {
"node": "=16",
"npm": ">=8"
Expand Down
2 changes: 1 addition & 1 deletion public/data/hardcoded-gauges.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"address": "0x145011e0C04805E11BEf23c1EEd848Faf49bB779",
"network": 137,
"isKilled": true,
"isKilled": false,
"addedTimestamp": 1663017781,
"relativeWeightCap": "null",
"pool": {
Expand Down
1 change: 1 addition & 0 deletions src/assets/images/icons/protocols/0vix.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 15 additions & 14 deletions src/components/_global/BalActionSteps/BalActionSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ function handleSignAction(state: TransactionActionState) {
async function handleTransaction(
tx: TransactionResponse,
state: TransactionActionState,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
actionInfo: TransactionActionInfo
): Promise<void> {
const { postActionValidation, actionInvalidReason } = actionInfo;
// const { postActionValidation, actionInvalidReason } = actionInfo;
await txListener(tx, {
onTxConfirmed: async (receipt: TransactionReceipt) => {
Expand All @@ -229,21 +230,21 @@ async function handleTransaction(
state.confirming = false;
const isValid = await postActionValidation?.();
if (isValid || !postActionValidation) {
const confirmedAt = await getTxConfirmedAt(receipt);
state.confirmedAt = dateTimeLabelFor(confirmedAt);
state.confirmed = true;
if (currentActionIndex.value >= actions.value.length - 1) {
emit('success', { receipt, confirmedAt: state.confirmedAt });
} else {
currentActionIndex.value += 1;
}
// const isValid = await postActionValidation?.();
// if (isValid || !postActionValidation) {
const confirmedAt = await getTxConfirmedAt(receipt);
state.confirmedAt = dateTimeLabelFor(confirmedAt);
state.confirmed = true;
if (currentActionIndex.value >= actions.value.length - 1) {
emit('success', { receipt, confirmedAt: state.confirmedAt });
} else {
// post action validation failed, display reason.
if (actionInvalidReason) state.error = actionInvalidReason;
state.init = false;
currentActionIndex.value += 1;
}
// } else {
// // post action validation failed, display reason.
// if (actionInvalidReason) state.error = actionInvalidReason;
// state.init = false;
// }
},
onTxFailed: () => {
state.confirming = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import useNetwork from '@/composables/useNetwork';
import {
deprecatedDetails,
gaugeMigrationDetails,
newVersionDetails,
} from '@/composables/usePoolHelpers';
import NewPoolData from './NewPoolData.vue';
import usePoolsQuery from '@/composables/queries/usePoolsQuery';
Expand All @@ -29,7 +30,10 @@ const { networkSlug } = useNetwork();
const { t } = useI18n();
const migrationInfo = computed(
() => deprecatedDetails(props.poolId) || gaugeMigrationDetails(props.poolId)
() =>
deprecatedDetails(props.poolId) ||
gaugeMigrationDetails(props.poolId) ||
newVersionDetails(props.poolId)
);
const newPoolQueryEnabled = computed(
Expand Down Expand Up @@ -92,6 +96,15 @@ const description = computed(() => {
return t('migrateCard.description');
});
const title = computed(() => {
const cardTitle = migrationInfo.value?.title;
if (cardTitle) {
return t(cardTitle);
}
return t('migrateCard.title');
});
</script>

<template>
Expand All @@ -104,7 +117,7 @@ const description = computed(() => {
<div class="flex flex-col items-center text-white">
<div class="container pt-5">
<div class="mb-2 text-3xl font-bold text-opacity-90">
{{ $t('migrateCard.title') }}
{{ title }}
</div>
<div class="mb-3 text-sm font-medium text-opacity-80">
{{ description }}
Expand Down
17 changes: 17 additions & 0 deletions src/components/contextual/pages/pool/risks/PoolRiskList.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script lang="ts" setup>
import { Risk } from '@/composables/usePoolRisks';
interface Props {
risks: Risk[];
}
defineProps<Props>();
</script>

<template>
<ul class="px-8 lg:px-4 list-disc">
<li v-for="{ title, hash } in risks" :key="hash" class="mb-1 link">
<router-link :to="{ name: 'risks', hash }">{{ title }}</router-link>
</li>
</ul>
</template>
39 changes: 19 additions & 20 deletions src/components/contextual/pages/pool/risks/PoolRisks.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<script setup lang="ts">
import { Pool } from '@/services/pool/types';
import { riskLinks, risksTitle, poolSpecificRisks } from './pool-risks';
import {
riskLinks,
risksTitle,
poolSpecificRisks,
} from '@/composables/usePoolRisks';
import PoolRiskList from './PoolRiskList.vue';
/**
* TYPES
Expand All @@ -12,35 +17,29 @@ type Props = {
/**
* PROPS
*/
defineProps<Props>();
const props = defineProps<Props>();
const _poolSpecificRisks = poolSpecificRisks(props.pool);
const _poolGeneralRisks = riskLinks(props.pool);
const hasSpecificRisks = _poolSpecificRisks.length > 0;
</script>

<template>
<div id="risks-section">
<h3 class="px-4 lg:px-0 mb-5" v-text="$t('poolRisks.title')" />
<h3 class="px-4 lg:px-0 mb-3" v-text="$t('poolRisks.title')" />

<p v-if="poolSpecificRisks(pool)" class="px-4 lg:px-0 mb-5">
{{ poolSpecificRisks(pool) }}
</p>
<PoolRiskList
v-if="hasSpecificRisks"
:risks="_poolSpecificRisks"
class="mb-3"
/>

<p class="px-4 lg:px-0 mb-3">
{{ risksTitle(pool) }}
</p>

<ul class="px-8 lg:px-4 list-disc">
<li
v-for="{ title, hash } in riskLinks(pool)"
:key="hash"
class="mb-1 link"
>
<router-link :to="{ name: 'risks', hash }">{{ title }}</router-link>
</li>
<li class="link">
<router-link :to="{ name: 'risks', hash: '#general-risks' }"
>General Balancer protocol risks</router-link
>
</li>
</ul>
<PoolRiskList :risks="_poolGeneralRisks" />
</div>
</template>

2 changes: 1 addition & 1 deletion src/components/contextual/pages/vebal/Hero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function navigateToGetVeBAL() {
</BalBtn>
<BalBtn
tag="a"
href="https://docs.balancer.fi/ecosystem/vebal-and-gauges"
href="https://docs.balancer.fi/concepts/governance/veBAL/"
target="_blank"
rel="noreferrer"
color="white"
Expand Down
5 changes: 5 additions & 0 deletions src/composables/useBoostedPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export enum BoostedProtocol {
Reaper = 'reaper',
Tetu = 'tetu',
Granary = 'granary',
Zerovix = '0vix',
}

export const boostedProtocolIconPaths: Record<BoostedProtocol, string> = {
Expand Down Expand Up @@ -67,4 +68,8 @@ export const boostedProtocolIconPaths: Record<BoostedProtocol, string> = {
'@/assets/images/icons/protocols/tetu.png',
import.meta.url
).href,
[BoostedProtocol.Zerovix]: new URL(
'@/assets/images/icons/protocols/0vix.svg',
import.meta.url
).href,
};
Loading

0 comments on commit 8560cbb

Please sign in to comment.