diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2018-11-09 14:13:12 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2018-12-10 18:46:49 +0800 |
commit | b271dfc4e5951af6b99fe9a0d2000bb6db45e214 (patch) | |
tree | e8c1684e034c4b53346dddccd79178bdbe660d62 /app | |
parent | 667007ee63945a00fa0c46c3d037a30b1e434bce (diff) | |
download | dexon-wallet-b271dfc4e5951af6b99fe9a0d2000bb6db45e214.tar.gz dexon-wallet-b271dfc4e5951af6b99fe9a0d2000bb6db45e214.tar.zst dexon-wallet-b271dfc4e5951af6b99fe9a0d2000bb6db45e214.zip |
Fix UI bugs
Diffstat (limited to 'app')
-rw-r--r-- | app/manifest.json | 5 | ||||
-rw-r--r-- | app/scripts/background.js | 4 | ||||
-rw-r--r-- | app/scripts/controllers/transactions/README.md | 4 | ||||
-rw-r--r-- | app/scripts/controllers/transactions/index.js | 4 | ||||
-rw-r--r-- | app/scripts/controllers/transactions/tx-state-manager.js | 6 | ||||
-rw-r--r-- | app/scripts/migrations/003.js | 2 | ||||
-rw-r--r-- | app/scripts/migrations/019.js | 4 | ||||
-rw-r--r-- | app/scripts/migrations/020.js | 6 | ||||
-rw-r--r-- | app/scripts/platforms/extension.js | 8 |
9 files changed, 22 insertions, 21 deletions
diff --git a/app/manifest.json b/app/manifest.json index d9d1ba76..2196b59a 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "1.0.2", + "version": "1.0.3", "manifest_version": 2, "author": "https://dexon.org", "description": "__MSG_appDescription__", @@ -45,7 +45,8 @@ "matches": [ "https://*.dexscan.org/*", "https://*.dexon.org/*", - "https://deversi.netlify.com/*" + "https://deversi.netlify.com/*", + "http://localhost:3000/*" ], "js": [ "contentscript.js" diff --git a/app/scripts/background.js b/app/scripts/background.js index b47c5bac..601dfc06 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -82,7 +82,7 @@ setupMetamaskMeshMetrics() * @property {number} id - An internally unique tx identifier. * @property {number} time - Time the tx was first suggested, in unix epoch time (ms). * @property {string} status - The current transaction status (unapproved, signed, submitted, dropped, failed, rejected), as defined in `tx-state-manager.js`. - * @property {string} metamaskNetworkId - The transaction's network ID, used for EIP-155 compliance. + * @property {string} dekusanNetworkId - The transaction's network ID, used for EIP-155 compliance. * @property {boolean} loadingDefaults - TODO: Document * @property {Object} txParams - The tx params as passed to the network provider. * @property {Object[]} history - A history of mutations to this TransactionMeta object. @@ -97,7 +97,7 @@ setupMetamaskMeshMetrics() */ /** - * The data emitted from the DekuSanController.store EventEmitter, also used to initialize the DekuSanController. Available in UI on React state as state.metamask. + * The data emitted from the DekuSanController.store EventEmitter, also used to initialize the DekuSanController. Available in UI on React state as state.dekusan. * @typedef DekuSanState * @property {boolean} isInitialized - Whether the first vault has been created. * @property {boolean} isUnlocked - Whether the vault is currently decrypted and accounts are available for selection. diff --git a/app/scripts/controllers/transactions/README.md b/app/scripts/controllers/transactions/README.md index 75e3749a..ef2257b0 100644 --- a/app/scripts/controllers/transactions/README.md +++ b/app/scripts/controllers/transactions/README.md @@ -30,7 +30,7 @@ txMeta = { "id": 2828415030114568, // unique id for this txMeta used for look ups "time": 1524094064821, // time of creation "status": "confirmed", - "metamaskNetworkId": "1524091532133", //the network id for the transaction + "dekusanNetworkId": "1524091532133", //the network id for the transaction "loadingDefaults": false, // used to tell the ui when we are done calculatyig gass defaults "txParams": { // the txParams object "from": "0x8acce2391c0d510a6c5e5d8f819a678f79b7e675", @@ -44,7 +44,7 @@ txMeta = { "id": 2828415030114568, "time": 1524094064821, "status": "unapproved", - "metamaskNetworkId": "1524091532133", + "dekusanNetworkId": "1524091532133", "loadingDefaults": true, "txParams": { "from": "0x8acce2391c0d510a6c5e5d8f819a678f79b7e675", diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 718dd20e..e8ef5595 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -190,7 +190,7 @@ class TransactionController extends EventEmitter { try { // check whether recipient account is blacklisted - recipientBlacklistChecker.checkAccount(txMeta.metamaskNetworkId, normalizedTxParams.to) + recipientBlacklistChecker.checkAccount(txMeta.dekusanNetworkId, normalizedTxParams.to) // add default tx params txMeta = await this.addTxGasDefaults(txMeta) } catch (error) { @@ -619,7 +619,7 @@ class TransactionController extends EventEmitter { const unapprovedTxs = this.txStateManager.getUnapprovedTxList() const selectedAddressTxList = this.txStateManager.getFilteredTxList({ from: this.getSelectedAddress(), - metamaskNetworkId: this.getNetwork(), + dekusanNetworkId: this.getNetwork(), }) this.memStore.updateState({ unapprovedTxs, selectedAddressTxList }) } diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 72d869fa..49d3dfc8 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -49,7 +49,7 @@ class TransactionStateManager extends EventEmitter { id: createId(), time: (new Date()).getTime(), status: 'unapproved', - metamaskNetworkId: this.getNetwork(), + dekusanNetworkId: this.getNetwork(), loadingDefaults: true, }, opts) } @@ -60,7 +60,7 @@ class TransactionStateManager extends EventEmitter { getTxList () { const network = this.getNetwork() const fullTxList = this.getFullTxList() - return fullTxList.filter((txMeta) => txMeta.metamaskNetworkId === network) + return fullTxList.filter((txMeta) => txMeta.dekusanNetworkId === network) } /** @@ -384,7 +384,7 @@ class TransactionStateManager extends EventEmitter { const network = this.getNetwork() // Filter out the ones from the current account and network - const otherAccountTxs = txs.filter((txMeta) => !(txMeta.txParams.from === address && txMeta.metamaskNetworkId === network)) + const otherAccountTxs = txs.filter((txMeta) => !(txMeta.txParams.from === address && txMeta.dekusanNetworkId === network)) // Update state this._saveTxList(otherAccountTxs) diff --git a/app/scripts/migrations/003.js b/app/scripts/migrations/003.js index 140f81d4..17023265 100644 --- a/app/scripts/migrations/003.js +++ b/app/scripts/migrations/003.js @@ -1,6 +1,6 @@ const version = 3 const oldTestRpc = 'https://rawtestrpc.metamask.io/' -const newTestRpc = 'https://testrpc.metamask.io/' +const newTestRpc = 'https://api-testnet.dexon.org/v1/network/rpc/' const clone = require('clone') diff --git a/app/scripts/migrations/019.js b/app/scripts/migrations/019.js index 46a56d90..00e35c5d 100644 --- a/app/scripts/migrations/019.js +++ b/app/scripts/migrations/019.js @@ -39,12 +39,12 @@ function transformState (state) { const confirmedTxs = txList.filter((tx) => tx.status === 'confirmed') .filter((tx) => tx.txParams.from === txMeta.txParams.from) - .filter((tx) => tx.metamaskNetworkId.from === txMeta.metamaskNetworkId.from) + .filter((tx) => tx.dekusanNetworkId.from === txMeta.dekusanNetworkId.from) const highestConfirmedNonce = getHighestNonce(confirmedTxs) const pendingTxs = txList.filter((tx) => tx.status === 'submitted') .filter((tx) => tx.txParams.from === txMeta.txParams.from) - .filter((tx) => tx.metamaskNetworkId.from === txMeta.metamaskNetworkId.from) + .filter((tx) => tx.dekusanNetworkId.from === txMeta.dekusanNetworkId.from) const highestContinuousNonce = getHighestContinuousFrom(pendingTxs, highestConfirmedNonce) const maxNonce = Math.max(highestContinuousNonce, highestConfirmedNonce) diff --git a/app/scripts/migrations/020.js b/app/scripts/migrations/020.js index f0937753..a5d55675 100644 --- a/app/scripts/migrations/020.js +++ b/app/scripts/migrations/020.js @@ -29,9 +29,9 @@ module.exports = { function transformState (state) { const newState = state - if ('metamask' in newState && - !('firstTimeInfo' in newState.metamask)) { - newState.metamask.firstTimeInfo = { + if ('dekusan' in newState && + !('firstTimeInfo' in newState.dekusan)) { + newState.dekusan.firstTimeInfo = { version: '3.12.0', date: Date.now(), } diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 9ef0d22c..e15f5d5b 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -1,5 +1,5 @@ const extension = require('extensionizer') -const explorerLink = require('etherscan-link').createExplorerLink +const txLink = require('../../../ui/lib/tx-link') class ExtensionPlatform { @@ -73,11 +73,11 @@ class ExtensionPlatform { this._subscribeToNotificationClicked() - const url = explorerLink(txMeta.hash, parseInt(txMeta.metamaskNetworkId)) + const url = txLink(txMeta.hash, parseInt(txMeta.dekusanNetworkId)) const nonce = parseInt(txMeta.txParams.nonce, 16) const title = 'Confirmed transaction' - const message = `Transaction ${nonce} confirmed! View on EtherScan` + const message = `Transaction ${nonce} confirmed! View on DexScan` this._showNotification(title, message, url) } @@ -107,7 +107,7 @@ class ExtensionPlatform { } _viewOnEtherScan (txId) { - if (txId.startsWith('http://')) { + if (txId.startsWith('https://')) { global.metamaskController.platform.openWindow({ url: txId }) } } |