Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2416 from ArkEcosystem/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley committed Jul 9, 2020
2 parents 0cd73ec + 810c02f commit a047808
Show file tree
Hide file tree
Showing 14 changed files with 276 additions and 158 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/draft-artifacts.yml
Expand Up @@ -46,20 +46,20 @@ jobs:
# - name: Upload .AppImage
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-linux-2.9.2.AppImage
# path: build/target/ark-desktop-wallet-linux-x86_64-2.9.2.AppImage
# name: ark-desktop-wallet-linux-2.9.3.AppImage
# path: build/target/ark-desktop-wallet-linux-x86_64-2.9.3.AppImage

# - name: Upload .tar.gz
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-linux-2.9.2.tar.gz
# path: build/target/ark-desktop-wallet-linux-x64-2.9.2.tar.gz
# name: ark-desktop-wallet-linux-2.9.3.tar.gz
# path: build/target/ark-desktop-wallet-linux-x64-2.9.3.tar.gz

- name: Upload .deb
uses: actions/upload-artifact@master
with:
name: ark-desktop-wallet-linux-2.9.2-${{ github.sha }}.deb
path: build/target/ark-desktop-wallet-linux-amd64-2.9.2.deb
name: ark-desktop-wallet-linux-2.9.3-${{ github.sha }}.deb
path: build/target/ark-desktop-wallet-linux-amd64-2.9.3.deb

build-macOS:
runs-on: macos-latest
Expand Down Expand Up @@ -102,14 +102,14 @@ jobs:
# - name: Upload .zip
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-mac-2.9.2.zip
# path: build/target/ark-desktop-wallet-mac-2.9.2.zip
# name: ark-desktop-wallet-mac-2.9.3.zip
# path: build/target/ark-desktop-wallet-mac-2.9.3.zip

- name: Upload .dmg
uses: actions/upload-artifact@v1
with:
name: ark-desktop-wallet-mac-2.9.2-${{ github.sha }}.dmg
path: build/target/ark-desktop-wallet-mac-2.9.2.dmg
name: ark-desktop-wallet-mac-2.9.3-${{ github.sha }}.dmg
path: build/target/ark-desktop-wallet-mac-2.9.3.dmg

build-windows:
runs-on: windows-latest
Expand Down Expand Up @@ -137,5 +137,5 @@ jobs:
- name: Upload .exe
uses: actions/upload-artifact@v1
with:
name: ark-desktop-wallet-win-2.9.2-${{ github.sha }}.exe
path: build/target/ark-desktop-wallet-win-2.9.2.exe
name: ark-desktop-wallet-win-2.9.3-${{ github.sha }}.exe
path: build/target/ark-desktop-wallet-win-2.9.3.exe
22 changes: 11 additions & 11 deletions .github/workflows/publish-release.yml
Expand Up @@ -82,28 +82,28 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Calculate Checksums for AppImage
run: shasum -a 256 build/target/ark-desktop-wallet-linux-x86_64-2.9.2.AppImage
run: shasum -a 256 build/target/ark-desktop-wallet-linux-x86_64-2.9.3.AppImage

- name: Calculate Checksums for TAR
run: shasum -a 256 build/target/ark-desktop-wallet-linux-x64-2.9.2.tar.gz
run: shasum -a 256 build/target/ark-desktop-wallet-linux-x64-2.9.3.tar.gz

- name: Calculate Checksums for DEB
run: shasum -a 256 build/target/ark-desktop-wallet-linux-amd64-2.9.2.deb
run: shasum -a 256 build/target/ark-desktop-wallet-linux-amd64-2.9.3.deb

- name: VirusTotal Scan for AppImage
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-linux-x86_64-2.9.2.AppImage' | jq -r .permalink
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-linux-x86_64-2.9.3.AppImage' | jq -r .permalink
- name: VirusTotal Scan for TAR
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-linux-x64-2.9.2.tar.gz' | jq -r .permalink
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-linux-x64-2.9.3.tar.gz' | jq -r .permalink
- name: VirusTotal Scan for DEB
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-linux-amd64-2.9.2.deb' | jq -r .permalink
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-linux-amd64-2.9.3.deb' | jq -r .permalink
publish-macos:
needs: ["create-release"]
Expand Down Expand Up @@ -148,20 +148,20 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}

