From ac5c69e81eede75c7f25bb6e6f44ee3465435dbc Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Wed, 13 Sep 2023 21:49:40 -0400 Subject: [PATCH 01/19] ff-prod deploys (and less code) --- .github/actions/prepare-deploy/action.yml | 8 +++- .github/workflows/catalyst-deploy.yml | 31 ---------------- .github/workflows/demo-deploys.yml | 30 --------------- .github/workflows/deploy_all.yml | 41 +++++++++++++++++++++ .github/workflows/main-branch-deploys.yml | 17 +++++++++ .github/workflows/manual-deploys.yml | 19 ++++++++++ .github/workflows/moonbeam-alpha-deploy.yml | 34 ----------------- 7 files changed, 84 insertions(+), 96 deletions(-) delete mode 100644 .github/workflows/catalyst-deploy.yml delete mode 100644 .github/workflows/demo-deploys.yml create mode 100644 .github/workflows/deploy_all.yml create mode 100644 .github/workflows/main-branch-deploys.yml create mode 100644 .github/workflows/manual-deploys.yml delete mode 100644 .github/workflows/moonbeam-alpha-deploy.yml diff --git a/.github/actions/prepare-deploy/action.yml b/.github/actions/prepare-deploy/action.yml index 490b0bb75b..37fd6bd42d 100644 --- a/.github/actions/prepare-deploy/action.yml +++ b/.github/actions/prepare-deploy/action.yml @@ -79,7 +79,13 @@ runs: # DEV echo "function_name=${{ inputs.app_base_name }}-dev" >> $GITHUB_OUTPUT echo "front_url=${{ inputs.app_base_name }}-dev.k-f.dev" >> $GITHUB_OUTPUT - echo "env_name=development" >> $GITHUB_OUTPUT + echo "env_name=development" >> $GITHUB_OUTPUT + if ${{ inputs.deploy_to == 'ff-production' }}; then + # FF-PRODUCTION + # A build from the DEV env that points to prod + echo "function_name=${{ inputs.app_base_name }}-ff-production" >> $GITHUB_OUTPUT + echo "front_url=ff-production.k-f.dev" >> $GITHUB_OUTPUT + echo "env_name=production" >> $GITHUB_OUTPUT elif ${{ github.event_name == 'pull_request' }}; then # PR echo "function_name=${{ inputs.app_base_name }}-pr${{ github.event.number }}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/catalyst-deploy.yml b/.github/workflows/catalyst-deploy.yml deleted file mode 100644 index 3c6d323231..0000000000 --- a/.github/workflows/catalyst-deploy.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Deploy Catalyst -on: - push: - tags: - - "centrifuge-app/v*" -concurrency: - # Cancel any staging or prod deployment on-going - # in favor of this new pre-release - group: catalyst-deployment - cancel-in-progress: true - -jobs: - app-staging: - uses: ./.github/workflows/centrifuge-app.yml - secrets: inherit - with: - deploy_env: catalyst - - - pinning-staging: - uses: ./.github/workflows/pinning-api.yml - secrets: inherit - with: - deploy_env: catalyst - - - onboarding-staging: - uses: ./.github/workflows/onboarding-api.yml - secrets: inherit - with: - deploy_env: catalyst \ No newline at end of file diff --git a/.github/workflows/demo-deploys.yml b/.github/workflows/demo-deploys.yml deleted file mode 100644 index b0ef1ef426..0000000000 --- a/.github/workflows/demo-deploys.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: "Demo deployments (manual)" -on: - workflow_dispatch: - -jobs: - app-demo: - uses: ./.github/workflows/centrifuge-app.yml - secrets: inherit - with: - deploy_env: demo - - - pinning-demo: - uses: ./.github/workflows/pinning-api.yml - secrets: inherit - with: - deploy_env: demo - - - onboarding-demo: - uses: ./.github/workflows/onboarding-api.yml - secrets: inherit - with: - deploy_env: demo - - faucet-demo: - uses: ./.github/workflows/faucet-api.yml - secrets: inherit - with: - deploy_env: demo \ No newline at end of file diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml new file mode 100644 index 0000000000..f4c2adaf79 --- /dev/null +++ b/.github/workflows/deploy_all.yml @@ -0,0 +1,41 @@ +name: "Deploy all apps" +on: + # Allow this wofkflow as a universal "deployer" to + # call from other workflows. + workflow_call: + inputs: + environment: + required: true + type: string + +jobs: + app: + name: app-${{ inputs.environment}} + uses: ./.github/workflows/centrifuge-app.yml + secrets: inherit + with: + deploy_env: ${{ inputs.environment}} + + + pinning: + name: pinning-${{ inputs.environment}} + uses: ./.github/workflows/pinning-api.yml + secrets: inherit + with: + deploy_env: ${{ inputs.environment}} + + + onboarding: + name: onboarding-${{ inputs.environment}} + uses: ./.github/workflows/onboarding-api.yml + secrets: inherit + with: + deploy_env: ${{ inputs.environment}} + + faucet: + name: faucet-${{ inputs.environment}} + if: ${{ inputs.environment == 'demo' || inputs.environment == 'development' }} + uses: ./.github/workflows/faucet-api.yml + secrets: inherit + with: + deploy_env: ${{ inputs.environment}} \ No newline at end of file diff --git a/.github/workflows/main-branch-deploys.yml b/.github/workflows/main-branch-deploys.yml new file mode 100644 index 0000000000..c9eda19feb --- /dev/null +++ b/.github/workflows/main-branch-deploys.yml @@ -0,0 +1,17 @@ +name: "Moonbeam dev (alpha) deployments (manual)" +on: + push: + branches: main + pull_request: + paths: + - '.github/workflows/main-branch-deploys.yml' + +jobs: + trigger: + strategy: + matrix: + env_taget: [moonbeam-aplha, ff-prod, development] + uses: ./.github/workflows/deploy_all.yml + secrets: inherit + with: + environment: ${{ matrix.env_target }} \ No newline at end of file diff --git a/.github/workflows/manual-deploys.yml b/.github/workflows/manual-deploys.yml new file mode 100644 index 0000000000..18d13bd6e9 --- /dev/null +++ b/.github/workflows/manual-deploys.yml @@ -0,0 +1,19 @@ +name: Deploy to Catalyst and demo +on: + workflow_dispatch: + inputs: + environment: + type: choice + description: where to deploy + options: + - demo + - catalyst +jobs: + trigger: + strategy: + matrix: + env_taget: [moonbeam-aplha, ff-prod, development] + uses: ./.github/workflows/deploy_all.yml + secrets: inherit + with: + environment: ${{ matrix.environment }} \ No newline at end of file diff --git a/.github/workflows/moonbeam-alpha-deploy.yml b/.github/workflows/moonbeam-alpha-deploy.yml deleted file mode 100644 index 16f0014455..0000000000 --- a/.github/workflows/moonbeam-alpha-deploy.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: "Moonbeam dev (alpha) deployments (manual)" -on: - push: - branches: main - pull_request: - paths: - - '.github/workflows/moonbeam-alpha-deploy.yml' - -jobs: - app-moonbeam-alpha: - uses: ./.github/workflows/centrifuge-app.yml - secrets: inherit - with: - deploy_env: moonbeam-alpha - - - pinning-moonbeam-alpha: - uses: ./.github/workflows/pinning-api.yml - secrets: inherit - with: - deploy_env: moonbeam-alpha - - - onboarding-moonbeam-alpha: - uses: ./.github/workflows/onboarding-api.yml - secrets: inherit - with: - deploy_env: moonbeam-alpha - - # faucet-moonbeam-alpha: - # uses: ./.github/workflows/faucet-api.yml - # secrets: inherit - # with: - # deploy_env: moonbeam-alpha \ No newline at end of file From f3c7379ca3d6328d002a2ff8240443cef2969c94 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Wed, 13 Sep 2023 21:53:36 -0400 Subject: [PATCH 02/19] eliminate trigger from main to apps --- .github/workflows/centrifuge-app.yml | 9 --------- .github/workflows/faucet-api.yml | 8 -------- .github/workflows/onboarding-api.yml | 8 -------- .github/workflows/pinning-api.yml | 8 -------- 4 files changed, 33 deletions(-) diff --git a/.github/workflows/centrifuge-app.yml b/.github/workflows/centrifuge-app.yml index 27940baf40..ccd38cac60 100644 --- a/.github/workflows/centrifuge-app.yml +++ b/.github/workflows/centrifuge-app.yml @@ -1,14 +1,5 @@ name: Centrifuge App on: - push: - branches: - - main - paths: - - 'centrifuge-app/**' - - 'centrifuge-js/**' - - 'centrifuge-react/**' - - '.github/workflows/centrifuge-app.yml' - - '.github/actions/deploy-gcs' pull_request: paths: - 'centrifuge-app/**' diff --git a/.github/workflows/faucet-api.yml b/.github/workflows/faucet-api.yml index 42f2b7f483..d238e3d7a8 100644 --- a/.github/workflows/faucet-api.yml +++ b/.github/workflows/faucet-api.yml @@ -1,13 +1,5 @@ name: Faucet API on: - push: - branches: - - main - paths: - - 'faucet-api/**' - - '.github/workflows/faucet-api.yml' - - '.github/actions/deploy-gfunction' - - '.github/actions/build-function' pull_request: paths: - 'faucet-api/**' diff --git a/.github/workflows/onboarding-api.yml b/.github/workflows/onboarding-api.yml index 55b2c36e9d..909735dbe9 100644 --- a/.github/workflows/onboarding-api.yml +++ b/.github/workflows/onboarding-api.yml @@ -1,13 +1,5 @@ name: Onboarding API on: - push: - branches: - - main - paths: - - 'onboarding-api/**' - - '.github/workflows/onboarding-api.yml' - - '.github/actions/deploy-gfunction' - - '.github/actions/build-function' pull_request: paths: - 'onboarding-api/**' diff --git a/.github/workflows/pinning-api.yml b/.github/workflows/pinning-api.yml index a1808e49fe..d35fa9d8fa 100644 --- a/.github/workflows/pinning-api.yml +++ b/.github/workflows/pinning-api.yml @@ -1,13 +1,5 @@ name: Pinning API on: - push: - branches: - - main - paths: - - 'pinning-api/**' - - '.github/workflows/pinning-api.yml' - - '.github/actions/deploy-gfunction' - - '.github/actions/build-function' pull_request: paths: - 'pinning-api/**' From 830b010f6f154bf91fc73c76ea656e57283ee921 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Wed, 13 Sep 2023 21:59:34 -0400 Subject: [PATCH 03/19] fixes --- .github/actions/prepare-deploy/action.yml | 2 +- .github/workflows/main-branch-deploys.yml | 3 ++- .github/workflows/manual-deploys.yml | 8 +++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/actions/prepare-deploy/action.yml b/.github/actions/prepare-deploy/action.yml index 37fd6bd42d..51b977dceb 100644 --- a/.github/actions/prepare-deploy/action.yml +++ b/.github/actions/prepare-deploy/action.yml @@ -80,7 +80,7 @@ runs: echo "function_name=${{ inputs.app_base_name }}-dev" >> $GITHUB_OUTPUT echo "front_url=${{ inputs.app_base_name }}-dev.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=development" >> $GITHUB_OUTPUT - if ${{ inputs.deploy_to == 'ff-production' }}; then + elif ${{ inputs.deploy_to == 'ff-production' }}; then # FF-PRODUCTION # A build from the DEV env that points to prod echo "function_name=${{ inputs.app_base_name }}-ff-production" >> $GITHUB_OUTPUT diff --git a/.github/workflows/main-branch-deploys.yml b/.github/workflows/main-branch-deploys.yml index c9eda19feb..2c91aab5a9 100644 --- a/.github/workflows/main-branch-deploys.yml +++ b/.github/workflows/main-branch-deploys.yml @@ -1,4 +1,4 @@ -name: "Moonbeam dev (alpha) deployments (manual)" +name: "Deploy main branch" on: push: branches: main @@ -8,6 +8,7 @@ on: jobs: trigger: + name: deploy-${{ matrix.env_target }} strategy: matrix: env_taget: [moonbeam-aplha, ff-prod, development] diff --git a/.github/workflows/manual-deploys.yml b/.github/workflows/manual-deploys.yml index 18d13bd6e9..c7985a3b7d 100644 --- a/.github/workflows/manual-deploys.yml +++ b/.github/workflows/manual-deploys.yml @@ -9,11 +9,9 @@ on: - demo - catalyst jobs: - trigger: - strategy: - matrix: - env_taget: [moonbeam-aplha, ff-prod, development] + deploy: + name: deploy-${{ inputs.environment }} uses: ./.github/workflows/deploy_all.yml secrets: inherit with: - environment: ${{ matrix.environment }} \ No newline at end of file + environment: ${{ inputs.environment }} \ No newline at end of file From 8308641523ace00df335c801a5f6a84d7dfc2c6f Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Wed, 13 Sep 2023 22:27:28 -0400 Subject: [PATCH 04/19] try matrix in reusable workflow --- .github/workflows/main-branch-deploys.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main-branch-deploys.yml b/.github/workflows/main-branch-deploys.yml index 2c91aab5a9..1ece2a4166 100644 --- a/.github/workflows/main-branch-deploys.yml +++ b/.github/workflows/main-branch-deploys.yml @@ -1,4 +1,4 @@ -name: "Deploy main branch" +name: deploy-main on: push: branches: main @@ -8,11 +8,11 @@ on: jobs: trigger: - name: deploy-${{ matrix.env_target }} + name: deploy-${{ matrix.env }} strategy: matrix: - env_taget: [moonbeam-aplha, ff-prod, development] + env: ['moonbeam-aplha', 'ff-prod', 'development'] uses: ./.github/workflows/deploy_all.yml secrets: inherit with: - environment: ${{ matrix.env_target }} \ No newline at end of file + environment: ${{ matrix.env }} \ No newline at end of file From 5b8ec312381ae2af828a88ba1831c988570e0a62 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Wed, 13 Sep 2023 22:47:18 -0400 Subject: [PATCH 05/19] fix typos and linter --- .github/actions/prepare-deploy/action.yml | 8 ++++---- .github/workflows/main-branch-deploys.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/prepare-deploy/action.yml b/.github/actions/prepare-deploy/action.yml index 51b977dceb..6b1b3fb0b0 100644 --- a/.github/actions/prepare-deploy/action.yml +++ b/.github/actions/prepare-deploy/action.yml @@ -65,22 +65,22 @@ runs: echo "function_name=${{ inputs.app_base_name }}-catalyst" >> $GITHUB_OUTPUT echo "front_url=${{ inputs.app_base_name }}-catalyst.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=catalyst" >> $GITHUB_OUTPUT - elif ${{ contains(inputs.deploy_to, 'demo') }}; then + elif ${{ inputs.deploy_to == 'demo' }}; then # DEMO echo "function_name=${{ inputs.app_base_name }}-demo" >> $GITHUB_OUTPUT echo "front_url=${{ inputs.app_base_name }}-demo.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=demo" >> $GITHUB_OUTPUT - elif ${{ contains(inputs.deploy_to, 'moonbeam-alpha') }}; then + elif ${{ inputs.deploy_to == 'moonbeam-alpha' }}; then # moonbeam-alpha echo "function_name=${{ inputs.app_base_name }}-moonbeam-alpha" >> $GITHUB_OUTPUT echo "front_url=${{ inputs.app_base_name }}-moonbeam-alpha.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=moonbeam-alpha" >> $GITHUB_OUTPUT - elif ${{ github.ref == 'refs/heads/main' }}; then + elif ${{ inputs.deploy_to == 'development' }}; then # DEV echo "function_name=${{ inputs.app_base_name }}-dev" >> $GITHUB_OUTPUT echo "front_url=${{ inputs.app_base_name }}-dev.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=development" >> $GITHUB_OUTPUT - elif ${{ inputs.deploy_to == 'ff-production' }}; then + elif ${{ inputs.deploy_to == 'ff-prod' }}; then # FF-PRODUCTION # A build from the DEV env that points to prod echo "function_name=${{ inputs.app_base_name }}-ff-production" >> $GITHUB_OUTPUT diff --git a/.github/workflows/main-branch-deploys.yml b/.github/workflows/main-branch-deploys.yml index 1ece2a4166..656a080dfe 100644 --- a/.github/workflows/main-branch-deploys.yml +++ b/.github/workflows/main-branch-deploys.yml @@ -11,7 +11,7 @@ jobs: name: deploy-${{ matrix.env }} strategy: matrix: - env: ['moonbeam-aplha', 'ff-prod', 'development'] + env: ['moonbeam-alpha', 'ff-prod', 'development'] uses: ./.github/workflows/deploy_all.yml secrets: inherit with: From b048babfe27de948d22dd163f1d7b4466e6286fb Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Wed, 13 Sep 2023 23:55:07 -0400 Subject: [PATCH 06/19] better concurrency --- .github/actions/deploy-gfunction/action.yml | 4 ---- .github/workflows/centrifuge-app.yml | 4 ++-- .github/workflows/faucet-api.yml | 2 +- .github/workflows/onboarding-api.yml | 4 ++-- .github/workflows/pinning-api.yml | 8 ++++---- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/actions/deploy-gfunction/action.yml b/.github/actions/deploy-gfunction/action.yml index b566939cfd..1f8d271062 100644 --- a/.github/actions/deploy-gfunction/action.yml +++ b/.github/actions/deploy-gfunction/action.yml @@ -13,10 +13,6 @@ inputs: deploy_env: description: env to deploy function to required: false - - checkout_path: - description: Folder with repository code - required: true GWIP: description: Google Workflow Identity provider diff --git a/.github/workflows/centrifuge-app.yml b/.github/workflows/centrifuge-app.yml index ccd38cac60..af5801bfb5 100644 --- a/.github/workflows/centrifuge-app.yml +++ b/.github/workflows/centrifuge-app.yml @@ -14,7 +14,7 @@ on: required: false # Fancy concurrency group string to allow for multi-staging deployments concurrency: - group: 'centrifuge-app-${{ inputs.deploy_env || github.event.inputs.deploy_env }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + group: 'centrifuge-app-${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' cancel-in-progress: true env: artifact_name: "webpack${{ inputs.deploy_env && format('-{0}', inputs.deploy_env) }}" @@ -94,7 +94,7 @@ jobs: deploy-app: concurrency: # Do not sync the same bucket in parallel - group: deploy-${{ needs.build-app.outputs.front_url }} + group: deploy-${{ needs.build-app.outputs.front_url }}-${{ github.event.name }} cancel-in-progress: true permissions: contents: 'read' diff --git a/.github/workflows/faucet-api.yml b/.github/workflows/faucet-api.yml index d238e3d7a8..3ef8b9fa32 100644 --- a/.github/workflows/faucet-api.yml +++ b/.github/workflows/faucet-api.yml @@ -19,7 +19,7 @@ env: # deploy_to: ${{ inputs_deploy_env }} function_handler: faucet concurrency: - group: 'faucet-api@${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + group: 'faucet-api--${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' cancel-in-progress: true jobs: diff --git a/.github/workflows/onboarding-api.yml b/.github/workflows/onboarding-api.yml index 909735dbe9..9fabfe8e40 100644 --- a/.github/workflows/onboarding-api.yml +++ b/.github/workflows/onboarding-api.yml @@ -18,7 +18,7 @@ env: artifact_name: "onboarding-api${{ inputs.deploy_env && format('-{0}', inputs.deploy_env) }}" concurrency: # Fancy concurrency group string to allow for multi-staging deployments - group: 'onboarding-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }} @${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + group: 'onboarding-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' cancel-in-progress: true jobs: @@ -61,7 +61,7 @@ jobs: deploy-onboarding-api: concurrency: # Don't try to deploy the same function in parallel - group: deploy-${{ needs.build-onboarding-api.outputs.function_name }} + group: deploy-${{ needs.build-onboarding-api.outputs.function_name }}-${{ github.event.name}} cancel-in-progress: true needs: build-onboarding-api runs-on: ubuntu-latest diff --git a/.github/workflows/pinning-api.yml b/.github/workflows/pinning-api.yml index d35fa9d8fa..5ade412031 100644 --- a/.github/workflows/pinning-api.yml +++ b/.github/workflows/pinning-api.yml @@ -18,7 +18,7 @@ env: artifact_name: "pinning-api${{ inputs.deploy_env && format('-{0}', inputs.deploy_env) }}" concurrency: # Fancy concurrency group string to allow for multi-staging deployments - group: 'pinning-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }} @${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + group: 'pinning-api-${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' cancel-in-progress: true jobs: build-pinning-api: @@ -43,7 +43,7 @@ jobs: uses: ./.github/actions/build-function with: app_name: ${{ env.app_name }} - artifact_name: ${{ env.artifact_name }} + artifact_name: ${{ steps.prepare.outputs.function_name }} - name: Archive staging artifacts id: archive_staging @@ -60,7 +60,7 @@ jobs: deploy-pinning-api: concurrency: # Don't try to deploy the same function in parallel - group: deploy-${{ needs.build-pinning-api.outputs.function_name }} + group: deploy-${{ needs.build-pinning-api.outputs.function_name }}-${{ github.event.name }} cancel-in-progress: true needs: build-pinning-api runs-on: ubuntu-latest @@ -79,7 +79,7 @@ jobs: uses: ./apps/.github/actions/deploy-gfunction with: app_name: ${{ env.app_name }} - artifact_name: ${{ env.artifact_name }} + artifact_name: ${{ needs.build-pinning-api.outputs.function_name }} GWIP: ${{ secrets.GWIP }} GSA: ${{ secrets.GSA }} target: ${{ env.function_handler }} From 432a2f600f84d348cfe7250a815c96bbe916ddcd Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Thu, 14 Sep 2023 00:24:38 -0400 Subject: [PATCH 07/19] avoid deploying prod functions during ff-prod runs --- .github/workflows/deploy_all.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml index f4c2adaf79..2c3fecc792 100644 --- a/.github/workflows/deploy_all.yml +++ b/.github/workflows/deploy_all.yml @@ -18,6 +18,7 @@ jobs: pinning: + if: ${{ inputs.environment != 'ff-prod' }} name: pinning-${{ inputs.environment}} uses: ./.github/workflows/pinning-api.yml secrets: inherit @@ -26,6 +27,7 @@ jobs: onboarding: + if: ${{ inputs.environment != 'ff-prod' }} name: onboarding-${{ inputs.environment}} uses: ./.github/workflows/onboarding-api.yml secrets: inherit From bb7a8c9c7916c76a9380f7502cfdb07df44afbc7 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Thu, 14 Sep 2023 00:45:01 -0400 Subject: [PATCH 08/19] easier URL in script --- .github/actions/prepare-deploy/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/prepare-deploy/action.yml b/.github/actions/prepare-deploy/action.yml index 6b1b3fb0b0..1e76509660 100644 --- a/.github/actions/prepare-deploy/action.yml +++ b/.github/actions/prepare-deploy/action.yml @@ -63,33 +63,33 @@ runs: elif ${{ inputs.deploy_to == 'catalyst' }}; then # CATALYST echo "function_name=${{ inputs.app_base_name }}-catalyst" >> $GITHUB_OUTPUT - echo "front_url=${{ inputs.app_base_name }}-catalyst.k-f.dev" >> $GITHUB_OUTPUT + echo "front_url=app-catalyst.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=catalyst" >> $GITHUB_OUTPUT elif ${{ inputs.deploy_to == 'demo' }}; then # DEMO echo "function_name=${{ inputs.app_base_name }}-demo" >> $GITHUB_OUTPUT - echo "front_url=${{ inputs.app_base_name }}-demo.k-f.dev" >> $GITHUB_OUTPUT + echo "front_url=app-demo.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=demo" >> $GITHUB_OUTPUT elif ${{ inputs.deploy_to == 'moonbeam-alpha' }}; then # moonbeam-alpha echo "function_name=${{ inputs.app_base_name }}-moonbeam-alpha" >> $GITHUB_OUTPUT - echo "front_url=${{ inputs.app_base_name }}-moonbeam-alpha.k-f.dev" >> $GITHUB_OUTPUT + echo "front_url=app-moonbeam-alpha.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=moonbeam-alpha" >> $GITHUB_OUTPUT elif ${{ inputs.deploy_to == 'development' }}; then # DEV echo "function_name=${{ inputs.app_base_name }}-dev" >> $GITHUB_OUTPUT - echo "front_url=${{ inputs.app_base_name }}-dev.k-f.dev" >> $GITHUB_OUTPUT + echo "front_url=app-dev.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=development" >> $GITHUB_OUTPUT elif ${{ inputs.deploy_to == 'ff-prod' }}; then # FF-PRODUCTION # A build from the DEV env that points to prod echo "function_name=${{ inputs.app_base_name }}-ff-production" >> $GITHUB_OUTPUT - echo "front_url=ff-production.k-f.dev" >> $GITHUB_OUTPUT + echo "front_url=app-ff-production.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=production" >> $GITHUB_OUTPUT elif ${{ github.event_name == 'pull_request' }}; then # PR echo "function_name=${{ inputs.app_base_name }}-pr${{ github.event.number }}" >> $GITHUB_OUTPUT - echo "front_url=${{ inputs.app_base_name }}-pr${{ github.event.number }}.k-f.dev" >> $GITHUB_OUTPUT + echo "front_url=app-pr${{ github.event.number }}.k-f.dev" >> $GITHUB_OUTPUT echo "env_name=development" >> $GITHUB_OUTPUT else echo "::error title=No env to deploy::Workflow called from non-deployable branch/tag" From 2e43d08c3f962ffbd0f64e1f68aae1d7cc18a9f8 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Thu, 14 Sep 2023 01:11:03 -0400 Subject: [PATCH 09/19] fix faucet api --- .github/workflows/faucet-api.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/faucet-api.yml b/.github/workflows/faucet-api.yml index 3ef8b9fa32..158472b6fe 100644 --- a/.github/workflows/faucet-api.yml +++ b/.github/workflows/faucet-api.yml @@ -11,12 +11,8 @@ on: deploy_env: type: string required: false - default: demo env: app_name: faucet-api - # For now deploy only on demo when triggered with workflow_call: - deploy_to: ${{ inputs.deploy_env && 'demo' || '' }} - # deploy_to: ${{ inputs_deploy_env }} function_handler: faucet concurrency: group: 'faucet-api--${{ inputs.deploy_env || github.event.inputs.deploy_env }}@${{ github.event.name }}${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' @@ -49,6 +45,9 @@ jobs: function_name: ${{ steps.prepare.outputs.function_name }} deploy-faucet: + # if: ${{ inputs.deploy_env == 'demo' }} || ${{ inputs.deploy_env == 'development' }} + # For now deploy only to demo + if: ${{ inputs.deploy_env == 'demo' }} concurrency: group: deploy-${{ needs.build-faucet.outputs.function_name }} cancel-in-progress: false @@ -74,4 +73,4 @@ jobs: target: ${{ env.function_handler }} gcloud_region: ${{ vars.GCLOUD_REGION }} service_account: '${{ vars.FIRESTORE_SA }}' - deploy_env: ${{ env.deploy_to }} + deploy_env: ${{ inputs.deploy_env }} From 842e5fccff6aa4ae8f82c3fa3021475240e15374 Mon Sep 17 00:00:00 2001 From: Sophia Date: Thu, 14 Sep 2023 10:28:04 -0400 Subject: [PATCH 10/19] Hide tables in liqudity tab before epoch has been closed (#1581) --- .../src/components/LiquidityTransactionsSection.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centrifuge-app/src/components/LiquidityTransactionsSection.tsx b/centrifuge-app/src/components/LiquidityTransactionsSection.tsx index 8cce59a6c6..20e09e30aa 100644 --- a/centrifuge-app/src/components/LiquidityTransactionsSection.tsx +++ b/centrifuge-app/src/components/LiquidityTransactionsSection.tsx @@ -104,7 +104,7 @@ export default function LiquidityTransactionsSection({ : [] }, [chartData, dataColors, tooltips, pool.currency.symbol]) - return ( + return chartData?.length ? ( )} - ) + ) : null } From 614ffbf1f62bda3cfa2e537280318ba7990610a0 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Fri, 15 Sep 2023 15:25:10 -0400 Subject: [PATCH 11/19] provide default names when job skipped --- .github/workflows/deploy_all.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml index 2c3fecc792..5e465133c7 100644 --- a/.github/workflows/deploy_all.yml +++ b/.github/workflows/deploy_all.yml @@ -19,24 +19,24 @@ jobs: pinning: if: ${{ inputs.environment != 'ff-prod' }} - name: pinning-${{ inputs.environment}} + name: pinning-${{ inputs.environment || 'disabled'}} uses: ./.github/workflows/pinning-api.yml secrets: inherit with: - deploy_env: ${{ inputs.environment}} + deploy_env: ${{ inputs.environment }} onboarding: if: ${{ inputs.environment != 'ff-prod' }} - name: onboarding-${{ inputs.environment}} + name: onboarding-${{ inputs.environment || 'disabled' }} uses: ./.github/workflows/onboarding-api.yml secrets: inherit with: deploy_env: ${{ inputs.environment}} faucet: - name: faucet-${{ inputs.environment}} if: ${{ inputs.environment == 'demo' || inputs.environment == 'development' }} + name: faucet-${{ inputs.environment || 'disabled'}} uses: ./.github/workflows/faucet-api.yml secrets: inherit with: From 63077e1799b4c5868e33143c979ef5f834f78d51 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Fri, 15 Sep 2023 15:32:01 -0400 Subject: [PATCH 12/19] get rid of fancy name for common deployment --- .github/workflows/deploy_all.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml index 5e465133c7..16a2d947eb 100644 --- a/.github/workflows/deploy_all.yml +++ b/.github/workflows/deploy_all.yml @@ -10,7 +10,7 @@ on: jobs: app: - name: app-${{ inputs.environment}} + name: web-app uses: ./.github/workflows/centrifuge-app.yml secrets: inherit with: @@ -19,7 +19,7 @@ jobs: pinning: if: ${{ inputs.environment != 'ff-prod' }} - name: pinning-${{ inputs.environment || 'disabled'}} + name: pinning-api-gfunction uses: ./.github/workflows/pinning-api.yml secrets: inherit with: @@ -28,7 +28,7 @@ jobs: onboarding: if: ${{ inputs.environment != 'ff-prod' }} - name: onboarding-${{ inputs.environment || 'disabled' }} + name: onboarding-api-gfunction uses: ./.github/workflows/onboarding-api.yml secrets: inherit with: @@ -36,7 +36,7 @@ jobs: faucet: if: ${{ inputs.environment == 'demo' || inputs.environment == 'development' }} - name: faucet-${{ inputs.environment || 'disabled'}} + name: faucet-api-gfunction uses: ./.github/workflows/faucet-api.yml secrets: inherit with: From 3ab401701ca28b3ec30d4df4b78969c956740071 Mon Sep 17 00:00:00 2001 From: Sophia Date: Fri, 15 Sep 2023 05:21:14 -0400 Subject: [PATCH 13/19] Allow onboarding for users not living in country of their passport (#1583) --- onboarding-api/src/controllers/user/startKyc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onboarding-api/src/controllers/user/startKyc.ts b/onboarding-api/src/controllers/user/startKyc.ts index 912e9b480f..4e7ff44089 100644 --- a/onboarding-api/src/controllers/user/startKyc.ts +++ b/onboarding-api/src/controllers/user/startKyc.ts @@ -91,7 +91,7 @@ export const startKycController = async (req: Request Date: Fri, 15 Sep 2023 16:52:27 +0200 Subject: [PATCH 14/19] CentrifugeJS: Fix currencies (#1584) --- centrifuge-js/src/modules/pools.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/centrifuge-js/src/modules/pools.ts b/centrifuge-js/src/modules/pools.ts index bb8a96f689..f42ee185c2 100644 --- a/centrifuge-js/src/modules/pools.ts +++ b/centrifuge-js/src/modules/pools.ts @@ -733,7 +733,7 @@ export function getPoolsModule(inst: Centrifuge) { api.query.ormlAssetRegistry.metadata(currency).pipe( take(1), switchMap((rawCurrencyMeta) => { - const currencyMeta = rawCurrencyMeta.toHuman() as AssetCurrencyData + const currencyMeta = rawCurrencyMeta.toPrimitive() as AssetCurrencyData return pinPoolMetadata(metadata, poolId, currencyMeta.decimals, options) }), switchMap((pinnedMetadata) => { @@ -1760,12 +1760,13 @@ export function getPoolsModule(inst: Centrifuge) { switchMap((api) => api.query.poolSystem.pool(poolId).pipe( switchMap((rawPool) => { - const pool = rawPool.toHuman() as any - return api.query.ormlAssetRegistry.metadata(pool.currency).pipe( + const pool = rawPool.toPrimitive() as any + const curKey = parseCurrencyKey(pool.currency) + return api.query.ormlAssetRegistry.metadata(curKey).pipe( map((rawCurrencyMeta) => { - const value = rawCurrencyMeta.toHuman() as AssetCurrencyData + const value = rawCurrencyMeta.toPrimitive() as AssetCurrencyData const currency: CurrencyMetadata = { - key: pool.currency, + key: curKey, decimals: value.decimals, name: value.name, symbol: value.symbol, @@ -2137,8 +2138,8 @@ export function getPoolsModule(inst: Centrifuge) { switchMap((api) => api.query.ormlAssetRegistry.metadata.entries()), map((rawMetas) => { const metas = rawMetas.map(([rawKey, rawValue]) => { - const key = parseCurrencyKey((rawKey.toHuman() as any)[0] as CurrencyKey) - const value = rawValue.toHuman() as AssetCurrencyData + const key = parseCurrencyKey((rawKey.toHuman() as any)[0]) + const value = rawValue.toPrimitive() as AssetCurrencyData const currency: CurrencyMetadata = { key, decimals: value.decimals, @@ -2360,7 +2361,7 @@ export function getPoolsModule(inst: Centrifuge) { api.query.priceOracle.values.entries(), api.query.interestAccrual.rates(), api.query.interestAccrual.lastUpdated(), - api.query.ormlAssetRegistry.metadata((poolValue.toHuman() as any).currency), + api.query.ormlAssetRegistry.metadata((poolValue.toPrimitive() as any).currency), ]).pipe(take(1)) }), map( @@ -2373,7 +2374,7 @@ export function getPoolsModule(inst: Centrifuge) { interestLastUpdated, rawCurrency, ]) => { - const currency = rawCurrency.toHuman() as AssetCurrencyData + const currency = rawCurrency.toPrimitive() as AssetCurrencyData const rates = rateValues.toPrimitive() as InterestAccrual[] const oraclePrices: Record< From 3575599097902eda93207a645f41562d8248ba66 Mon Sep 17 00:00:00 2001 From: Guillermo Perez Date: Fri, 15 Sep 2023 15:33:59 -0400 Subject: [PATCH 15/19] shorter name for shorter strings in the UI --- .github/workflows/deploy_all.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml index 16a2d947eb..54d07b73db 100644 --- a/.github/workflows/deploy_all.yml +++ b/.github/workflows/deploy_all.yml @@ -10,7 +10,7 @@ on: jobs: app: - name: web-app + name: webapp uses: ./.github/workflows/centrifuge-app.yml secrets: inherit with: @@ -19,7 +19,7 @@ jobs: pinning: if: ${{ inputs.environment != 'ff-prod' }} - name: pinning-api-gfunction + name: pinning uses: ./.github/workflows/pinning-api.yml secrets: inherit with: @@ -28,7 +28,7 @@ jobs: onboarding: if: ${{ inputs.environment != 'ff-prod' }} - name: onboarding-api-gfunction + name: onboarding uses: ./.github/workflows/onboarding-api.yml secrets: inherit with: @@ -36,7 +36,7 @@ jobs: faucet: if: ${{ inputs.environment == 'demo' || inputs.environment == 'development' }} - name: faucet-api-gfunction + name: faucet uses: ./.github/workflows/faucet-api.yml secrets: inherit with: From 2db86f5ac5f9bb589c770a74de8adb9c632b88aa Mon Sep 17 00:00:00 2001 From: JP Date: Mon, 18 Sep 2023 11:19:11 -0500 Subject: [PATCH 16/19] approve token fix (#1574) * fix * typo and revert env --- .../src/components/InvestRedeem/InvestRedeem.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/centrifuge-app/src/components/InvestRedeem/InvestRedeem.tsx b/centrifuge-app/src/components/InvestRedeem/InvestRedeem.tsx index caf1a0e0ac..c69c072b6d 100644 --- a/centrifuge-app/src/components/InvestRedeem/InvestRedeem.tsx +++ b/centrifuge-app/src/components/InvestRedeem/InvestRedeem.tsx @@ -534,7 +534,11 @@ function InvestForm({ onCancel, hasInvestment, autoFocus, investLabel = 'Invest' ) : changeOrderFormShown ? ( - renderInput(() => setChangeOrderFormShown(false)) + state.needsPoolCurrencyApproval ? ( + renderInput(onCancel, { onClick: actions.approvePoolCurrency, loading: isApproving }) + ) : ( + renderInput(onCancel) + ) ) : hasPendingOrder ? ( ) : changeOrderFormShown ? ( - renderInput(() => setChangeOrderFormShown(false)) + state.needsTrancheTokenApproval ? ( + renderInput(onCancel, { onClick: actions.approveTrancheToken, loading: isApproving }) + ) : ( + renderInput(onCancel) + ) ) : hasPendingOrder ? ( Date: Mon, 18 Sep 2023 11:29:49 -0500 Subject: [PATCH 17/19] add upcoming pools (#1586) * add upcoming pools * reorder pools * fix alignment --- .../src/components/PoolCard/PoolStatus.tsx | 3 ++- .../src/components/PoolCard/index.tsx | 7 +++--- .../src/components/PoolFilter/SortButton.tsx | 7 +++--- .../src/components/PoolFilter/index.tsx | 2 +- centrifuge-app/src/pages/Pools.tsx | 23 +++++++++++++++++-- 5 files changed, 32 insertions(+), 10 deletions(-) diff --git a/centrifuge-app/src/components/PoolCard/PoolStatus.tsx b/centrifuge-app/src/components/PoolCard/PoolStatus.tsx index 60acdb11ac..57c25f7285 100644 --- a/centrifuge-app/src/components/PoolCard/PoolStatus.tsx +++ b/centrifuge-app/src/components/PoolCard/PoolStatus.tsx @@ -1,12 +1,13 @@ import { StatusChip, StatusChipProps } from '@centrifuge/fabric' import * as React from 'react' -export type PoolStatusKey = 'Maker Pool' | 'Open for investments' | 'Closed' +export type PoolStatusKey = 'Maker Pool' | 'Open for investments' | 'Closed' | 'Upcoming' const statusColor: { [key in PoolStatusKey]: StatusChipProps['status'] } = { 'Maker Pool': 'ok', 'Open for investments': 'info', Closed: 'default', + Upcoming: 'default', } export function PoolStatus({ status }: { status?: PoolStatusKey }) { diff --git a/centrifuge-app/src/components/PoolCard/index.tsx b/centrifuge-app/src/components/PoolCard/index.tsx index 9f984f3e47..3eaf04289e 100644 --- a/centrifuge-app/src/components/PoolCard/index.tsx +++ b/centrifuge-app/src/components/PoolCard/index.tsx @@ -1,5 +1,5 @@ import { Rate } from '@centrifuge/centrifuge-js' -import { Box, Grid, TextWithPlaceholder, Thumbnail } from '@centrifuge/fabric' +import { Box, Grid, Text, TextWithPlaceholder, Thumbnail } from '@centrifuge/fabric' import Decimal from 'decimal.js-light' import * as React from 'react' import { useRouteMatch } from 'react-router' @@ -70,7 +70,7 @@ export function PoolCard({ variant="body1" color="textPrimary" fontWeight={500} - textAlign="right" + textAlign="left" isLoading={isLoading} maxLines={1} > @@ -82,6 +82,7 @@ export function PoolCard({ }) : '—'} + {status === 'Upcoming' ? target : ''} @@ -89,7 +90,7 @@ export function PoolCard({ - + {status === 'Upcoming' ? null : } ) } diff --git a/centrifuge-app/src/components/PoolFilter/SortButton.tsx b/centrifuge-app/src/components/PoolFilter/SortButton.tsx index 4354aee38a..ba31ffe790 100644 --- a/centrifuge-app/src/components/PoolFilter/SortButton.tsx +++ b/centrifuge-app/src/components/PoolFilter/SortButton.tsx @@ -9,6 +9,7 @@ export type SortButtonProps = { label: string searchKey: SortBy tooltip?: string + justifySelf?: 'start' | 'end' } type Sorting = { @@ -16,7 +17,7 @@ type Sorting = { direction: string | null } -export function SortButton({ label, searchKey, tooltip }: SortButtonProps) { +export function SortButton({ label, searchKey, tooltip, justifySelf = 'end' }: SortButtonProps) { const history = useHistory() const { pathname, search } = useLocation() @@ -58,7 +59,7 @@ export function SortButton({ label, searchKey, tooltip }: SortButtonProps) { : `Sort ${label} ascending` } aria-live - style={{ justifySelf: 'end' }} + style={{ justifySelf }} > {label} @@ -82,7 +83,7 @@ export function SortButton({ label, searchKey, tooltip }: SortButtonProps) { : `Sort ${label} ascending` } aria-live - style={{ justifySelf: 'end' }} + style={{ justifySelf }} > {label} diff --git a/centrifuge-app/src/components/PoolFilter/index.tsx b/centrifuge-app/src/components/PoolFilter/index.tsx index 87ead21872..a3fc4d1ede 100644 --- a/centrifuge-app/src/components/PoolFilter/index.tsx +++ b/centrifuge-app/src/components/PoolFilter/index.tsx @@ -38,7 +38,7 @@ export function PoolFilter({ pools }: PoolFilterProps) { tooltip="Value locked represents the current total value of pool tokens." /> - + q.data) const centPoolsMetaDataById = getMetasById(centPools, centPoolsMetaData) - const pools = !!listedPools?.length ? poolsToPoolCardProps(listedPools, centPoolsMetaDataById, cent) : [] + const upcomingPools = [ + { + apr: Rate.fromApr(0.08), + assetClass: 'Real Estate Bridge Loans', + iconUri: 'https://storage.googleapis.com/tinlake/pool-media/new-silver-2/icon.svg', + name: 'New Silver Series 3', + status: 'Upcoming' as PoolStatusKey, + }, + { + apr: Rate.fromApr(0.15), + assetClass: 'Voluntary Carbon Offsets', + iconUri: 'https://storage.googleapis.com/tinlake/pool-media/flowcarbon-1/FlowcarbonBadge.svg', + name: 'Flowcarbon Nature Offsets Series 2', + status: 'Upcoming' as PoolStatusKey, + }, + ] + + const pools = !!listedPools?.length + ? [...upcomingPools, ...poolsToPoolCardProps(listedPools, centPoolsMetaDataById, cent)] + : [...upcomingPools] const filteredPools = !!pools?.length ? filterPools(pools, new URLSearchParams(search)) : [] if (!listedPools.length) { From d99b2155e640fc20fc3d0d23adc58da606a22cd5 Mon Sep 17 00:00:00 2001 From: JP Date: Mon, 18 Sep 2023 16:16:51 -0500 Subject: [PATCH 18/19] chore: change anemoy status (#1587) --- .../src/components/PoolCard/index.tsx | 2 +- centrifuge-app/src/components/PoolList.tsx | 12 +++++++-- centrifuge-app/src/pages/Pools.tsx | 25 +++++++++++++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/centrifuge-app/src/components/PoolCard/index.tsx b/centrifuge-app/src/components/PoolCard/index.tsx index 3eaf04289e..408a2e4cec 100644 --- a/centrifuge-app/src/components/PoolCard/index.tsx +++ b/centrifuge-app/src/components/PoolCard/index.tsx @@ -82,7 +82,7 @@ export function PoolCard({ }) : '—'} - {status === 'Upcoming' ? target : ''} + {status === 'Upcoming' && apr ? target : ''} diff --git a/centrifuge-app/src/components/PoolList.tsx b/centrifuge-app/src/components/PoolList.tsx index 017b5017b1..7a3b7d6b92 100644 --- a/centrifuge-app/src/components/PoolList.tsx +++ b/centrifuge-app/src/components/PoolList.tsx @@ -1,12 +1,20 @@ import { Box, Stack } from '@centrifuge/fabric' import * as React from 'react' +import styled from 'styled-components' import { PoolCard, PoolCardProps } from './PoolCard' +import { PoolStatusKey } from './PoolCard/PoolStatus' type PoolListProps = { pools: PoolCardProps[] isLoading?: boolean } +const PoolCardBox = styled(Box)` + &:hover { + cursor: ${(props) => (props.status === 'Upcoming' ? 'not-allowed' : 'default')}; + } +` + export function PoolList({ pools, isLoading }: PoolListProps) { return ( @@ -19,9 +27,9 @@ export function PoolList({ pools, isLoading }: PoolListProps) { )) : pools.map((pool) => ( - + - + ))} ) diff --git a/centrifuge-app/src/pages/Pools.tsx b/centrifuge-app/src/pages/Pools.tsx index 11f7f9f204..e06861c75c 100644 --- a/centrifuge-app/src/pages/Pools.tsx +++ b/centrifuge-app/src/pages/Pools.tsx @@ -31,7 +31,7 @@ export function PoolsPage() { function Pools() { const cent = useCentrifuge() const { search } = useLocation() - const [listedPools, _listedTokens, metadataIsLoading] = useListedPools() + const [listedPools, , metadataIsLoading] = useListedPools() const centPools = listedPools.filter(({ id }) => !id.startsWith('0x')) as Pool[] const centPoolsMetaData: PoolMetaDataPartial[] = useMetadataMulti( @@ -57,7 +57,28 @@ function Pools() { ] const pools = !!listedPools?.length - ? [...upcomingPools, ...poolsToPoolCardProps(listedPools, centPoolsMetaDataById, cent)] + ? [ + ...upcomingPools, + ...poolsToPoolCardProps(listedPools, centPoolsMetaDataById, cent).map((pool) => { + if (pool.name?.includes('Anemoy Liquid Treasury Fund')) { + return { + ...pool, + status: 'Upcoming' as PoolStatusKey, + apr: Rate.fromApr(0.05), + } + } + + return pool + }), + ].sort((a, b) => { + if (a.status === 'Upcoming') { + return -1 + } + if (b.status === 'Upcoming') { + return 1 + } + return 0 + }) : [...upcomingPools] const filteredPools = !!pools?.length ? filterPools(pools, new URLSearchParams(search)) : [] From dfbf31a1fa4885b907322ded45b7674ad3e2b2b7 Mon Sep 17 00:00:00 2001 From: Sophia Date: Mon, 18 Sep 2023 17:50:45 -0400 Subject: [PATCH 19/19] Display LpEthUSDC as USDC (#1588) --- centrifuge-js/src/modules/pools.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/centrifuge-js/src/modules/pools.ts b/centrifuge-js/src/modules/pools.ts index f42ee185c2..2bd907b18a 100644 --- a/centrifuge-js/src/modules/pools.ts +++ b/centrifuge-js/src/modules/pools.ts @@ -1623,6 +1623,11 @@ export function getPoolsModule(inst: Centrifuge) { const epochExecution = epochExecutionMap[poolId] const currency = findCurrency(currencies, pool.currency)! + // TODO: remove, temporary UI fix + if (currency.symbol === 'LpEthUSDC') { + currency.symbol = 'USDC' + } + const poolValue = new CurrencyBalance( pool.tranches.tranches.reduce((prev: BN, tranche: TrancheDetailsData) => { return new BN(prev.add(new BN(hexToBN(tranche.debt))).add(new BN(hexToBN(tranche.reserve))))