From 0993394e1ca0090311fd06a7246e7766f078ece9 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Mon, 4 Apr 2022 16:59:02 +0800 Subject: [PATCH 1/2] add timestamp --- src/libs/fetch.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/libs/fetch.js b/src/libs/fetch.js index bc17ec8f..83457768 100644 --- a/src/libs/fetch.js +++ b/src/libs/fetch.js @@ -60,7 +60,7 @@ export default class ChainFetch { if (conf.chain_name === 'injective') { return ChainFetch.fetch('https://tm.injective.network', '/block').then(data => Block.create(commonProcess(data))) } - return this.get('/blocks/latest', config).then(data => Block.create(data)) + return this.get(`/blocks/latest?${new Date().getTime()}`, config).then(data => Block.create(data)) } async getBlockByHeight(height, config = null) { @@ -386,6 +386,19 @@ export default class ChainFetch { return ChainFetch.fetchCoinMarketCap(`/quote/${symbol}`) } + // Simulate Execution of tx + async simulate(tx, config = null) { + return this.post('/cosmos/tx/v1beta1/simulate', tx, config).then(res => { + if (res.code && res.code !== 0) { + throw new Error(res.message) + } + if (res.tx_response && res.tx_response.code !== 0) { + throw new Error(res.tx_response.raw_log) + } + return res + }) + } + // Tx Submit async broadcastTx(bodyBytes, config = null) { const txString = toBase64(TxRaw.encode(bodyBytes).finish()) From 4864ccf37f1bdf3a3fa2485fd6a7efb64aa3c015 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Mon, 4 Apr 2022 16:59:23 +0800 Subject: [PATCH 2/2] update tx boxes --- src/views/Governance.vue | 22 +----- src/views/Staking.vue | 19 +---- src/views/StakingRewardComponent.vue | 10 +-- src/views/WalletAccountDetail.vue | 75 ++---------------- .../OperationModal/TransactionResult.vue | 76 ++++++++++++++++--- src/views/components/OperationModal/index.vue | 65 ++++++++-------- 6 files changed, 108 insertions(+), 159 deletions(-) diff --git a/src/views/Governance.vue b/src/views/Governance.vue index b51d339f..cc58556a 100644 --- a/src/views/Governance.vue +++ b/src/views/Governance.vue @@ -157,40 +157,22 @@ {{ $t('btn_deposit') }} - - {{ $t('btn_deposit') }}1 - {{ $t('btn_vote') }} - - {{ $t('btn_vote') }}1 - diff --git a/src/views/Staking.vue b/src/views/Staking.vue index a644a2b6..257b899f 100644 --- a/src/views/Staking.vue +++ b/src/views/Staking.vue @@ -246,23 +246,6 @@ export default { }, data() { return { - keys: [ - 'bitsongvaloper1jxv0u20scum4trha72c7ltfgfqef6nscl86wxa', - 'akashvaloper1vgstlgtsx4w80gphwgre0fcvc04lcnaelukvll', - 'certikvaloper1jxv0u20scum4trha72c7ltfgfqef6nsczkvcu7', - 'cosmosvaloper1jxv0u20scum4trha72c7ltfgfqef6nsch7q6cu', - 'iva16plp8cmfkjssp222taq6pv6mkm8c5pa9lcktta', - 'junovaloper1jxv0u20scum4trha72c7ltfgfqef6nscm9pmg2', - 'kavavaloper1xftqdxvq0xkv2mu8c5y0jrsc578tak4m9u0s44', - 'kivaloper1jxv0u20scum4trha72c7ltfgfqef6nschqtan9', - 'osmovaloper1jxv0u20scum4trha72c7ltfgfqef6nscqx0u46', - 'persistencevaloper1jxv0u20scum4trha72c7ltfgfqef6nsc4zjpnj', - 'starsvaloper1jxv0u20scum4trha72c7ltfgfqef6nscdghxyx', - 'digvaloper1jxv0u20scum4trha72c7ltfgfqef6nsc4s577p', - 'bcnavaloper1jxv0u20scum4trha72c7ltfgfqef6nsc384wxf', - 'pbvaloper1jxv0u20scum4trha72c7ltfgfqef6nsc5nn6cf', - 'rizonvaloper1jxv0u20scum4trha72c7ltfgfqef6nsczn2l68', - ], islive: true, validator_address: null, mintInflation: 0, @@ -313,7 +296,7 @@ export default { }, computed: { pingVals() { - return this.list.filter(x => this.keys.includes(x.operator_address)) + return this.list.filter(x => x.description.identity === '6783E9F948541962') }, list() { return this.validators.map(x => { diff --git a/src/views/StakingRewardComponent.vue b/src/views/StakingRewardComponent.vue index 2dbdea30..0d79d94f 100644 --- a/src/views/StakingRewardComponent.vue +++ b/src/views/StakingRewardComponent.vue @@ -75,21 +75,13 @@ - - Withdraw Commission - - Withdraw Commission1 + Withdraw Commission Assets - - Transfer - Transfer1 - - - IBC Transfer + />Transfer - IBC Transfer1 + IBC Transfer @@ -152,34 +131,12 @@ size="sm" class="mr-25" @click="setOperationModalType('Delegate')" - > - Delegate1 - - Delegate - - Withdraw Rewards - Withdraw Rewards1 + /> Withdraw Rewards @@ -205,45 +162,27 @@ size="sm" > - - - - - - diff --git a/src/views/components/OperationModal/TransactionResult.vue b/src/views/components/OperationModal/TransactionResult.vue index 46a88a86..b3499815 100644 --- a/src/views/components/OperationModal/TransactionResult.vue +++ b/src/views/components/OperationModal/TransactionResult.vue @@ -1,10 +1,10 @@ - - + + AMOUNT @@ -33,11 +33,23 @@ Congratulations! Transfer completed successfully. + + {{ error }} + + + Processing... +
Congratulations! Transfer completed successfully.
+ {{ error }} +
+ Processing... +