Skip to content

Commit ac33587

Browse files
committed
Merge branch 'release-candidate-0.81.0'
2 parents 67a85cc + f592be1 commit ac33587

File tree

95 files changed

+3423
-2862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+3423
-2862
lines changed

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ VUE_APP_FIREBASE_MESSAGING_SENDER_ID=
2020
VUE_APP_FIREBASE_APP_ID=
2121
VUE_APP_FIREBASE_MEASUREMENT_ID=
2222
VUE_APP_FIREBASE_DATABASE_URL=
23-
23+
VUE_APP_MAX_ERROR_LOG_SIZE=100
24+
VUE_APP_REPORT_TARGETS=

.github/workflows/release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ jobs:
139139
asset_name: liquality-wallet-${{ steps.get_current_tag.outputs.tag }}.zip
140140
asset_content_type: application/zip
141141

142-
# Run tests against Prod mainnet
143-
- name: Regression tests against Mainnet (PROD Agent)
144-
uses: beemi/puppeteer-headful@v1.0.12
145-
env:
146-
CI: 'true'
147-
DISPLAY: :99
148-
SEED_WORDS: ${{ secrets.TEST_NET_SEED_WORDS }}
149-
TWENTY_FOUR_SEEDS: ${{ secrets.TWENTY_FOUR_SEEDS }}
150-
with:
151-
args: yarn test:mainnet:prodagent:release
142+
# # Run tests against Prod mainnet
143+
# - name: Regression tests against Mainnet (PROD Agent)
144+
# uses: beemi/puppeteer-headful@v1.0.12
145+
# env:
146+
# CI: 'true'
147+
# DISPLAY: :99
148+
# SEED_WORDS: ${{ secrets.TEST_NET_SEED_WORDS }}
149+
# TWENTY_FOUR_SEEDS: ${{ secrets.TWENTY_FOUR_SEEDS }}
150+
# with:
151+
# args: yarn test:mainnet:prodagent:release

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "liquality-wallet",
3-
"version": "0.77.0",
3+
"version": "0.81.0",
44
"private": true,
55
"author": "Liquality <info@liquality.io>",
66
"scripts": {
@@ -21,11 +21,12 @@
2121
"test-full-regression": "node_modules/mocha/bin/mocha"
2222
},
2323
"dependencies": {
24-
"@liquality/cryptoassets": "1.16.2",
24+
"@liquality/cryptoassets": "2.1.0-next.2",
25+
"@liquality/error-parser": "2.0.1-next.2",
2526
"@liquality/ethereum-utils": "^1.13.12",
2627
"@liquality/terra-networks": "^1.13.12",
2728
"@liquality/types": "^1.13.12",
28-
"@liquality/wallet-core": "1.31.3",
29+
"@liquality/wallet-core": "3.0.0",
2930
"@terra-money/terra.js": "^3.1.6",
3031
"@testing-library/vue": "^5.8.2",
3132
"amplitude-js": "8.18.2",
@@ -41,7 +42,6 @@
4142
"date-fns": "2.28.0",
4243
"ethers": "5.7.0",
4344
"extension-port-stream": "^2.0.1",
44-
"firebase": "^9.12.1",
4545
"human-standard-token-abi": "^2.0.0",
4646
"i18n-js": "^4.1.1",
4747
"lodash-es": "^4.17.15",
@@ -69,18 +69,19 @@
6969
"vuex-persist": "3.1.3"
7070
},
7171
"devDependencies": {
72-
"@testing-library/jest-dom": "5.16.2",
72+
"@testing-library/jest-dom": "5.16.5",
7373
"@vue/cli-plugin-babel": "4.5.15",
7474
"@vue/cli-plugin-eslint": "~4.5.0",
7575
"@vue/cli-plugin-router": "4.5.15",
7676
"@vue/cli-plugin-unit-jest": "^4.5.8",
7777
"@vue/cli-plugin-vuex": "4.5.15",
7878
"@vue/cli-service": "4.5.15",
7979
"@vue/eslint-config-prettier": "^6.0.0",
80-
"@vue/test-utils": "1.3.0",
80+
"@vue/test-utils": "1.3.3",
8181
"babel-eslint": "^10.1.0",
8282
"caniuse-lite": "^1.0.30001397",
8383
"chai-match": "^1.1.1",
84+
"copy-webpack-plugin": "6",
8485
"eslint": "^6.8.0",
8586
"eslint-plugin-import": "^2.23.4",
8687
"eslint-plugin-node": "^11.1.0",

src/broker/Background.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import { buildConfig } from '@liquality/wallet-core'
22
import { BG_PREFIX, handleConnection, removeConnectId, getRootURL } from './utils'
33
import { getChain } from '@liquality/cryptoassets'
4+
import {
5+
CUSTOM_ERRORS,
6+
createInternalError,
7+
reportLiqualityError,
8+
DappNotConnectedError
9+
} from '@liquality/error-parser'
410
import { connectRemote } from './terra-injection'
11+
import { errorToLiqualityErrorString } from '@liquality/error-parser/dist/src/utils'
512

613
function attemptOrWarn(func, message) {
714
try {
@@ -154,8 +161,11 @@ class Background {
154161
.dispatch(data.type, data.payload)
155162
.then((result) => ({ result }))
156163
.catch((error) => {
157-
console.error(error)
158-
return { error: error.message }
164+
const liqualityErrorString = errorToLiqualityErrorString(error)
165+
reportLiqualityError(error)
166+
return {
167+
error: liqualityErrorString
168+
}
159169
})
160170
.then((response) =>
161171
attemptOrWarn(
@@ -175,7 +185,7 @@ class Background {
175185
break
176186

177187
default:
178-
throw new Error(`Received an invalid message type: ${type}`)
188+
throw createInternalError(CUSTOM_ERRORS.Invalid.MessageType(type))
179189
}
180190
}
181191

@@ -247,7 +257,7 @@ class Background {
247257
connection.postMessage({
248258
id,
249259
data: {
250-
error: 'Use enable() method first'
260+
error: new DappNotConnectedError({ dapp: origin, chain: chain }).toString()
251261
}
252262
})
253263
}
@@ -260,7 +270,7 @@ class Background {
260270
connection.postMessage({
261271
id,
262272
data: {
263-
error: 'Use enable() method first'
273+
error: new DappNotConnectedError({ dapp: origin, chain: chain }).toString()
264274
}
265275
})
266276
}
@@ -278,8 +288,10 @@ class Background {
278288
.dispatch(action, data)
279289
.then((result) => ({ result }))
280290
.catch((error) => {
281-
console.error(error) /* eslint-disable-line */
282-
return { error: error.toString() }
291+
const liqualityErrorString = errorToLiqualityErrorString(error)
292+
return {
293+
error: liqualityErrorString
294+
}
283295
})
284296
.then((response) => {
285297
connection.postMessage({

src/broker/Foreground.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { CUSTOM_ERRORS, createInternalError } from '@liquality/error-parser'
12
import EventEmitter from 'events'
23
import { BG_PREFIX, connectToBackground, newConnectId, Deferred } from './utils'
34

@@ -60,7 +61,7 @@ class Foreground {
6061
break
6162

6263
case 'REHYDRATE_STATE':
63-
if (this.initialized) throw new Error('State has already been synchronised with Background')
64+
if (this.initialized) throw createInternalError(CUSTOM_ERRORS.FailedAssert.RehydrateState)
6465

6566
this.store.replaceState(data)
6667

@@ -78,7 +79,7 @@ class Foreground {
7879
break
7980

8081
default:
81-
throw new Error(`Received an invalid message type: ${type}`)
82+
throw createInternalError(CUSTOM_ERRORS.Invalid.MessageType(type))
8283
}
8384
}
8485

src/components/ActivityFilter.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{ $t('components.activityFilter.dateRange') }}
2424
</div>
2525
<div class="date-filter-inputs h-padding form">
26-
<date-pick v-model="dateFilters.start">
26+
<date-pick v-model="dateFilters.start" @input="changeTrigered">
2727
<template v-slot:default="{ toggle, inputValue, inputEvents }">
2828
<div class="input-group" @click="toggle">
2929
<input
@@ -37,7 +37,7 @@
3737
</div>
3838
</template>
3939
</date-pick>
40-
<date-pick v-model="dateFilters.end">
40+
<date-pick v-model="dateFilters.end" @input="changeTrigered">
4141
<template v-slot:default="{ toggle, inputValue, inputEvents }">
4242
<div class="input-group" @click="toggle">
4343
<input
@@ -261,6 +261,11 @@ export default {
261261
statuses,
262262
dates: this.dateFilters
263263
})
264+
},
265+
changeTrigered() {
266+
this.$nextTick(() => {
267+
this.applyFilters()
268+
})
264269
}
265270
}
266271
}

src/components/CopyError.vue

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<template>
2+
<div class="copy-container">
3+
<button class="copy-btn" @click="copyError">
4+
<CopyIcon class="icon" v-if="!errorCopied" />
5+
<CheckIcon class="icon" v-if="errorCopied" />
6+
{{ errorCopied ? $t('common.copied') : $t('common.copyError') }}
7+
</button>
8+
</div>
9+
</template>
10+
11+
<script>
12+
import CopyIcon from '@/assets/icons/copy.svg'
13+
import CheckIcon from '@/assets/icons/check-primary.svg'
14+
import { liqualityErrorStringToJson } from '@liquality/error-parser'
15+
16+
export default {
17+
props: ['translatedError', 'liqualityErrorString'],
18+
components: {
19+
CopyIcon,
20+
CheckIcon
21+
},
22+
computed: {
23+
jsonError() {
24+
return {
25+
error: liqualityErrorStringToJson(this.liqualityErrorString),
26+
friendlyMessage: this.translatedError
27+
}
28+
}
29+
},
30+
data() {
31+
return {
32+
errorCopied: false
33+
}
34+
},
35+
methods: {
36+
async copyError() {
37+
await navigator.clipboard.writeText(JSON.stringify(this.jsonError))
38+
this.errorCopied = true
39+
setTimeout(() => {
40+
this.errorCopied = false
41+
}, 4000)
42+
}
43+
}
44+
}
45+
</script>
46+
47+
<style lang="scss" scoped>
48+
.copy-container {
49+
text-align: right;
50+
margin-left: auto;
51+
}
52+
53+
.copy-btn {
54+
display: flex;
55+
align-items: center;
56+
color: #9d4dfa;
57+
background: transparent;
58+
border: none;
59+
cursor: pointer;
60+
61+
.icon {
62+
width: 10px;
63+
height: 10px;
64+
font-size: 10px;
65+
line-height: 12px;
66+
margin-right: 5px;
67+
}
68+
}
69+
</style>

src/components/CustomFeesEIP1559.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,13 @@ import { prettyFiatBalance } from '@liquality/wallet-core/dist/src/utils/coinFor
235235
import ChevronUpIcon from '@/assets/icons/chevron_up.svg'
236236
import ChevronDownIcon from '@/assets/icons/chevron_down.svg'
237237
import { mapState } from 'vuex'
238+
import {
239+
NoTipError,
240+
VeryLowTipError,
241+
VeryHighTipWarning,
242+
NoMaxFeeError,
243+
VeryHighMaxFeeWarning
244+
} from '@liquality/error-parser/dist/src/LiqualityErrors'
238245
239246
export default {
240247
components: {
@@ -266,20 +273,20 @@ export default {
266273
...mapState(['activeNetwork']),
267274
// TODO: move erro handling to wallet-core
268275
noTipError() {
269-
return !this.tipFee ? 'Miner tip must be greater than 0 GWEI' : null
276+
return !this.tipFee ? this.$tle(new NoTipError()) : null
270277
},
271278
veryLowTipError() {
272279
return !this.noTipError && this.tipFee < this.fees.slow.fee.maxPriorityFeePerGas
273-
? 'Miner tip is extremely low and the transaction could fail. Use ‘Low’.'
280+
? this.$tle(new VeryLowTipError())
274281
: null
275282
},
276283
veryHighTipWarning() {
277284
return this.tipFee > this.fees.fast.fee.maxPriorityFeePerGas
278-
? 'Miner tip is higher than necessary. You may pay more than needed. Use ‘High’.'
285+
? this.$tle(new VeryHighTipWarning())
279286
: null
280287
},
281288
noMaxFeeError() {
282-
return !this.maxFee ? 'Max fee must be greater than 0 GWEI' : null
289+
return !this.maxFee ? this.$tle(new NoMaxFeeError()) : null
283290
},
284291
veryLowMaxFeeError() {
285292
return this.maxFee < this.fees.slow.fee.maxFeePerGas
@@ -288,7 +295,7 @@ export default {
288295
},
289296
veryHighFeeWarning() {
290297
return this.maxFee > this.fees.fast.fee.maxFeePerGas
291-
? `Max fee is higher than necessary ${this.fees.fast.fee.maxFeePerGas} GWEI (Base Fee plus Miner Tip). Review your maximum ‘New Fee Total’.`
298+
? this.$tle(new VeryHighMaxFeeWarning({ maxFeePerGas: this.fees.fast.fee.maxFeePerGas }))
292299
: null
293300
},
294301
slowPreset() {

src/components/EthRequiredMessage.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
11
<template>
22
<div class="notification-content">
33
<div class="notification-text">
4-
{{ $t('components.ethRequiredMesssage.message') }}
4+
{{ $t(`components.ethRequiredMessage.message_${action}`, { nativeAsset }) }}
55
</div>
66
<router-link :to="accountUrl" class="btn btn-option get-eth-btn">
7-
{{ $t('components.ethRequiredMesssage.getETH') }}
7+
{{ $t('components.ethRequiredMessage.getETH', { nativeAsset }) }}
88
</router-link>
99
</div>
1010
</template>
1111

1212
<script>
13+
import { mapGetters } from 'vuex'
14+
import { getNativeAsset, getFeeAsset } from '@liquality/wallet-core/dist/src/utils/asset'
1315
export default {
1416
props: {
15-
accountId: String
17+
accountId: String,
18+
action: {
19+
type: String,
20+
default: 'swap'
21+
}
1622
},
1723
computed: {
24+
...mapGetters(['accountItem', 'client', 'suggestedFeePrices']),
25+
account() {
26+
return this.accountItem(this.accountId)
27+
},
1828
accountUrl() {
19-
return `/accounts/${this.accountId}/ETH/receive`
29+
return `/accounts/${this.accountId}/${this.nativeAsset}/receive`
30+
},
31+
nativeAsset() {
32+
return getFeeAsset(this.asset) || getNativeAsset(this.asset)
33+
},
34+
asset() {
35+
if (this.account?.assets && this.account?.assets.length > 0) {
36+
return this.account?.assets[0]
37+
}
38+
return null
2039
}
2140
}
2241
}

src/components/Head.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ export default {
102102
},
103103
async switchNetwork(network) {
104104
await this.changeActiveNetwork({ network })
105-
await this.$router.replace('/wallet')
105+
if (this.$route.name !== 'WalletAssets') {
106+
await this.$router.replace({ name: 'WalletAssets'})
107+
}
106108
this.showNetworks = false
107109
}
108110
},

0 commit comments

Comments
 (0)