diff --git a/components/DepositModalBox.vue b/components/DepositModalBox.vue
index b40c24f..613b6fc 100644
--- a/components/DepositModalBox.vue
+++ b/components/DepositModalBox.vue
@@ -28,7 +28,6 @@
{{ $t('saveAsFile') }} {{ filename }}
-
@@ -57,7 +56,7 @@
@@ -70,27 +69,22 @@
import { mapActions, mapState, mapGetters } from 'vuex'
import { sliceAddress } from '@/utils'
-import GasPriceSlider from '@/components/GasPriceSlider'
import { ConnectButton } from '@/components/web3Connect'
export default {
components: {
- ConnectButton,
- GasPriceSlider
+ ConnectButton
},
data() {
return {
isBackuped: false,
tooltipCopy: this.$t('clickToCopy'),
- gasPrice: undefined,
- isValidGasPrice: false,
isEncrypted: false,
copyTimer: null
}
},
computed: {
...mapGetters('metamask', ['isLoggedIn']),
- ...mapGetters('gasPrices', ['eipSupported']),
...mapGetters('txHashKeeper', ['addressExplorerUrl']),
...mapGetters('encryptedNote', ['isSetupAccount', 'accounts', 'isEnabledSaveFile']),
...mapState('application', ['note', 'prefix']),
@@ -135,13 +129,10 @@ export default {
},
async _sendDeposit() {
this.$store.dispatch('loading/enable', { message: this.$t('preparingTransactionData') })
- await this.sendDeposit({ gasPrice: this.gasPrice, isEncrypted: this.isEncrypted })
+ await this.sendDeposit({ isEncrypted: this.isEncrypted })
this.$store.dispatch('loading/disable')
this.$parent.close()
},
- onGasPriceValidate(value) {
- this.isValidGasPrice = value
- },
async copyNoteAccount() {
await this.$copyText(this.accounts.encrypt)
this.onCopy()
diff --git a/components/GasPriceSlider.vue b/components/GasPriceSlider.vue
deleted file mode 100644
index 5e4f02f..0000000
--- a/components/GasPriceSlider.vue
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
- Gas Price
-
-
-
- Gwei
-
-
-
-
-
- {{ $t(`gasPriceSlider.${val}`) }}
-
-
-
-
-
-
diff --git a/components/withdraw/Withdraw.vue b/components/withdraw/Withdraw.vue
index 6076b1a..286042c 100644
--- a/components/withdraw/Withdraw.vue
+++ b/components/withdraw/Withdraw.vue
@@ -133,8 +133,8 @@
:class="{ 'slide-animation-active': isLoading }"
:disabled="isWithdrawalButtonDisable"
:loading="isLoadingRelayers || isLoading"
- @click="onWithdraw"
data-test="button_start_withdraw"
+ @click="onWithdraw"
>
{{ $t('withdrawButton') }}
@@ -189,7 +189,7 @@ export default {
}
},
computed: {
- ...mapState('application', ['note', 'errors', 'withdrawType', 'ethToReceive']),
+ ...mapState('application', ['note', 'withdrawType', 'ethToReceive']),
...mapState('relayer', ['isLoadingRelayers']),
...mapGetters('txHashKeeper', ['txExplorerUrl']),
...mapGetters('application', ['isNotEnoughTokens', 'selectedStatisticCurrency']),
@@ -291,24 +291,6 @@ export default {
}
}
},
- errors: {
- handler(errors) {
- console.log('error', errors)
- this.error = {
- type: errors.length ? this.$t('error') : null,
- message: errors[errors.length - 1]
- }
- if (this.error.message) {
- this.$store.dispatch('notice/addNoticeWithInterval', {
- notice: {
- untranslatedTitle: this.error.message,
- type: 'warning'
- }
- })
- }
- },
- deep: true
- },
withdrawNote: {
async handler(withdrawNote) {
this.error = {
@@ -382,6 +364,8 @@ export default {
},
activeTab(newTab, oldTab) {
if (newTab !== oldTab && newTab === 1) {
+ this.withdrawAddress = ''
+ this.withdrawNote = ''
this.error = {
type: '',
message: ''
@@ -448,7 +432,7 @@ export default {
console.log(`Get logs: ${err.message}`)
}
},
- onWithdraw() {
+ async onWithdraw() {
const note = this.withdrawNote.split('-')[4]
if (note.length !== 126) {
this.error = {
@@ -457,14 +441,26 @@ export default {
}
return
}
+
try {
this.withdrawAddress = toChecksumAddress(this.withdrawAddress)
- this.$store.dispatch('application/prepareWithdraw', {
+ } catch {
+ this.error = {
+ type: this.$t('validationError'),
+ message: this.$t('recipientAddressIsInvalid')
+ }
+ return
+ }
+
+ try {
+ this.$store.dispatch('loading/enable', { message: this.$t('generatingProof') })
+
+ await this.$store.dispatch('application/prepareWithdraw', {
note: this.withdrawNote,
recipient: this.withdrawAddress
})
- this.error.type = null
- this.currentModal = this.$buefy.modal.open({
+
+ this.$buefy.modal.open({
parent: this,
component: WithdrawModalBox,
hasModalCard: true,
@@ -474,12 +470,20 @@ export default {
withdrawType: this.withdrawType
}
})
- } catch (e) {
+ } catch (err) {
this.error = {
- type: this.$t('validationError'),
- message: this.$t('recipientAddressIsInvalid')
+ type: this.$t('error'),
+ message: err.message
}
- console.error('error', e)
+
+ this.$store.dispatch('notice/addNoticeWithInterval', {
+ notice: {
+ untranslatedTitle: err.message,
+ type: 'warning'
+ }
+ })
+ } finally {
+ this.$store.dispatch('loading/disable')
}
},
onSettings() {
diff --git a/components/withdraw/WithdrawModalBox.vue b/components/withdraw/WithdrawModalBox.vue
index 20cb84d..ab6f87c 100644
--- a/components/withdraw/WithdrawModalBox.vue
+++ b/components/withdraw/WithdrawModalBox.vue
@@ -5,7 +5,7 @@
- {{ message }}
+ {{ $t('yourZkSnarkProofHasBeenSuccesfullyGenerated') }}
{{ $t('confirm') }}
@@ -14,7 +14,6 @@