- name: Calculate Checksums for DMG
run: shasum -a 256 build/target/ark-desktop-wallet-mac-2.9.2.dmg
run: shasum -a 256 build/target/ark-desktop-wallet-mac-2.9.3.dmg

- name: Calculate Checksums for ZIP
run: shasum -a 256 build/target/ark-desktop-wallet-mac-2.9.2.zip
run: shasum -a 256 build/target/ark-desktop-wallet-mac-2.9.3.zip

- name: VirusTotal Scan for DMG
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-mac-2.9.2.dmg' | jq -r .permalink
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-mac-2.9.3.dmg' | jq -r .permalink
- name: VirusTotal Scan for ZIP
run: |
UPLOAD_URL=$(curl -s --location --url 'https://www.virustotal.com/vtapi/v2/file/scan/upload_url?apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' | jq -r .upload_url)
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-mac-2.9.2.zip' | jq -r .permalink
curl -s --url "$UPLOAD_URL" --form 'apikey=${{ secrets.VIRUSTOTAL_TOKEN }}' --form 'file=@build/target/ark-desktop-wallet-mac-2.9.3.zip' | jq -r .permalink
publish-windows:
needs: ["create-release"]
Expand Down Expand Up @@ -199,5 +199,5 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Calculate Checksums for EXE
run: Get-FileHash build/target/ark-desktop-wallet-win-2.9.2.exe -Algorithm SHA256 | Format-List
run: Get-FileHash build/target/ark-desktop-wallet-win-2.9.3.exe -Algorithm SHA256 | Format-List
shell: powershell
24 changes: 12 additions & 12 deletions .github/workflows/test.yml
Expand Up @@ -90,20 +90,20 @@ jobs:
# - name: Upload .AppImage
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-linux-2.9.2.AppImage
# path: build/target/ark-desktop-wallet-linux-x86_64-2.9.2.AppImage
# name: ark-desktop-wallet-linux-2.9.3.AppImage
# path: build/target/ark-desktop-wallet-linux-x86_64-2.9.3.AppImage

# - name: Upload .tar.gz
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-linux-2.9.2.tar.gz
# path: build/target/ark-desktop-wallet-linux-x64-2.9.2.tar.gz
# name: ark-desktop-wallet-linux-2.9.3.tar.gz
# path: build/target/ark-desktop-wallet-linux-x64-2.9.3.tar.gz

- name: Upload .deb
uses: actions/upload-artifact@master
with:
name: ark-desktop-wallet-linux-2.9.2-${{ github.sha }}.deb
path: build/target/ark-desktop-wallet-linux-amd64-2.9.2.deb
name: ark-desktop-wallet-linux-2.9.3-${{ github.sha }}.deb
path: build/target/ark-desktop-wallet-linux-amd64-2.9.3.deb

build-macOS:
runs-on: macos-latest
Expand Down Expand Up @@ -138,14 +138,14 @@ jobs:
# - name: Upload .zip
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-mac-2.9.2.zip
# path: build/target/ark-desktop-wallet-mac-2.9.2.zip
# name: ark-desktop-wallet-mac-2.9.3.zip
# path: build/target/ark-desktop-wallet-mac-2.9.3.zip

- name: Upload .dmg
uses: actions/upload-artifact@v1
with:
name: ark-desktop-wallet-mac-2.9.2-${{ github.sha }}.dmg
path: build/target/ark-desktop-wallet-mac-2.9.2.dmg
name: ark-desktop-wallet-mac-2.9.3-${{ github.sha }}.dmg
path: build/target/ark-desktop-wallet-mac-2.9.3.dmg

