Skip to content

Commit

Permalink
fix(stacking): address not showing
Browse files Browse the repository at this point in the history
ci: update PR with debug build

ci: remove slackbot notifications
  • Loading branch information
kyranjamie committed Jan 14, 2021
1 parent 4a4cfe4 commit 9f7a565
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 71 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/debug-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
57 changes: 1 addition & 56 deletions .github/workflows/stacks-wallet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand All @@ -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'
Expand All @@ -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 }}
9 changes: 5 additions & 4 deletions app/components/home/stacking-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -73,12 +74,12 @@ export const StackingCard: FC<StackingCardProps> = () => {
</Text>
</Flex>
)}
{/* <Flex flexDirection="column" mt="tight" mb="base-loose">
<Flex flexDirection="column" mt="tight" mb="base-loose">
<Text textStyle="body.small.medium">Reward to be paid to</Text>
<Text as="code" fontSize="13px" mt="tight" color="ink.600">
{stackerInfo?.pox_address}
{convertPoxAddressToBtc(stackerInfo?.pox_address)}
</Text>
</Flex> */}
</Flex>
</Box>
</Box>
)}
Expand Down
18 changes: 18 additions & 0 deletions app/utils/stacking.ts
Original file line number Diff line number Diff line change
@@ -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]);
}
14 changes: 3 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 9f7a565

Please sign in to comment.