diff --git a/.github/workflows/draft-artifacts.yml b/.github/workflows/draft-artifacts.yml index 233e100c57..ea4427bba7 100644 --- a/.github/workflows/draft-artifacts.yml +++ b/.github/workflows/draft-artifacts.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 606541e5e1..e909234bc4 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -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"] @@ -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"] @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5be30e9c28..a238e66141 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 @@ -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 diff --git a/__tests__/unit/components/Transaction/TransactionForm/TransactionFormTransfer.spec.js b/__tests__/unit/components/Transaction/TransactionForm/TransactionFormTransfer.spec.js index f411efe54b..1114a4b806 100644 --- a/__tests__/unit/components/Transaction/TransactionForm/TransactionFormTransfer.spec.js +++ b/__tests__/unit/components/Transaction/TransactionForm/TransactionFormTransfer.spec.js @@ -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) }) @@ -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 @@ -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 @@ -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 @@ -812,7 +835,7 @@ 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' @@ -820,14 +843,18 @@ describe('TransactionFormTransfer', () => { 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, @@ -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' @@ -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' @@ -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 @@ -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 @@ -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') }) @@ -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 @@ -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) }) }) @@ -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) diff --git a/package.json b/package.json index 1d19fdda89..ed534998c3 100644 --- a/package.json +++ b/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" @@ -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", diff --git a/src/renderer/components/Input/InputFee.vue b/src/renderer/components/Input/InputFee.vue index 10d22e7763..41a82b43fd 100644 --- a/src/renderer/components/Input/InputFee.vue +++ b/src/renderer/components/Input/InputFee.vue @@ -58,7 +58,7 @@

{{ $t(`INPUT_FEE.UNIQUE`, { fee: parseFloat(fee) }) }} @@ -121,6 +121,12 @@ export default { type: Object, required: false, default: null + }, + + hideStaticFeeNotice: { + type: Boolean, + required: false, + default: false } }, @@ -260,15 +266,17 @@ export default { } }, + watch: { + transactionType () { + this.triggerTypeUpdate() + } + }, + created () { // Fees should be synchronized only when this component is active this.$synchronizer.appendFocus('fees') - if (this.lastFee && this.session_profile.defaultChosenFee === 'LAST') { - this.onChoice(this.session_profile.defaultChosenFee) - } else { - this.emitFee(this.feeChoices.AVERAGE) - } + this.triggerTypeUpdate() }, beforeDestroy () { @@ -276,6 +284,13 @@ export default { }, methods: { + triggerTypeUpdate () { + if (this.lastFee && this.session_profile.defaultChosenFee === 'LAST') { + this.onChoice(this.session_profile.defaultChosenFee) + } else { + this.emitFee(this.feeChoices.AVERAGE) + } + }, focusInput () { this.$refs.input.focus() }, diff --git a/src/renderer/components/Input/InputToggle/InputToggleChoice.vue b/src/renderer/components/Input/InputToggle/InputToggleChoice.vue index abac5c46e7..f19b0b0e57 100644 --- a/src/renderer/components/Input/InputToggle/InputToggleChoice.vue +++ b/src/renderer/components/Input/InputToggle/InputToggleChoice.vue @@ -5,7 +5,7 @@ 'rounded-l': isFirst, 'rounded-r': isLast, 'InputToggleChoice--selected bg-blue text-white font-semibold shadow-lg': isSelected, - 'bg-theme-input-toggle-choice text-theme-input-toggle-choice-text': !isSelected + 'bg-theme-input-toggle-choice text-theme-input-toggle-choice-text hover:bg-theme-input-toggle-choice-hover': !isSelected }" type="button" @click="emitSelect(choice)" diff --git a/src/renderer/components/Transaction/TransactionForm/TransactionFormTransfer.vue b/src/renderer/components/Transaction/TransactionForm/TransactionFormTransfer.vue index 256172c450..5c6d75efab 100644 --- a/src/renderer/components/Transaction/TransactionForm/TransactionFormTransfer.vue +++ b/src/renderer/components/Transaction/TransactionForm/TransactionFormTransfer.vue @@ -3,6 +3,28 @@ class="TransactionFormTransfer flex flex-col" @submit.prevent > +
+
+ Select a Single or Multiple Recipient Transaction +
+ +
+ + +
+ ? +
+
+
+ - - -
- + +
+ + + +
+ - -