build-windows:
runs-on: windows-latest
Expand Down Expand Up @@ -173,5 +173,5 @@ jobs:
- name: Upload .exe
uses: actions/upload-artifact@v1
with:
name: ark-desktop-wallet-win-2.9.2-${{ github.sha }}.exe
path: build/target/ark-desktop-wallet-win-2.9.2.exe
name: ark-desktop-wallet-win-2.9.3-${{ github.sha }}.exe
path: build/target/ark-desktop-wallet-win-2.9.3.exe
Expand Up @@ -184,7 +184,12 @@ describe('TransactionFormTransfer', () => {
expect(wrapper.contains('.TransactionFormTransfer__amount')).toBe(true)
})

it('should have add button', () => {
it('should have add button on multiple tab', async () => {
expect(wrapper.contains('.TransactionFormTransfer__add')).toBe(false)

wrapper.vm.onSendTypeChange('Multiple')
await wrapper.vm.$nextTick()

expect(wrapper.contains('.TransactionFormTransfer__add')).toBe(true)
})

Expand Down Expand Up @@ -233,7 +238,20 @@ describe('TransactionFormTransfer', () => {
})

describe('next button', () => {
it('should be enabled if recipients form is valid', async () => {
it('should be enabled for single if recipients form is valid', async () => {
wrapper.vm.$v.recipientId.$model = 'address-1'
wrapper.vm.$v.amount.$model = 10
wrapper.vm.$v.form.fee.$model = 0.1
wrapper.vm.$v.form.vendorField.$model = 'vendorfield test'
wrapper.vm.$v.form.passphrase.$model = 'passphrase'

await wrapper.vm.$nextTick()

expect(wrapper.find('.TransactionFormTransfer__next').attributes('disabled')).toBeFalsy()
})

it('should be enabled for multiple if recipients form is valid', async () => {
wrapper.vm.onSendTypeChange('Multiple')
wrapper.vm.$v.form.recipients.$model = [{
address: 'address-2',
amount: 10
Expand Down Expand Up @@ -284,6 +302,7 @@ describe('TransactionFormTransfer', () => {
})

it('should return true if it is multipayment transaction', () => {
wrapper.vm.onSendTypeChange('Multiple')
wrapper.vm.$v.form.recipients.$model = [{
address: 'address-2',
amount: 10
Expand Down Expand Up @@ -394,7 +413,11 @@ describe('TransactionFormTransfer', () => {
expect(wrapper.vm.maximumAvailableAmount).toEqual((new BigNumber(1000)).minus(0.1))
})

it('should return value including all recipients', async () => {
it('should return value including all recipients for multiple', async () => {
wrapper.vm.onSendTypeChange('Multiple')

await wrapper.vm.$nextTick()

wrapper.vm.$v.form.fee.$model = 0.1
wrapper.vm.$v.recipientId.$model = Identities.Address.fromPassphrase('test')
wrapper.vm.$v.amount.$model = 10
Expand Down Expand Up @@ -812,22 +835,26 @@ describe('TransactionFormTransfer', () => {

describe('methods', () => {
describe('getTransactionData', () => {
it('should return correct data with passphrase for normal transaction', () => {
it('should return correct data with passphrase for normal transaction', async () => {
wrapper.vm.$v.form.fee.$model = 0.1
wrapper.vm.$v.form.vendorField.$model = 'vendorfield test'
wrapper.vm.$v.form.passphrase.$model = 'passphrase'
wrapper.vm.$v.form.recipients.$model = [{
address: 'address-2',
amount: (1 * 1e8).toString()
}]
wrapper.vm.$v.recipientId.$model = wrapper.vm.$v.form.recipients.$model[0].address
wrapper.vm.$v.amount.$model = wrapper.vm.$v.form.recipients.$model[0].amount
wrapper.vm.$v.recipientId.$model = 'address-1'
wrapper.vm.$v.amount.$model = 50
// wrapper.vm.$v.recipientId.$model = wrapper.vm.$v.form.recipients.$model[0].address
// wrapper.vm.$v.amount.$model = wrapper.vm.$v.form.recipients.$model[0].amount

await wrapper.vm.$nextTick()

expect(wrapper.vm.getTransactionData()).toEqual({
address: 'address-1',
passphrase: 'passphrase',
recipientId: 'address-2',
amount: (1 * 1e8).toString(),
recipientId: 'address-1',
amount: new BigNumber(50 * 1e8),
fee: new BigNumber(0.1 * 1e8),
vendorField: 'vendorfield test',
wif: undefined,
Expand All @@ -838,6 +865,7 @@ describe('TransactionFormTransfer', () => {
})

it('should return correct data with passphrase for multipayment transaction', () => {
wrapper.vm.onSendTypeChange('Multiple')
wrapper.vm.$v.form.fee.$model = 0.1
wrapper.vm.$v.form.vendorField.$model = 'vendorfield test'
wrapper.vm.$v.form.passphrase.$model = 'passphrase'
Expand Down Expand Up @@ -874,6 +902,7 @@ describe('TransactionFormTransfer', () => {
secondPublicKey: Identities.PublicKey.fromPassphrase('second passphrase')
})

wrapper.vm.onSendTypeChange('Multiple')
wrapper.vm.$v.form.fee.$model = 0.1
wrapper.vm.$v.form.vendorField.$model = 'vendorfield test'
wrapper.vm.$v.form.passphrase.$model = 'passphrase'
Expand Down Expand Up @@ -920,6 +949,7 @@ describe('TransactionFormTransfer', () => {
})

it('should build multipayment transaction', async () => {
wrapper.vm.onSendTypeChange('Multiple')
wrapper.vm.$v.form.recipients.$model = [{
address: 'address-2',
amount: 10
Expand Down Expand Up @@ -952,6 +982,7 @@ describe('TransactionFormTransfer', () => {
})

it('should build multipayment transaction with default arguments', async () => {
wrapper.vm.onSendTypeChange('Multiple')
wrapper.vm.$v.form.recipients.$model = [{
address: 'address-2',
amount: 10
Expand Down Expand Up @@ -994,8 +1025,8 @@ describe('TransactionFormTransfer', () => {

wrapper.vm.populateSchema()

expect(wrapper.vm.form.recipients[0].address).toBe('address-5')
expect(wrapper.vm.form.recipients[0].amount).toEqual(new BigNumber(100 * 1e8))
expect(wrapper.vm.recipientId).toBe('address-5')
expect(wrapper.vm.amount).toEqual(100)
expect(wrapper.vm.form.vendorField).toBe('test vendorfield')
})

Expand Down Expand Up @@ -1129,6 +1160,7 @@ describe('TransactionFormTransfer', () => {
})

it('should generate error for multipayment transaction', () => {
wrapper.vm.onSendTypeChange('Multiple')
wrapper.vm.$v.form.recipients.$model = [{
address: 'address-2',
amount: 10
Expand Down Expand Up @@ -1395,9 +1427,9 @@ describe('TransactionFormTransfer', () => {
it('should submit form data', async () => {
const spy = jest.spyOn(wrapper.vm, 'onSubmit').mockImplementation()

wrapper.vm.nextStep()
await wrapper.vm.nextStep()

expect(spy).toHaveBeenCalledTimes(0)
expect(spy).toHaveBeenCalledTimes(1)
})
})

Expand Down Expand Up @@ -1606,9 +1638,13 @@ describe('TransactionFormTransfer', () => {
})

it('should be above minimum if set', () => {
wrapper.vm.onSendTypeChange('Multiple')
wrapper.vm.$v.form.recipients.$model = [{
address: 'address-1',
amount: 10
}, {
address: 'address-1',
amount: 10
}]

expect(wrapper.vm.$v.form.recipients.aboveMinimum).toBe(true)
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "ark-desktop-wallet",
"version": "2.9.2",
"version": "2.9.3",
"repository": {
"type": "git",
"url": "git+https://github.com/ArkEcosystem/desktop-wallet.git"
Expand Down Expand Up @@ -145,7 +145,7 @@
"css-loader": "^3.1.0",
"del": "^5.0.0",
"devtron": "^1.4.0",
"electron": "^8.0.0",
"electron": "^8.2.4",
"electron-builder": "22.6.0",
"electron-debug": "^3.0.1",
"electron-devtools-installer": "^3.0.0",
Expand Down

0 comments on commit a047808

Please sign in to comment.