diff --git a/.github/workflows/debug-build.yml b/.github/workflows/debug-build.yml index 0d121410d..40716f8d6 100644 --- a/.github/workflows/debug-build.yml +++ b/.github/workflows/debug-build.yml @@ -94,3 +94,16 @@ jobs: path: | release/**/*.deb release/**/*.rpm + + - uses: lucasmotta/pull-request-sticky-header@1.0.0 + if: (!contains(needs.*.result, 'failure')) + with: + header: '> [Download the latest builds](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Remove header if build failed + - uses: lucasmotta/pull-request-sticky-header@1.0.0 + if: (contains(needs.*.result, 'failure')) + with: + header: '> _Build failed, [see here for details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})_' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/stacks-wallet.yml b/.github/workflows/stacks-wallet.yml index 59b2acd45..dd5d35252 100644 --- a/.github/workflows/stacks-wallet.yml +++ b/.github/workflows/stacks-wallet.yml @@ -18,20 +18,8 @@ jobs: runs-on: ubuntu-latest # Only run on non-PR events or only PRs that aren't from forks if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository - outputs: - slack_message_id: ${{ steps.slack.outputs.message_id }} - steps: - - name: Notify slack start - if: success() - id: slack - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1.1.2 - with: - channel: devops-notify - status: STARTING - color: warning + steps: # - name: Discord notification # env: # DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} @@ -209,14 +197,12 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SEMANTIC_RELEASE_PACKAGE: ${{ github.workflow }} with: # These plugins aren't packaged with semantic-release by default. So specify them here to ensure they get installed during this Github Action extra_plugins: | @semantic-release/changelog @semantic-release/git - semantic-release-slack-bot # Notify Discord channel of workflow end notify-end: @@ -229,30 +215,6 @@ jobs: - release if: always() steps: - - name: Notify slack success - # Only run on non-PR events or only PRs that aren't from forks - if: (!contains(needs.*.result, 'failure')) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1.1.2 - with: - message_id: ${{ needs.notify-start.outputs.slack_message_id }} - channel: devops-notify - status: SUCCESS - color: good - - - name: Notify slack fail - # Only run on non-PR events or only PRs that aren't from forks - if: (contains(needs.*.result, 'failure')) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1.1.2 - with: - message_id: ${{ needs.notify-start.outputs.slack_message_id }} - channel: devops-notify - status: FAILED - color: danger - - name: Discord notification # Only run if a new release was published if: needs.release.outputs.new_release_published == 'true' @@ -261,20 +223,3 @@ jobs: uses: Ilshidur/action-discord@master with: args: 'A new version (v[${{needs.release.outputs.new_release_version}}](https://github.com/${{ github.repository }}/releases/tag/v${{needs.release.outputs.new_release_version}})) of the ${{ github.workflow }} has been released.' - - - uses: lucasmotta/pull-request-sticky-header@1.0.0 - # Only run on non-PR events or only PRs that aren't from forks - if: (!contains(needs.*.result, 'failure')) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - with: - header: | - > [Download the latest builds](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}). - This will be version ${{needs.release.outputs.new_release_version}} when merged into `master` - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # Remove header if build failed - - uses: lucasmotta/pull-request-sticky-header@1.0.0 - # Only run on non-PR events or only PRs that aren't from forks - if: (contains(needs.*.result, 'failure')) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - with: - header: '> _Build failed, [see here for details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})_' - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/app/components/home/stacking-card.tsx b/app/components/home/stacking-card.tsx index f6c91e12c..6d191690c 100644 --- a/app/components/home/stacking-card.tsx +++ b/app/components/home/stacking-card.tsx @@ -2,8 +2,9 @@ import React, { FC } from 'react'; import { useSelector } from 'react-redux'; import { Flex, Box, Text } from '@blockstack/ui'; -import { WaffleChart } from '@components/chart/waffle-chart'; import { RootState } from '@store/index'; +import { convertPoxAddressToBtc } from '@utils/stacking'; +import { WaffleChart } from '@components/chart/waffle-chart'; import { selectStackerInfo, selectNextCycleInfo, @@ -73,12 +74,12 @@ export const StackingCard: FC = () => { )} - {/* + Reward to be paid to - {stackerInfo?.pox_address} + {convertPoxAddressToBtc(stackerInfo?.pox_address)} - */} + )} diff --git a/app/utils/stacking.ts b/app/utils/stacking.ts new file mode 100644 index 000000000..5e18f10ed --- /dev/null +++ b/app/utils/stacking.ts @@ -0,0 +1,18 @@ +import { AddressHashMode } from '@stacks/transactions'; +import BN from 'bn.js'; +import { address } from 'bitcoinjs-lib'; + +const poxKeyToVersionBytesMap = { + [AddressHashMode.SerializeP2PKH]: 0, + [AddressHashMode.SerializeP2SH]: 5, +}; + +interface ConvertToPoxAddressBtc { + version: Buffer; + hashbytes: Buffer; +} +export function convertPoxAddressToBtc({ version, hashbytes }: ConvertToPoxAddressBtc) { + const ver = new BN(version).toNumber(); + if (ver === AddressHashMode.SerializeP2WPKH || ver === AddressHashMode.SerializeP2WSH) return ''; + return address.toBase58Check(hashbytes, (poxKeyToVersionBytesMap as any)[ver]); +} diff --git a/package.json b/package.json index 76650dcce..002eba612 100644 --- a/package.json +++ b/package.json @@ -135,25 +135,17 @@ }, { "path": "release/**/*.rpm", - "label": "stacks-wallet-mac-${nextRelease.version}.rpm" + "label": "stacks-wallet-linux-${nextRelease.version}.rpm" }, { "path": "release/**/*.deb", - "label": "stacks-wallet-mac-${lastRelease.version}.deb" + "label": "stacks-wallet-linux-${lastRelease.version}.deb" } ] } ], "@semantic-release/changelog", - "@semantic-release/git", - [ - "semantic-release-slack-bot", - { - "notifyOnSuccess": true, - "notifyOnFail": true, - "markdownReleaseNotes": true - } - ] + "@semantic-release/git" ] }, "commitlint": {