diff --git a/.github/pr_alert.yml b/.github/pr_alert.yml new file mode 100644 index 0000000000..2a59d032fb --- /dev/null +++ b/.github/pr_alert.yml @@ -0,0 +1,17 @@ +name: AlertOnPR + +on: + pull_request: + types: [opened] +jobs: + test: + name: Compile + runs-on: ubuntu-latest + steps: + - uses: rtCamp/action-slack-notify@master + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: 'pr_alerts' + SLACK_USERNAME: 'luniebot' + SLACK_ICON: 'https://emoji.slack-edge.com/TH6F97TDF/lunie/4ac63c1d435c04dc.png' + SLACK_MESSAGE: ${{ github.event.pull_request.title }} | ${{ github.event.pull_request.body }} | ${{ github.event.pull_request._links.html.href }} diff --git a/.vscode/settings.json b/.vscode/settings.json index af303999a0..341fe34a54 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,10 @@ "eslint.validate": [ "javascript", "javascriptreact", - { "language": "vue", "autoFix": false } + { + "language": "vue", + "autoFix": false + } ], "vetur.format.defaultFormatter.html": "prettier", "css.lint.emptyRules": "error", diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e413c9100..fef2748b76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,43 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. +## [1.0.156] - 2020-01-08 + +### Added + +- [#3358](https://github.com/cosmos/lunie/pull/3358) Adds the e-Money network icon @Bitcoinera +- [#3314](https://github.com/cosmos/lunie/issues/3314) Keep sessions per network @faboweb +- Allow address creation in all cosmos networks @faboweb +- added little x back to action modal @jbibla +- [#3345](https://github.com/cosmos/lunie/issues/3345) New tutorial component @mariopino + +### Changed + +- [#3313](https://github.com/cosmos/lunie/issues/3313) Now when Linux users go to sign in with Ledger they get a warning message with a link to the Ledger documentation to fix connection issues @Bitcoinera +- [#3289](https://github.com/cosmos/lunie/pull/3289) Now PageValidator handles empty fields more uniformly, always displaying `--` @Bitcoinera +- [#3366](https://github.com/cosmos/lunie/pull/3366) Fix link in ActionModal for lunie browser extension @Bitcoinera +- [#3349](https://github.com/cosmos/lunie/pull/3349) Now it is possible to also sign in with an Ethereum address @Bitcoinera +- [#3349](https://github.com/cosmos/lunie/pull/3349) Now the Undelegations component filters for only pending undelegations @Bitcoinera +- success screen icon is green instead of orange @jbibla +- delegation and undelegation are now "stake" and "unstake" @jbibla + +### Fixed + +- [#3354](https://github.com/cosmos/lunie/pull/3354) Fix session per network so it signs in to the current network @Bitcoinera +- [#3323](https://github.com/cosmos/lunie/pull/3323) Fixes the userTransactionAdded subscription and deletes the double TmLoadingComponent @Bitcoinera +- [#3359](https://github.com/cosmos/lunie/pull/3359) Fixes address undefined for the "To address" in multisends @Bitcoinera +- [#3350](https://github.com/cosmos/lunie/pull/3350) Remove field not present in API schema @colw +- [#3351](https://github.com/cosmos/lunie/pull/3351) A typo @colw +- Show failing txs in action modal @faboweb +- [#3096](https://github.com/cosmos/lunie/issues/3096) Fix redelegation to and from fields @mariopino +- [#3277](https://github.com/cosmos/lunie/issues/3277) Update proposals every 10 blocks @mariopino +- [#3328](https://github.com/cosmos/lunie/issues/3328) Fix error 404 in validator links from transactions in page block @mariopino +- [#3339](https://github.com/cosmos/lunie/issues/3339) Fix session modal validation triggers on closing @mariopino + +### Repository + +- Merge back master into develop before releasing @faboweb + ## [1.0.155] - 2019-12-18 ### Changed diff --git a/package.json b/package.json index 605090a6a3..add375fe66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lunie", - "version": "1.0.155", + "version": "1.0.156", "description": "Lunie is the staking and governance platform for proof-of-stake blockchains.", "author": "Lunie International Software Systems Inc. ", "scripts": { @@ -9,7 +9,7 @@ "changelog": "simsala log --pending-path ./changes", "lint": "vue-cli-service lint", "lint:style": "vue-cli-service lint:style", - "release": "git checkout develop & git pull & git push origin develop:release", + "release": "git fetch --all && git checkout origin/develop -B develop && git pull && git merge origin/master && git push -u origin develop & git push origin develop:release", "serve": "kill-port 9080 && vue-cli-service serve --port 9080", "serve:dist": "live-server --port=9080 --no-browser ./dist", "serve:mobile": "cross-env MOBILE_APP=true npm run serve", @@ -27,7 +27,8 @@ "@babel/polyfill": "^7.4.4", "@dicebear/avatars": "3.1.4", "@dicebear/avatars-jdenticon-sprites": "1.1.4", - "@lunie/cosmos-keys": "0.0.11", + "@lunie/cosmos-api": "0.2.5", + "@lunie/cosmos-keys": "0.0.12", "@lunie/cosmos-ledger": "0.1.4", "@sentry/browser": "5.7.1", "@sentry/integrations": "5.7.1", @@ -68,7 +69,8 @@ "vue-infinite-scroll": "^2.0.2", "vue-router": "^3.0.3", "vuelidate": "^0.7.4", - "vuex": "^3.1.1" + "vuex": "^3.1.1", + "web3-utils": "1.2.4" }, "devDependencies": { "@ascendancyy/vue-cli-plugin-stylelint": "^1.1.2", diff --git a/public/img/networks/emoney-testnet.png b/public/img/networks/emoney-testnet.png new file mode 100644 index 0000000000..2ec3cda812 Binary files /dev/null and b/public/img/networks/emoney-testnet.png differ diff --git a/public/img/tutorials/bg1.png b/public/img/tutorials/bg1.png new file mode 100644 index 0000000000..bb18862ee1 Binary files /dev/null and b/public/img/tutorials/bg1.png differ diff --git a/src/ActionModal/components/ActionModal.vue b/src/ActionModal/components/ActionModal.vue index 33eb0ef617..de89b0ee53 100644 --- a/src/ActionModal/components/ActionModal.vue +++ b/src/ActionModal/components/ActionModal.vue @@ -9,6 +9,13 @@ > arrow_back +
+ close +
{{ requiresSignIn ? `Sign in required` : title @@ -146,7 +153,7 @@
Please install the Lunie Browser Extension from the Chrome Web Store
- +
Sent and confirming
- The transaction - - was successfully signed and sent the network. Waiting for it to be - confirmed. + Waiting for confirmation from {{ networkId }}.
@@ -195,7 +199,7 @@ v-else-if="step === successStep" class="action-modal-form success-step" > - +
{{ notifyMessage.title }}
@@ -375,6 +379,10 @@ export default { body: `You have successfully completed a transaction.` }) }, + featureFlag: { + type: String, + default: `` + }, // disable proceeding from the first page disabled: { type: Boolean, @@ -409,7 +417,7 @@ export default { ...mapGetters([`connected`, `isExtensionAccount`]), ...mapGetters({ networkId: `network` }), checkFeatureAvailable() { - const action = `action_${this.title.toLowerCase().replace(" ", "_")}` + const action = `action_` + this.featureFlag return this.network[action] === true }, requiresSignIn() { @@ -508,7 +516,7 @@ export default { let confirmResult = false if (this.session.currrentModalOpen) { confirmResult = window.confirm( - "You are in the middle of creating a transaction already. Are you sure you want to cancel this action?" + "You are in the middle of creating a transaction. Are you sure you want to cancel this action and start a new one?" ) if (confirmResult) { this.session.currrentModalOpen.close() @@ -944,7 +952,11 @@ export default { font-style: italic; color: var(--dim); display: inline-block; - padding: 0.5rem 0 0.5rem 1rem; + padding: 0.5rem; +} + +.form-message.notice { + padding: 2rem 0.5rem 0.5rem; } .slide-fade-enter-active { diff --git a/src/ActionModal/components/DelegationModal.vue b/src/ActionModal/components/DelegationModal.vue index 6eefdf34eb..68181799e6 100644 --- a/src/ActionModal/components/DelegationModal.vue +++ b/src/ActionModal/components/DelegationModal.vue @@ -3,40 +3,41 @@ id="delegation-modal" ref="actionModal" :validate="validateForm" - :amount="isRedelegation ? 0 : amount" - :title="isRedelegation ? 'Redelegate' : 'Delegate'" + :amount="amount" + :title="isRedelegation ? 'Restake' : 'Stake'" class="delegation-modal" - submission-error-prefix="Delegating failed" + submission-error-prefix="Staking failed" :transaction-data="transactionData" :notify-message="notifyMessage" + feature-flag="delegate" @close="clear" @txIncluded="onSuccess" >
- It will take 21 days to unlock your tokens after a delegation and - there is a risk that some tokens will be lost depending on the - behaviour of the validator. + It will take 21 days to unlock your tokens after they are staked. + There is a risk that some tokens will be lost depending on the + behaviour of the validator you choose. - Voting power and rewards will change instantly upon redelegation — + Voting power and rewards will change instantly upon restaking — but your tokens will still be subject to the risks associated with the - original delegation for the duration of the undelegation period. + original stake for the duration of the unstaking period.
- {{ - isRedelegation ? "Available to Redelegate" : "Available to Delegate" - }} - : + Available to stake: {{ maxAmount }} {{ denom }}s @@ -143,7 +140,7 @@ import TmFormMsg from "src/components/common/TmFormMsg" import ActionModal from "./ActionModal" import transaction from "../utils/transactionTypes" import { toMicroDenom } from "src/scripts/common" -import { formatBech32 } from "src/filters" +import { formatBech32, validatorEntry } from "src/filters" import { UserTransactionAdded } from "src/gql" export default { @@ -156,6 +153,9 @@ export default { TmFormMsg, ActionModal }, + filters: { + validatorEntry + }, props: { targetValidator: { type: Object, @@ -163,18 +163,37 @@ export default { } }, data: () => ({ - amount: 0, - selectedIndex: 0, + amount: null, + fromSelectedIndex: `0`, balance: { - amount: 0, + amount: null, denom: `` }, + validators: [], delegations: [], denom: `` }), computed: { ...mapState([`session`]), ...mapGetters([`network`, `address`]), + toOptions() { + return this.validators + .filter( + validator => + validator.operatorAddress === this.targetValidator.operatorAddress + ) + .map(validator => { + return { + address: validator.operatorAddress, + key: `${validator.name} - ${formatBech32( + validator.operatorAddress, + false, + 20 + )}`, + value: 0 + } + }) + }, fromOptions() { let options = [ // from wallet @@ -185,24 +204,19 @@ export default { value: 0 } ] - options = options.concat( this.delegations - // exclude the validator we are delegating to as a source + // exclude target validator .filter( delegation => - delegation.validator.operatorAddress != + delegation.validator.operatorAddress !== this.targetValidator.operatorAddress ) .map((delegation, index) => { return { address: delegation.validator.operatorAddress, maximum: Number(delegation.amount), - key: `${delegation.validator.name} - ${formatBech32( - delegation.validator.operatorAddress, - false, - 20 - )}`, + key: validatorEntry(delegation.validator), value: index + 1 } }) @@ -213,13 +227,10 @@ export default { from() { if (!this.session.signedIn) return `` - return this.fromOptions[this.selectedIndex].address - }, - isRedelegation() { - return this.from !== this.address + return this.fromOptions[this.fromSelectedIndex].address }, transactionData() { - if (!this.from) return {} + if (!this.targetValidator.operatorAddress) return {} if (this.isRedelegation) { return { @@ -241,18 +252,21 @@ export default { notifyMessage() { if (this.isRedelegation) { return { - title: `Successful redelegation!`, - body: `You have successfully redelegated your ${this.denom}s` + title: `Successfully restaked!`, + body: `You have successfully restaked your ${this.denom}s` } } else { return { - title: `Successful delegation!`, - body: `You have successfully delegated your ${this.denom}s` + title: `Successfully staked!`, + body: `You have successfully staked your ${this.denom}s` } } }, maxAmount() { - return this.fromOptions[this.selectedIndex].maximum + return this.fromOptions[this.fromSelectedIndex].maximum + }, + isRedelegation() { + return this.fromSelectedIndex !== `0` } }, mounted() { @@ -260,22 +274,17 @@ export default { this.$apollo.queries.delegations.refetch() }, methods: { - open(options) { - if (options && options.redelegation && this.fromOptions.length > 1) { - this.selectedIndex = 1 - } + open() { this.$refs.actionModal.open() }, validateForm() { this.$v.$touch() - return !this.$v.$invalid }, clear() { this.$v.$reset() - - this.selectedIndex = 0 - this.amount = 0 + this.fromSelectedIndex = 0 + this.amount = null }, setMaxAmount() { this.amount = this.maxAmount @@ -300,6 +309,26 @@ export default { } }, apollo: { + validators: { + query: gql` + query validators($networkId: String!) { + validators(networkId: $networkId) { + name + operatorAddress + } + } + `, + variables() { + /* istanbul ignore next */ + return { + networkId: this.network + } + }, + update(data) { + /* istanbul ignore next */ + return data.validators + } + }, delegations: { query: gql` query DelegationsDelegationModal( @@ -319,9 +348,11 @@ export default { } `, skip() { + /* istanbul ignore next */ return !this.address }, variables() { + /* istanbul ignore next */ return { networkId: this.network, delegatorAddress: this.address @@ -346,9 +377,11 @@ export default { } `, skip() { + /* istanbul ignore next */ return !this.address }, variables() { + /* istanbul ignore next */ return { networkId: this.network, address: this.address, @@ -366,6 +399,7 @@ export default { } `, variables() { + /* istanbul ignore next */ return { networkId: this.network } @@ -379,16 +413,19 @@ export default { $subscribe: { userTransactionAdded: { variables() { + /* istanbul ignore next */ return { networkId: this.network, address: this.address } }, skip() { + /* istanbul ignore next */ return !this.address }, query: UserTransactionAdded, result({ data }) { + /* istanbul ignore next */ if (data.userTransactionAdded.success) { this.$apollo.queries.delegations.refetch() } diff --git a/src/ActionModal/components/ModalDeposit.vue b/src/ActionModal/components/ModalDeposit.vue index dcedd3b428..803a279c34 100644 --- a/src/ActionModal/components/ModalDeposit.vue +++ b/src/ActionModal/components/ModalDeposit.vue @@ -9,6 +9,7 @@ submission-error-prefix="Depositing failed" :transaction-data="transactionData" :notify-message="notifyMessage" + feature-flag="deposit" @close="clear" @txIncluded="onSuccess" > @@ -19,7 +20,13 @@ field-label="Amount" > {{ denom | viewDenom }} - + ({ - amount: 0, + amount: null, balance: { - amount: 0, + amount: null, denom: `` } }), diff --git a/src/ActionModal/components/ModalPropose.vue b/src/ActionModal/components/ModalPropose.vue index 9d67e8a806..7ed5291047 100644 --- a/src/ActionModal/components/ModalPropose.vue +++ b/src/ActionModal/components/ModalPropose.vue @@ -4,10 +4,11 @@ ref="actionModal" :validate="validateForm" :amount="amount" - title="Proposal" + title="Create Proposal" submission-error-prefix="Submitting proposal failed" :transaction-data="transactionData" :notify-message="notifyMessage" + feature-flag="proposal" @close="clear" @txIncluded="onSuccess" > @@ -22,7 +23,6 @@ v-model.trim="title" v-focus type="text" - placeholder="Proposal title" @keyup.enter.native="refocusOn" /> diff --git a/src/ActionModal/components/ModalWithdrawRewards.vue b/src/ActionModal/components/ModalWithdrawRewards.vue index 68cf7e0847..fc033e335e 100644 --- a/src/ActionModal/components/ModalWithdrawRewards.vue +++ b/src/ActionModal/components/ModalWithdrawRewards.vue @@ -7,6 +7,7 @@ title="Claim Rewards" class="modal-withdraw-rewards" submission-error-prefix="Withdrawal failed" + feature-flag="claim_rewards" :rewards="rewards" :disable="validatorsWithRewards" > diff --git a/src/ActionModal/components/SendModal.vue b/src/ActionModal/components/SendModal.vue index 222dc3d091..8019ca101a 100644 --- a/src/ActionModal/components/SendModal.vue +++ b/src/ActionModal/components/SendModal.vue @@ -8,6 +8,7 @@ submission-error-prefix="Sending tokens failed" :transaction-data="transactionData" :notify-message="notifyMessage" + feature-flag="send" @close="clear" @txIncluded="onSuccess" > @@ -49,7 +50,7 @@ ref="amount" v-model="amount" class="tm-field-addon" - placeholder="Amount" + placeholder="0" type="number" @keyup.enter.native="enterPressed" /> @@ -104,8 +105,8 @@
- - Undelegations take 21 days to complete and cannot be undone. Please - make sure you understand the rules of delegation. Would you prefer to - redelegate? + + Unstaking takes 21 days to complete and cannot be undone. Please make + sure you understand the rules of staking. + + + Voting power and rewards will change instantly upon restaking — but + your tokens will still be subject to the risks associated with the + original stake for the duration of the unstaking period.
@@ -28,7 +33,28 @@ field-id="from" field-label="From" > - + +
+ + + - Currently Delegated: {{ maximum }} {{ denom }}s + Currently staked: {{ maximum }} {{ denom }}s + + diff --git a/src/components/common/TmDataMsg.vue b/src/components/common/TmDataMsg.vue index 067107f282..683c4bca57 100644 --- a/src/components/common/TmDataMsg.vue +++ b/src/components/common/TmDataMsg.vue @@ -1,6 +1,6 @@ diff --git a/src/filters/index.js b/src/filters/index.js index 95684e1417..0bdb44e0bf 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -38,3 +38,6 @@ export const resolveValidatorName = (address, validators) => { } return formatBech32(address) } + +export const validatorEntry = validator => + `${validator.name} - ${formatBech32(validator.operatorAddress, false, 20)}` diff --git a/src/gql/index.js b/src/gql/index.js index 6c64266433..0f0798abac 100644 --- a/src/gql/index.js +++ b/src/gql/index.js @@ -14,7 +14,7 @@ export const schemaMap = { testnet: "gaia_testnet_" } -const ValidatorFragment = ` +export const ValidatorFragment = ` name operatorAddress consensusPubkey @@ -35,7 +35,6 @@ const ValidatorFragment = ` statusDetailed expectedReturns selfStake - delegatorDelegation ` export const AllValidators = () => { @@ -65,19 +64,6 @@ export const DelegatorValidators = schema => gql` } ` -export const UndelegationsForDelegator = schema => gql` - query Undelegations($delegatorAddress: String!) { - undelegations(networkId: "${schema}", delegatorAddress: $delegatorAddress) { - validator { - ${ValidatorFragment} - } - amount - startHeight - endTime - } - } -` - export const DelegationsForDelegator = schema => gql` query Delegations($delegatorAddress: String!) { delegations(networkId: "${schema}", delegatorAddress: $delegatorAddress) { diff --git a/src/initializeApp.js b/src/initializeApp.js index 4c86b30300..148d73d0b6 100644 --- a/src/initializeApp.js +++ b/src/initializeApp.js @@ -45,9 +45,10 @@ export default function init(urlParams, env = process.env) { setOptions(urlParams, store) store.dispatch(`loadLocalPreferences`) - store.dispatch(`checkForPersistedSession`) + store.dispatch(`checkForPersistedNetwork`).then(() => { + store.dispatch(`checkForPersistedSession`) + }) store.dispatch(`checkForPersistedAddresses`) - store.dispatch(`checkForPersistedNetwork`) listenToExtensionMessages(store) diff --git a/src/scripts/extension-utils.js b/src/scripts/extension-utils.js index eaeb0156e8..896785b19f 100644 --- a/src/scripts/extension-utils.js +++ b/src/scripts/extension-utils.js @@ -31,7 +31,7 @@ const filterExtensionMessage = callback => message => { } } -// exported for easyier testing +// exported for easier testing export const processLunieExtensionMessages = store => filterExtensionMessage(data => { const message = unWrapMessageFromContentScript(data) diff --git a/src/vuex/modules/connection.js b/src/vuex/modules/connection.js index a8cea4eae5..9ee2c415b7 100644 --- a/src/vuex/modules/connection.js +++ b/src/vuex/modules/connection.js @@ -53,6 +53,7 @@ export default function({ apollo }) { dispatch(`signOut`) dispatch(`persistNetwork`, network) commit("setNetworkId", network.id) + dispatch(`checkForPersistedSession`) // check for persisted session on that network console.info(`Connecting to: ${network.id}`) } } diff --git a/src/vuex/modules/keystore.js b/src/vuex/modules/keystore.js index d69fbe9e95..fc4a852b64 100644 --- a/src/vuex/modules/keystore.js +++ b/src/vuex/modules/keystore.js @@ -35,22 +35,22 @@ export default () => { const { getSeed } = await import("@lunie/cosmos-keys") return getSeed() }, - async getAddressFromSeed(store, seedPhrase) { - const { getNewWalletFromSeed } = await import("@lunie/cosmos-keys") - const wallet = getNewWalletFromSeed(seedPhrase) + async getAddressFromSeed(store, { seedPhrase, network }) { + const wallet = await getWallet(seedPhrase, network) return wallet.cosmosAddress }, - async createKey({ dispatch, state }, { seedPhrase, password, name }) { - const { getNewWalletFromSeed, storeWallet } = await import( - "@lunie/cosmos-keys" - ) - - state.externals.track(`event`, `session`, `create-keypair`) - - const wallet = getNewWalletFromSeed(seedPhrase) + async createKey( + { dispatch, state }, + { seedPhrase, password, name, network } + ) { + // TODO extract the key storage from the key creation + const { storeWallet } = await import("@lunie/cosmos-keys") + const wallet = await getWallet(seedPhrase, network) storeWallet(wallet, name, password) + state.externals.track(`event`, `session`, `create-keypair`) + // reload accounts as we just added a new one dispatch("loadAccounts") @@ -69,3 +69,37 @@ export default () => { actions } } + +// creates a cosmos addres for the network desired +function getCosmosAddressCreator(network) { + return async seedPhrase => { + const bech32Prefixes = { + "cosmos-hub-mainnet": "cosmos", + "cosmos-hub-testnet": "cosmos", + "regen-testnet": "xrn:", + "regen-mainnet": "xrn:", + "terra-testnet": "terra", + "terra-mainnet": "terra" + } + const { getNewWalletFromSeed } = await import("@lunie/cosmos-keys") + return getNewWalletFromSeed(seedPhrase, bech32Prefixes[network]) + } +} + +async function getWallet(seedPhrase, network) { + switch (network) { + case "cosmos-hub-mainnet": + case "cosmos-hub-testnet": + case "regen-testnet": + case "regen-mainnet": + case "terra-testnet": + case "terra-mainnet": { + const addressCreator = await getCosmosAddressCreator(network) + return addressCreator(seedPhrase) + } + default: + throw new Error( + "Lunie doesn't support address creation for this network." + ) + } +} diff --git a/src/vuex/modules/session.js b/src/vuex/modules/session.js index b1dff397b2..278e5faecf 100644 --- a/src/vuex/modules/session.js +++ b/src/vuex/modules/session.js @@ -88,8 +88,13 @@ export default ({ apollo }) => { } const actions = { - async checkForPersistedSession({ dispatch }) { - const session = localStorage.getItem(`session`) + async checkForPersistedSession({ + dispatch, + rootState: { + connection: { network } + } + }) { + const session = localStorage.getItem(sessionKey(network)) if (session) { const { address, sessionType } = JSON.parse(session) await dispatch(`signIn`, { address, sessionType }) @@ -101,8 +106,11 @@ export default ({ apollo }) => { await commit(`setUserAddresses`, JSON.parse(addresses)) } }, - async persistSession(store, { address, sessionType }) { - localStorage.setItem(`session`, JSON.stringify({ address, sessionType })) + async persistSession(store, { address, sessionType, networkId }) { + localStorage.setItem( + sessionKey(networkId), + JSON.stringify({ address, sessionType }) + ) }, async persistAddresses(store, { addresses }) { localStorage.setItem(`addresses`, JSON.stringify(addresses)) @@ -122,7 +130,14 @@ export default ({ apollo }) => { } }, async signIn( - { state, commit, dispatch }, + { + state, + commit, + dispatch, + rootState: { + connection: { network } + } + }, { address, sessionType = `ledger` } ) { if (state.signedIn) { @@ -136,7 +151,8 @@ export default ({ apollo }) => { dispatch(`persistSession`, { address, - sessionType + sessionType, + networkId: network }) const addresses = state.addresses dispatch(`persistAddresses`, { @@ -216,3 +232,7 @@ export default ({ apollo }) => { actions } } + +function sessionKey(networkId) { + return `session_${networkId}` +} diff --git a/tests/unit/specs/components/ActionModal/components/ActionModal.spec.js b/tests/unit/specs/components/ActionModal/components/ActionModal.spec.js index ea78b24f33..e62bdb380e 100644 --- a/tests/unit/specs/components/ActionModal/components/ActionModal.spec.js +++ b/tests/unit/specs/components/ActionModal/components/ActionModal.spec.js @@ -101,11 +101,11 @@ describe(`ActionModal`, () => { currrentModalOpen: false }, overview, - network, delegations }, getters: { connected: true, + network, networkId: "testnet", isExtensionAccount: false } @@ -116,6 +116,7 @@ describe(`ActionModal`, () => { propsData: { title: `Send`, validate: jest.fn(), + featureFlag: `send`, transactionData: { type: "MsgSend", denom: "uatom", diff --git a/tests/unit/specs/components/ActionModal/components/DelegationModal.spec.js b/tests/unit/specs/components/ActionModal/components/DelegationModal.spec.js index a93ab27589..af07ea4df7 100644 --- a/tests/unit/specs/components/ActionModal/components/DelegationModal.spec.js +++ b/tests/unit/specs/components/ActionModal/components/DelegationModal.spec.js @@ -50,7 +50,8 @@ describe(`DelegationModal`, () => { $apollo: { queries: { balance: { refetch: () => {} }, - delegations: { refetch: () => {} } + delegations: { refetch: () => {} }, + validators: { refetch: () => {} } } } }, @@ -67,13 +68,18 @@ describe(`DelegationModal`, () => { { validator: validators[1], amount: 124 + }, + { + validator: validators[2], + amount: 200 } ], denom: "STAKE", balance: { amount: 1000, denom: "STAKE" - } + }, + validators: validators }) }) @@ -95,22 +101,16 @@ describe(`DelegationModal`, () => { expect($refs.actionModal.open).toHaveBeenCalled() }) - it(`opens and switches to redelegaion when selected`, () => { - wrapper.vm.$refs = { actionModal: { open: jest.fn() } } - wrapper.vm.open({ redelegation: true }) - expect(wrapper.vm.selectedIndex).toBe(1) - }) - it(`clears on close`, () => { const self = { $v: { $reset: jest.fn() }, - selectedIndex: 1, + fromSelectedIndex: 1, amount: 10 } DelegationModal.methods.clear.call(self) expect(self.$v.$reset).toHaveBeenCalled() - expect(self.selectedIndex).toBe(0) - expect(self.amount).toBe(0) + expect(self.fromSelectedIndex).toBe(0) + expect(self.amount).toBe(null) }) describe(`if amount field max button clicked`, () => { @@ -147,7 +147,7 @@ describe(`DelegationModal`, () => { }) wrapper.setData({ amount: 10, - selectedIndex: 0 + fromSelectedIndex: `0` }) }) @@ -162,47 +162,68 @@ describe(`DelegationModal`, () => { it("should return correct notification message for delegating", () => { expect(wrapper.vm.notifyMessage).toEqual({ - title: `Successful delegation!`, - body: `You have successfully delegated your STAKEs` + title: `Successfully staked!`, + body: `You have successfully staked your STAKEs` }) }) + + it(`should send an event on success`, () => { + const self = { + $emit: jest.fn() + } + DelegationModal.methods.onSuccess.call(self) + expect(self.$emit).toHaveBeenCalledWith( + "success", + expect.objectContaining({}) + ) + }) }) describe("Submission Data for Redelegating", () => { beforeEach(() => { wrapper.setProps({ - targetValidator: validators[1] + targetValidator: validators[2] }) wrapper.setData({ amount: 10, - selectedIndex: 1 + fromSelectedIndex: 2 }) }) - it("should return correct transaction data for delegating", () => { + it("should return correct transaction data for redelegating", () => { expect(wrapper.vm.transactionData).toEqual({ type: "MsgRedelegate", - validatorSourceAddress: "cosmosvaladdr12324536463", - validatorDestinationAddress: "cosmosvaladdr1sdsdsd123123", + validatorDestinationAddress: "cosmosvaladdr1kjisjsd862323", + validatorSourceAddress: "cosmosvaladdr1sdsdsd123123", amount: "10000000", denom: "stake" }) - // expect(wrapper.vm.transactionData).toEqual() }) it("should return correct notification message for delegating", () => { expect(wrapper.vm.notifyMessage).toEqual({ - title: `Successful redelegation!`, - body: `You have successfully redelegated your STAKEs` + title: `Successfully restaked!`, + body: `You have successfully restaked your STAKEs` }) }) + + it(`should send an event on success`, () => { + const self = { + $emit: jest.fn() + } + DelegationModal.methods.onSuccess.call(self) + expect(self.$emit).toHaveBeenCalledWith( + "success", + expect.objectContaining({}) + ) + }) }) describe(`if amount field max button clicked`, () => { it(`amount has to be 1000 atom`, async () => { wrapper.setData({ amount: 1, - selectedIndex: 0 + fromSelectedIndex: `0` }) wrapper.vm.setMaxAmount() expect(wrapper.vm.amount).toBe(1000) @@ -210,7 +231,7 @@ describe(`DelegationModal`, () => { it(`should show warning message`, async () => { wrapper.setData({ amount: 1000, - selectedIndex: 0 + fromSelectedIndex: `0` }) //await wrapper.vm.$nextTick() expect(wrapper.html()).toContain( @@ -226,10 +247,10 @@ describe(`DelegationModal`, () => { }) wrapper.setData({ amount: 1, - selectedIndex: 0 + fromSelectedIndex: `0` }) expect(wrapper.html()).toContain( - "You are about to delegate to an inactive validator (temporally banned from the network)" + "You are about to stake to an inactive validator (temporally banned from the network)" ) }) }) @@ -241,10 +262,10 @@ describe(`DelegationModal`, () => { }) wrapper.setData({ amount: 1, - selectedIndex: 0 + fromSelectedIndex: `0` }) expect(wrapper.html()).toContain( - "You are about to delegate to an inactive validator (banned from the network)" + "You are about to stake to an inactive validator (banned from the network)" ) }) }) @@ -253,11 +274,11 @@ describe(`DelegationModal`, () => { it(`must not show warn message`, async () => { wrapper.setData({ amount: 1, - selectedIndex: 0, + fromSelectedIndex: `0`, targetValidator: validators[0] // Active validator }) expect(wrapper.html()).not.toContain( - "You are about to delegate to an inactive validator" + "You are about to stake to an inactive validator" ) expect(wrapper.find("#to .tm-form-msg--desc").exists()).toBe(false) }) diff --git a/tests/unit/specs/components/ActionModal/components/UndelegationModal.spec.js b/tests/unit/specs/components/ActionModal/components/UndelegationModal.spec.js index 76c960b003..41e86bdb2d 100644 --- a/tests/unit/specs/components/ActionModal/components/UndelegationModal.spec.js +++ b/tests/unit/specs/components/ActionModal/components/UndelegationModal.spec.js @@ -10,6 +10,10 @@ describe(`UndelegationModal`, () => { operatorAddress: `cosmosvaladdr15ky9du8a2wlstz6fpx3p4mqpjyrm5ctplpn3au` // we don't need other props in this component } + const validator2 = { + operatorAddress: `cosmosvaladdr123` + } + const localVue = createLocalVue() localVue.use(Vuelidate) localVue.directive("focus", () => {}) @@ -37,9 +41,14 @@ describe(`UndelegationModal`, () => { { validator, amount: 1000 + }, + { + validator: validator2, + amount: 5000 } ], - denom: "STAKE" + denom: "STAKE", + validators: [validator, validator2] }) }) @@ -53,13 +62,6 @@ describe(`UndelegationModal`, () => { expect($refs.actionModal.open).toHaveBeenCalled() }) - it(`emits switch to redelegation event`, () => { - wrapper.vm.$refs = { actionModal: { close: jest.fn() } } - wrapper.find("#switch-to-redelgation").trigger("click") - expect(wrapper.vm.$refs.actionModal.close).toHaveBeenCalled() - expect(wrapper.emitted().switchToRedelegation).toBeTruthy() - }) - it(`clears on close`, () => { const self = { $v: { $reset: jest.fn() }, @@ -98,7 +100,18 @@ describe(`UndelegationModal`, () => { }) }) - describe("Submission Data", () => { + it(`should send an event on success`, () => { + const self = { + $emit: jest.fn() + } + UndelegationModal.methods.onSuccess.call(self) + expect(self.$emit).toHaveBeenCalledWith( + "success", + expect.objectContaining({}) + ) + }) + + describe("Undelegation Submission Data", () => { beforeEach(() => { wrapper.setData({ amount: 10 @@ -117,8 +130,35 @@ describe(`UndelegationModal`, () => { it("should return correct notification message", () => { expect(wrapper.vm.notifyMessage).toEqual({ - title: `Successful undelegation!`, - body: `You have successfully undelegated 10 STAKEs.` + title: `Successfully unstaked!`, + body: `You have successfully unstaked 10 STAKEs.` + }) + }) + }) + + describe("Redelegation Submission Data", () => { + beforeEach(() => { + wrapper.setData({ + amount: 10 + }) + wrapper.vm.toSelectedIndex = `cosmosvaladdrXYZ` + }) + + it("should return correct transaction data", () => { + expect(wrapper.vm.transactionData).toEqual({ + type: "MsgRedelegate", + validatorSourceAddress: + "cosmosvaladdr15ky9du8a2wlstz6fpx3p4mqpjyrm5ctplpn3au", + validatorDestinationAddress: "cosmosvaladdrXYZ", + amount: "10000000", + denom: "stake" + }) + }) + + it("should return correct notification message", () => { + expect(wrapper.vm.notifyMessage).toEqual({ + title: `Successfully restaked!`, + body: `You have successfully restaked 10 STAKEs.` }) }) }) diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap index 0eb2667465..e21ca4f2f3 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap @@ -17,6 +17,17 @@ exports[`ActionModal back button renders and functions 1`] = `
+
+ + close + +
+
@@ -98,6 +109,17 @@ exports[`ActionModal runs validation and changes step on sign step should dispal
+
+ + close + +
+
@@ -176,6 +198,17 @@ exports[`ActionModal should show the action modal on success 1`] = ` > +
+ + close + +
+
@@ -195,6 +228,7 @@ exports[`ActionModal should show the action modal on success 1`] = ` >
@@ -238,6 +272,17 @@ exports[`ActionModal should show the action modal waiting on inclusion 1`] = ` > +
+ + close + +
+
@@ -281,6 +326,17 @@ exports[`ActionModal should show the action modal when user has logged in with e
+
+ + close + +
+
@@ -352,6 +408,17 @@ exports[`ActionModal should show the action modal when user has logged in with e
+
+ + close + +
+
@@ -435,6 +502,17 @@ exports[`ActionModal should show the action modal when user has logged in with e > +
+ + close + +
+
@@ -528,6 +606,17 @@ exports[`ActionModal should show the action modal when user has logged in with e
+
+ + close + +
+
@@ -599,6 +688,17 @@ exports[`ActionModal should show the action modal when user has logged in with e
+
+ + close + +
+
@@ -677,6 +777,17 @@ exports[`ActionModal should show the action modal when user has logged in with e > +
+ + close + +
+
@@ -766,6 +877,17 @@ exports[`ActionModal should show the action modal when user has logged in with l
+
+ + close + +
+
@@ -837,6 +959,17 @@ exports[`ActionModal should show the action modal when user has logged in with l
+
+ + close + +
+
@@ -904,6 +1037,17 @@ exports[`ActionModal should show the action modal when user has logged in with l > +
+ + close + +
+
@@ -982,6 +1126,17 @@ exports[`ActionModal should show the action modal when user has logged in with l
+
+ + close + +
+
@@ -1053,6 +1208,17 @@ exports[`ActionModal should show the action modal when user has logged in with l
+
+ + close + +
+
@@ -1125,6 +1291,17 @@ exports[`ActionModal should show the action modal when user has logged in with l > +
+ + close + +
+
@@ -1198,6 +1375,17 @@ exports[`ActionModal should show the action modal when user hasn't logged in 1`] > +
+ + close + +
+
@@ -1259,6 +1447,17 @@ exports[`ActionModal shows a feature unavailable message 1`] = ` > +
+ + close + +
+
diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/DelegationModal.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/DelegationModal.spec.js.snap index 26aa2d9e3b..18605c3691 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/DelegationModal.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/DelegationModal.spec.js.snap @@ -2,13 +2,13 @@ exports[`DelegationModal should display the delegation modal form 1`] = ` @@ -20,9 +20,9 @@ exports[`DelegationModal should display the delegation modal form 1`] = ` > - It will take 21 days to unlock your tokens after a delegation and - there is a risk that some tokens will be lost depending on the - behaviour of the validator. + It will take 21 days to unlock your tokens after they are staked. + There is a risk that some tokens will be lost depending on the + behaviour of the validator you choose.
@@ -37,7 +37,7 @@ exports[`DelegationModal should display the delegation modal form 1`] = ` id="to" readonly="" type="text" - value="cosmosvaladdr12324536463" + value="undefined - cosmosvaladdr…osvaladdr12324536463" /> @@ -52,7 +52,7 @@ exports[`DelegationModal should display the delegation modal form 1`] = ` > - Available to Delegate - : + Available to stake: 1000 STAKEs diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalDeposit.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalDeposit.spec.js.snap index 6a6483c43f..8127e7c621 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalDeposit.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalDeposit.spec.js.snap @@ -2,8 +2,8 @@ exports[`ModalDeposit should display deposit modal form 1`] = ` diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalPropose.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalPropose.spec.js.snap index 439bf93868..5d737d0a19 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalPropose.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalPropose.spec.js.snap @@ -2,12 +2,12 @@ exports[`ModalPropose should display proposal modal form 1`] = ` @@ -18,7 +18,6 @@ exports[`ModalPropose should display proposal modal form 1`] = ` > @@ -36,7 +35,6 @@ exports[`ModalPropose should display proposal modal form 1`] = ` @@ -59,8 +57,8 @@ exports[`ModalPropose should display proposal modal form 1`] = ` diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalVote.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalVote.spec.js.snap index ceeb37d7dd..96551ab502 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalVote.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalVote.spec.js.snap @@ -4,6 +4,7 @@ exports[`ModalVote should display vote modal form 1`] = ` @@ -67,6 +68,7 @@ exports[`SendModal should display send modal form 1`] = ` exports[`SendModal validation should show address required error 1`] = ` @@ -138,6 +140,7 @@ exports[`SendModal validation should show address required error 1`] = ` exports[`SendModal validation should show bech32 error when address length is too long 1`] = ` @@ -209,6 +212,7 @@ exports[`SendModal validation should show bech32 error when address length is to exports[`SendModal validation should show bech32 error when address length is too short 1`] = ` @@ -279,6 +283,7 @@ exports[`SendModal validation should show bech32 error when address length is to exports[`SendModal validation should show bech32 error when alphanumeric is wrong 1`] = ` diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/UndelegationModal.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/UndelegationModal.spec.js.snap index 71525ec61b..cbc137424f 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/UndelegationModal.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/UndelegationModal.spec.js.snap @@ -4,11 +4,12 @@ exports[`UndelegationModal should display undelegation modal form 1`] = ` @@ -20,15 +21,9 @@ exports[`UndelegationModal should display undelegation modal form 1`] = ` > - Undelegations take 21 days to complete and cannot be undone. Please - make sure you understand the rules of delegation. Would you prefer to - - - redelegate? - + Unstaking takes 21 days to complete and cannot be undone. Please make + sure you understand the rules of staking. +
@@ -42,10 +37,25 @@ exports[`UndelegationModal should display undelegation modal form 1`] = ` id="from" readonly="" type="text" - value="cosmosvaladdr15ky9du8a2wlstz6fpx3p4mqpjyrm5ctplpn3au" + value="undefined - cosmosvaladdr…3p4mqpjyrm5ctplpn3au" /> + + + + + + @@ -76,7 +86,7 @@ exports[`UndelegationModal should display undelegation modal form 1`] = ` class="form-message" > - Currently Delegated: 1000 STAKEs + Currently staked: 1000 STAKEs diff --git a/tests/unit/specs/components/common/ModalTutorial.spec.js b/tests/unit/specs/components/common/ModalTutorial.spec.js new file mode 100644 index 0000000000..a276777ff3 --- /dev/null +++ b/tests/unit/specs/components/common/ModalTutorial.spec.js @@ -0,0 +1,86 @@ +import { shallowMount, createLocalVue } from "@vue/test-utils" +import ModalTutorial from "common/ModalTutorial" +import { focusParentLast } from "src/directives" + +let localVue = createLocalVue() +localVue.directive("focus-last", focusParentLast) + +global.window = Object.create(window) +window.open = jest.fn() + +describe(`TmModal`, () => { + let wrapper + let mockCloseFn + + beforeEach(() => { + mockCloseFn = jest.fn() + wrapper = shallowMount(ModalTutorial, { + localVue, + propsData: { + close: mockCloseFn, + fullguide: "https://lunie.io", + steps: [ + { + title: "How to get tokens?", + // Each content array element will be enclosed in a span (newline) + content: [ + "Praesent vitae tristique erat.", + "Integer ullamcorper ligula vel dolor sagittis nec fermentum risus pharetra.", + "Nulla mollis tempus sem, a sollicitudin est facilisis ac." + ] + }, + { + title: "How to get tokens?", + content: [ + "Praesent vitae tristique erat.", + "Integer ullamcorper ligula vel dolor sagittis nec fermentum risus pharetra.", + "Nulla mollis tempus sem, a sollicitudin est facilisis ac." + ] + }, + { + title: "How to get tokens?", + content: [ + "Praesent vitae tristique erat.", + "Integer ullamcorper ligula vel dolor sagittis nec fermentum risus pharetra.", + "Nulla mollis tempus sem, a sollicitudin est facilisis ac." + ] + }, + { + title: "How to get tokens?", + content: [ + "Praesent vitae tristique erat.", + "Integer ullamcorper ligula vel dolor sagittis nec fermentum risus pharetra.", + "Nulla mollis tempus sem, a sollicitudin est facilisis ac." + ] + } + ] + } + }) + }) + + it(`has the expected html structure`, () => { + expect(wrapper.element).toMatchSnapshot() + }) + + it(`should go next step`, () => { + wrapper.vm.nextLink() + expect(wrapper.vm.currentStep).toBe(2) + }) + + it(`should go prev step`, () => { + wrapper.vm.currentStep = 2 + wrapper.vm.prevLink() + expect(wrapper.vm.currentStep).toBe(1) + }) + + it(`should go to target URL in the last step`, () => { + wrapper.vm.currentStep = 4 + wrapper.vm.nextLink() + expect(window.open).toBeCalled() + }) + + it(`should close with escape key`, () => { + wrapper.trigger("keyup.esc") + expect(mockCloseFn).toBeCalled() + }) +}) diff --git a/tests/unit/specs/components/common/TmSessionExplore.spec.js b/tests/unit/specs/components/common/TmSessionExplore.spec.js index 68d0d38820..b497b70253 100644 --- a/tests/unit/specs/components/common/TmSessionExplore.spec.js +++ b/tests/unit/specs/components/common/TmSessionExplore.spec.js @@ -107,4 +107,28 @@ describe(`TmSessionExplore`, () => { sessionType: `explore` }) }) + + it(`returns "true" if receives a correct Ethereum address all in small caps`, () => { + const ethereumAddress = `0x010afb8548a5d1a3a3d62f58ca0a5a1329974206` + const check = TmSessionExplore.methods.isEthereumAddress(ethereumAddress) + expect(check).toBe(true) + }) + + it(`returns "true" if receives a correct Ethereum address all in big caps`, () => { + const ethereumAddress = `0x010AFB8548A5D1A3A3D62F58CA0A5A1329974206` + const check = TmSessionExplore.methods.isEthereumAddress(ethereumAddress) + expect(check).toBe(true) + }) + + it(`returns "false" if receives an incorrect Ethereum address`, () => { + const ethereumAddress = `0x010AFB8548A5D1A3A3D62F58` + const check = TmSessionExplore.methods.isEthereumAddress(ethereumAddress) + expect(check).toBe(false) + }) + + it(`returns "true" if receives a checksummed Ethereum address`, () => { + const ethereumAddress = `0x28f4961F8b06F7361A1efD5E700DE717b1db5292` + const check = TmSessionExplore.methods.isEthereumAddress(ethereumAddress) + expect(check).toBe(true) + }) }) diff --git a/tests/unit/specs/components/common/TmSessionHardware.spec.js b/tests/unit/specs/components/common/TmSessionHardware.spec.js index 02441bd274..f846d46854 100644 --- a/tests/unit/specs/components/common/TmSessionHardware.spec.js +++ b/tests/unit/specs/components/common/TmSessionHardware.spec.js @@ -8,7 +8,7 @@ localVue.use(Vuex) localVue.use(Vuelidate) localVue.directive(`tooltip`, () => {}) localVue.directive(`focus`, () => {}) -localVue.directive('clipboard', () => {}) +localVue.directive("clipboard", () => {}) describe(`TmSessionHardware`, () => { let wrapper, store diff --git a/tests/unit/specs/components/common/TmSessionImportName.spec.js b/tests/unit/specs/components/common/TmSessionImportName.spec.js index 97dd2608c9..186dbccd35 100644 --- a/tests/unit/specs/components/common/TmSessionImportName.spec.js +++ b/tests/unit/specs/components/common/TmSessionImportName.spec.js @@ -19,7 +19,8 @@ describe(`TmSessionImportName`, () => { beforeEach(() => { getters = { - connected: () => true + connected: () => true, + network: "fabo-net" } $store = { state: { diff --git a/tests/unit/specs/components/common/TmSessionImportPassword.spec.js b/tests/unit/specs/components/common/TmSessionImportPassword.spec.js index cd329df6fd..2a976fc21b 100644 --- a/tests/unit/specs/components/common/TmSessionImportPassword.spec.js +++ b/tests/unit/specs/components/common/TmSessionImportPassword.spec.js @@ -13,7 +13,9 @@ describe(`TmSessionImportPassword`, () => { let wrapper, $store, getters beforeEach(() => { - getters = {} + getters = { + network: "fabo-net" + } $store = { state: { recover: { @@ -86,7 +88,8 @@ describe(`TmSessionImportPassword`, () => { expect($store.dispatch).toHaveBeenCalledWith(`createKey`, { name: ``, password: `1234567890`, - seedPhrase: `` + seedPhrase: ``, + network: "fabo-net" }) }) @@ -97,13 +100,6 @@ describe(`TmSessionImportPassword`, () => { expect(wrapper.vm.$router.push).toHaveBeenCalledWith(`/`) }) - it(`should dispatch resetRecoverData when submit the form`, async () => { - wrapper.vm.$store.state.recover.password = `1234567890` - wrapper.vm.$store.state.recover.passwordConfirm = `1234567890` - await wrapper.vm.onSubmit() - expect($store.dispatch).toHaveBeenCalledWith(`resetRecoverData`) - }) - it(`should show error on createKey dispatch error`, async () => { wrapper.vm.$store.state.recover.password = `1234567890` wrapper.vm.$store.state.recover.passwordConfirm = `1234567890` @@ -114,10 +110,8 @@ describe(`TmSessionImportPassword`, () => { expect(wrapper.vm.error).toBe(true) }) - it(`should dispatch resetRecoverData when submit the form`, async () => { - wrapper.vm.$store.state.recover.password = `1234567890` - wrapper.vm.$store.state.recover.passwordConfirm = `1234567890` - await wrapper.vm.onSubmit() + it(`should dispatch resetRecoverData when the component is destroyed`, async () => { + wrapper.destroy() expect($store.dispatch).toHaveBeenCalledWith(`resetRecoverData`) }) }) diff --git a/tests/unit/specs/components/common/TmSessionSignUpSeed.spec.js b/tests/unit/specs/components/common/TmSessionSignUpSeed.spec.js index a65df281f0..b32ee1be03 100644 --- a/tests/unit/specs/components/common/TmSessionSignUpSeed.spec.js +++ b/tests/unit/specs/components/common/TmSessionSignUpSeed.spec.js @@ -10,6 +10,9 @@ describe(`TmSessionSignUpSeed`, () => { beforeEach(() => { $store = { + getters: { + network: "fabo-net" + }, state: { session: { insecureMode: true }, signup: { @@ -64,18 +67,15 @@ describe(`TmSessionSignUpSeed`, () => { expect($store.dispatch).toHaveBeenCalledWith(`createKey`, { name: "HappyLunieUser", password: "1234567890", + network: "fabo-net", seedPhrase: "asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf" }) expect(wrapper.vm.$router.push).toHaveBeenCalledWith(`/`) }) - it(`should dispatch resetSignUpData if form is submitted`, async () => { - wrapper.vm.$store.state.signup.signUpSeed = `asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf` - wrapper.vm.$store.state.signup.signUpPassword = `1234567890` - wrapper.vm.$store.state.signup.signUpName = `HappyLunieUser` - wrapper.vm.$store.state.signup.signUpWarning = true - await wrapper.vm.onSubmit() + it(`should dispatch resetSignUpData when the component is destroyed`, async () => { + wrapper.destroy() expect($store.dispatch).toHaveBeenCalledWith(`resetSignUpData`) }) diff --git a/tests/unit/specs/components/common/__snapshots__/FeatureNotAvailable.spec.js.snap b/tests/unit/specs/components/common/__snapshots__/FeatureNotAvailable.spec.js.snap index 144bef5c84..82f87fd82d 100644 --- a/tests/unit/specs/components/common/__snapshots__/FeatureNotAvailable.spec.js.snap +++ b/tests/unit/specs/components/common/__snapshots__/FeatureNotAvailable.spec.js.snap @@ -21,7 +21,7 @@ exports[`FeatureNotAvailable shows a warning about a feature not being available class="tm-data-msg__title" >
- Spacetravel not yet available + Feature not available
@@ -30,12 +30,18 @@ exports[`FeatureNotAvailable shows a warning about a feature not being available >
- ¯\\_(ツ)_/¯ + This feature hasn't been implemented on this network yet. +
- - This feature is not supported in Lunie yet. Reach out if you'd like to see - support for this feature added to Lunie soon. - + +
+ + + Reach out if you'd like us to enable this feature. +
diff --git a/tests/unit/specs/components/common/__snapshots__/ModalTutorial.spec.js.snap b/tests/unit/specs/components/common/__snapshots__/ModalTutorial.spec.js.snap new file mode 100644 index 0000000000..7d5d22e41b --- /dev/null +++ b/tests/unit/specs/components/common/__snapshots__/ModalTutorial.spec.js.snap @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TmModal has the expected html structure 1`] = ` + +`; diff --git a/tests/unit/specs/components/common/__snapshots__/PageFeatureNotAvailable.spec.js.snap b/tests/unit/specs/components/common/__snapshots__/PageFeatureNotAvailable.spec.js.snap index 80d396c108..5192a78a06 100644 --- a/tests/unit/specs/components/common/__snapshots__/PageFeatureNotAvailable.spec.js.snap +++ b/tests/unit/specs/components/common/__snapshots__/PageFeatureNotAvailable.spec.js.snap @@ -32,7 +32,7 @@ exports[`PageFeatureNotAvailable shows a warning about a feature not being avail class="tm-data-msg__title" >
- Spacetravel not yet available + Feature not available
@@ -41,12 +41,18 @@ exports[`PageFeatureNotAvailable shows a warning about a feature not being avail >
- ¯\\_(ツ)_/¯ + This feature hasn't been implemented on this network yet. +
- - This feature is not supported in Lunie yet. Reach out if you'd like to see - support for this feature added to Lunie soon. - + +
+ + + Reach out if you'd like us to enable this feature. +
diff --git a/tests/unit/specs/components/governance/PageProposals.spec.js b/tests/unit/specs/components/governance/PageProposals.spec.js index 8255b7c60b..cab7feb219 100644 --- a/tests/unit/specs/components/governance/PageProposals.spec.js +++ b/tests/unit/specs/components/governance/PageProposals.spec.js @@ -56,6 +56,9 @@ describe(`PageProposals`, () => { }) it(`opens a create proposal modal`, () => { + wrapper.setData({ + loaded: true + }) const $refs = { modalPropose: { open: jest.fn() } } wrapper.vm.$refs = $refs wrapper.find("#propose-btn").trigger("click") diff --git a/tests/unit/specs/components/governance/__snapshots__/PageProposals.spec.js.snap b/tests/unit/specs/components/governance/__snapshots__/PageProposals.spec.js.snap index da85fc9fc5..ff935475f3 100644 --- a/tests/unit/specs/components/governance/__snapshots__/PageProposals.spec.js.snap +++ b/tests/unit/specs/components/governance/__snapshots__/PageProposals.spec.js.snap @@ -4,19 +4,12 @@ exports[`PageProposals shows a message if still loading 1`] = ` -
- -
+ -
- -
+ -
- -
+ { wrapper.find(".select-network-item.selected").trigger("click") expect(wrapper.vm.$store.dispatch).not.toHaveBeenCalledWith() }) - - it(`shows windows about switching networks`, async () => { - wrapper.setData({ - session: { - signedIn: true - } - }) - const spy = jest.spyOn(window, `confirm`).mockImplementationOnce(() => {}) - wrapper.find(".select-network-item:not(.selected)").trigger("click") - expect(spy).toHaveBeenCalled() - spy.mockRestore() - }) }) diff --git a/tests/unit/specs/components/transactions/message-view/__snapshots__/BeginRedelegateMessageDetails.spec.js.snap b/tests/unit/specs/components/transactions/message-view/__snapshots__/BeginRedelegateMessageDetails.spec.js.snap index 395e216f51..73f112aa85 100644 --- a/tests/unit/specs/components/transactions/message-view/__snapshots__/BeginRedelegateMessageDetails.spec.js.snap +++ b/tests/unit/specs/components/transactions/message-view/__snapshots__/BeginRedelegateMessageDetails.spec.js.snap @@ -21,7 +21,7 @@ exports[`BeginRedelegateMessageDetails renders a redelegate transaction message diff --git a/tests/unit/specs/components/transactions/message-view/__snapshots__/CreateValidatorMessageDetails.spec.js.snap b/tests/unit/specs/components/transactions/message-view/__snapshots__/CreateValidatorMessageDetails.spec.js.snap index 5031c8c6e6..6d936bce84 100644 --- a/tests/unit/specs/components/transactions/message-view/__snapshots__/CreateValidatorMessageDetails.spec.js.snap +++ b/tests/unit/specs/components/transactions/message-view/__snapshots__/CreateValidatorMessageDetails.spec.js.snap @@ -21,7 +21,7 @@ exports[`CreateValidatorMessageDetails renders a create validator transaction me diff --git a/tests/unit/specs/components/transactions/message-view/__snapshots__/DelegateMessageDetails.spec.js.snap b/tests/unit/specs/components/transactions/message-view/__snapshots__/DelegateMessageDetails.spec.js.snap index 7b90c8d2c1..b6fb4ba520 100644 --- a/tests/unit/specs/components/transactions/message-view/__snapshots__/DelegateMessageDetails.spec.js.snap +++ b/tests/unit/specs/components/transactions/message-view/__snapshots__/DelegateMessageDetails.spec.js.snap @@ -21,7 +21,7 @@ exports[`DelegateMessageDetails renders a redelegate transaction message 1`] = ` diff --git a/tests/unit/specs/components/transactions/message-view/__snapshots__/EditValidatorMessageDetails.spec.js.snap b/tests/unit/specs/components/transactions/message-view/__snapshots__/EditValidatorMessageDetails.spec.js.snap index 9f4d6e9092..12c0ed3cd2 100644 --- a/tests/unit/specs/components/transactions/message-view/__snapshots__/EditValidatorMessageDetails.spec.js.snap +++ b/tests/unit/specs/components/transactions/message-view/__snapshots__/EditValidatorMessageDetails.spec.js.snap @@ -21,7 +21,7 @@ exports[`EditValidatorMessageDetails renders a edit validator transaction messag diff --git a/tests/unit/specs/components/transactions/message-view/__snapshots__/UndelegateMessageDetails.spec.js.snap b/tests/unit/specs/components/transactions/message-view/__snapshots__/UndelegateMessageDetails.spec.js.snap index 2253b7a655..f5e27072c1 100644 --- a/tests/unit/specs/components/transactions/message-view/__snapshots__/UndelegateMessageDetails.spec.js.snap +++ b/tests/unit/specs/components/transactions/message-view/__snapshots__/UndelegateMessageDetails.spec.js.snap @@ -21,7 +21,7 @@ exports[`UndelegateMessageDetails renders a undelegate transaction message 1`] = diff --git a/tests/unit/specs/components/transactions/message-view/__snapshots__/UnjailMessageDetails.spec.js.snap b/tests/unit/specs/components/transactions/message-view/__snapshots__/UnjailMessageDetails.spec.js.snap index ae5cf54a9b..42b39cb4ee 100644 --- a/tests/unit/specs/components/transactions/message-view/__snapshots__/UnjailMessageDetails.spec.js.snap +++ b/tests/unit/specs/components/transactions/message-view/__snapshots__/UnjailMessageDetails.spec.js.snap @@ -21,7 +21,7 @@ exports[`UnjailMessageDetails renders a unjail validator transaction message 1`] cosmos…7pyr diff --git a/tests/unit/specs/components/transactions/message-view/__snapshots__/WithdrawDelegationRewardMessageDetails.spec.js.snap b/tests/unit/specs/components/transactions/message-view/__snapshots__/WithdrawDelegationRewardMessageDetails.spec.js.snap index 5dda54c113..26eb1da48d 100644 --- a/tests/unit/specs/components/transactions/message-view/__snapshots__/WithdrawDelegationRewardMessageDetails.spec.js.snap +++ b/tests/unit/specs/components/transactions/message-view/__snapshots__/WithdrawDelegationRewardMessageDetails.spec.js.snap @@ -22,7 +22,7 @@ exports[`WithdrawalDelegationRewardMessageDetails renders a withdraw delegation @@ -55,7 +55,7 @@ exports[`WithdrawalDelegationRewardMessageDetails renders a withdraw delegation diff --git a/tests/unit/specs/components/wallet/PagePortfolio.spec.js b/tests/unit/specs/components/wallet/PagePortfolio.spec.js index 51b6c4c772..899218dfff 100644 --- a/tests/unit/specs/components/wallet/PagePortfolio.spec.js +++ b/tests/unit/specs/components/wallet/PagePortfolio.spec.js @@ -2,10 +2,25 @@ import PagePortfolio from "wallet/PagePortfolio" import { shallowMount } from "@vue/test-utils" describe(`PagePortfolio`, () => { - let wrapper + let wrapper, $store + + const state = { + session: { experimentalMode: false } + } + + beforeEach(() => { + $store = { + state + } + + wrapper = shallowMount(PagePortfolio, { + mocks: { + $store + } + }) + }) it("should display the portfolio page", async () => { - wrapper = shallowMount(PagePortfolio) expect(wrapper.element).toMatchSnapshot() }) }) diff --git a/tests/unit/specs/components/wallet/__snapshots__/PagePortfolio.spec.js.snap b/tests/unit/specs/components/wallet/__snapshots__/PagePortfolio.spec.js.snap index 633f771560..fad13fbbee 100644 --- a/tests/unit/specs/components/wallet/__snapshots__/PagePortfolio.spec.js.snap +++ b/tests/unit/specs/components/wallet/__snapshots__/PagePortfolio.spec.js.snap @@ -11,6 +11,8 @@ exports[`PagePortfolio should display the portfolio page 1`] = ` + +
`; diff --git a/tests/unit/specs/store/keystore.spec.js b/tests/unit/specs/store/keystore.spec.js index 3db618da8b..ff8033b2f1 100644 --- a/tests/unit/specs/store/keystore.spec.js +++ b/tests/unit/specs/store/keystore.spec.js @@ -101,7 +101,8 @@ describe(`Module: Keystore`, () => { { seedPhrase, password, - name + name, + network: "cosmos-hub-mainnet" } ) expect(dispatch).toHaveBeenCalledWith(`signIn`, { @@ -121,7 +122,8 @@ describe(`Module: Keystore`, () => { { seedPhrase, password, - name + name, + network: "cosmos-hub-mainnet" } ) expect(dispatch).toHaveBeenCalledWith(`loadAccounts`) @@ -137,7 +139,8 @@ describe(`Module: Keystore`, () => { { seedPhrase, password, - name + name, + network: "cosmos-hub-mainnet" } ) expect(dispatch).toHaveBeenCalledWith(`signIn`, { @@ -145,4 +148,23 @@ describe(`Module: Keystore`, () => { sessionType: "local" }) }) + + it("should handle networks not being supported for account creation (as a fallback)", async () => { + const seedPhrase = `abc` + const password = `123` + const name = `def` + await expect( + actions.createKey( + { state }, + { + seedPhrase, + password, + name, + network: "fabo-net" + } + ) + ).rejects.toThrowError( + "Lunie doesn't support address creation for this network." + ) + }) }) diff --git a/tests/unit/specs/store/session.spec.js b/tests/unit/specs/store/session.spec.js index 0deb6fede5..45cb43d637 100644 --- a/tests/unit/specs/store/session.spec.js +++ b/tests/unit/specs/store/session.spec.js @@ -114,7 +114,14 @@ describe(`Module: Session`, () => { const sessionType = `local` const address = `cosmos15ky9du8a2wlstz6fpx3p4mqpjyrm5ctpesxxn9` await actions.signIn( - { state, commit, dispatch }, + { + state, + commit, + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }, { address, sessionType } ) expect(commit).toHaveBeenCalledWith( @@ -135,7 +142,14 @@ describe(`Module: Session`, () => { const commit = jest.fn() const dispatch = jest.fn() await actions.signIn( - { state, commit, dispatch }, + { + state, + commit, + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }, { sessionType: `ledger`, address } ) expect(commit).toHaveBeenCalledWith(`setUserAddress`, address) @@ -153,7 +167,14 @@ describe(`Module: Session`, () => { const commit = jest.fn() const dispatch = jest.fn() await actions.signIn( - { state, commit, dispatch }, + { + state, + commit, + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }, { sessionType: `explore`, address } ) expect(commit).toHaveBeenCalledWith(`setUserAddress`, address) @@ -172,7 +193,14 @@ describe(`Module: Session`, () => { const dispatch = jest.fn() state.signedIn = true await actions.signIn( - { state, commit, dispatch }, + { + state, + commit, + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }, { sessionType: `explore`, address } ) @@ -195,7 +223,14 @@ describe(`Module: Session`, () => { } ] await actions.signIn( - { state, commit, dispatch }, + { + state, + commit, + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }, { sessionType: `explore`, address } ) expect(dispatch).toHaveBeenCalledWith(`persistAddresses`, { @@ -212,7 +247,8 @@ describe(`Module: Session`, () => { }) expect(dispatch).toHaveBeenCalledWith(`persistSession`, { address: `cosmos1z8mzakma7vnaajysmtkwt4wgjqr2m84tzvyfkz`, - sessionType: `explore` + sessionType: `explore`, + networkId: "fabo-net" }) expect(dispatch).toHaveBeenCalledWith(`rememberAddress`, { address: `cosmos1z8mzakma7vnaajysmtkwt4wgjqr2m84tzvyfkz`, @@ -384,8 +420,11 @@ describe(`Module: Session`, () => { describe(`persistance`, () => { it(`persists the session in localstorage`, async () => { - await actions.persistSession({}, { address: `xxx`, sessionType: `local` }) - expect(localStorage.getItem(`session`)).toEqual( + await actions.persistSession( + {}, + { address: `xxx`, sessionType: `local`, networkId: "fabo-net" } + ) + expect(localStorage.getItem(`session_fabo-net`)).toEqual( JSON.stringify({ address: `xxx`, sessionType: `local` @@ -396,7 +435,14 @@ describe(`Module: Session`, () => { it(`persists the session on sign in`, async () => { const dispatch = jest.fn() await actions.signIn( - { state, commit: jest.fn(), dispatch }, + { + state, + commit: jest.fn(), + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }, { address: `cosmos15ky9du8a2wlstz6fpx3p4mqpjyrm5ctpesxxn9`, sessionType: `local` @@ -404,12 +450,20 @@ describe(`Module: Session`, () => { ) expect(dispatch).toHaveBeenCalledWith(`persistSession`, { address: `cosmos15ky9du8a2wlstz6fpx3p4mqpjyrm5ctpesxxn9`, - sessionType: `local` + sessionType: `local`, + networkId: "fabo-net" }) dispatch.mockClear() await actions.signIn( - { state, commit: jest.fn(), dispatch }, + { + state, + commit: jest.fn(), + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }, { address: `cosmos15ky9du8a2wlstz6fpx3p4mqpjyrm5ctpesxxn9`, sessionType: `ledger` @@ -417,28 +471,39 @@ describe(`Module: Session`, () => { ) expect(dispatch).toHaveBeenCalledWith(`persistSession`, { address: `cosmos15ky9du8a2wlstz6fpx3p4mqpjyrm5ctpesxxn9`, - sessionType: `ledger` + sessionType: `ledger`, + networkId: "fabo-net" }) }) it(`signs the user in if a session was found`, async () => { const dispatch = jest.fn() localStorage.setItem( - `session`, + `session_fabo-net`, JSON.stringify({ address: `xxx`, sessionType: `local` }) ) - await actions.checkForPersistedSession({ dispatch }) + await actions.checkForPersistedSession({ + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }) expect(dispatch).toHaveBeenCalledWith(`signIn`, { address: `xxx`, sessionType: `local` }) dispatch.mockClear() - localStorage.removeItem(`session`) - await actions.checkForPersistedSession({ dispatch }) + localStorage.removeItem(`session_fabo-net`) + await actions.checkForPersistedSession({ + dispatch, + rootState: { + connection: { network: "fabo-net" } + } + }) expect(dispatch).not.toHaveBeenCalled() }) }) diff --git a/yarn.lock b/yarn.lock index 58d0ebeef5..8c58b122aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -831,14 +831,22 @@ resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-4.72.0.tgz#43df23af013ad1135407e5cf33ca6e4c4c7708d5" integrity sha512-o+TYF8vBcyySRsb2kqBDv/KMeme8a2nwWoG+lAWzbDmWfb2/MrVWYCVYDYvjXdSoI/Cujqy1i0gIDrkdxa9chA== -"@lunie/cosmos-keys@0.0.11": - version "0.0.11" - resolved "https://registry.yarnpkg.com/@lunie/cosmos-keys/-/cosmos-keys-0.0.11.tgz#694bcdd1b3106dfbe3078a9a8435de8428c030f9" - integrity sha512-iqxHMYAeqxRTo+qGdDJaBDxeMqH/2Zmtre0NgmKbfrL2pz1VTn8+mcx7cJPBpU3GtGBFSDsywWeK+ukIOa88pA== +"@lunie/cosmos-api@0.2.5": + version "0.2.5" + resolved "https://registry.yarnpkg.com/@lunie/cosmos-api/-/cosmos-api-0.2.5.tgz#77bf93a14a9a68eabffa99d07f9e6c297a26fd19" + integrity sha512-4p2lNr1ByYeVGGQwKkp+BdK8fI5yZwOYNoDfFSOpJ80ybQeOF8ox5jTRZrWOetEP47fqBZA0Gv5jt5tTtJWW2A== + dependencies: + "@babel/runtime" "^7.5.4" + axios "^0.19.0" + +"@lunie/cosmos-keys@0.0.12": + version "0.0.12" + resolved "https://registry.yarnpkg.com/@lunie/cosmos-keys/-/cosmos-keys-0.0.12.tgz#686ba1a9121920c0c1c11b1d01dc0ba23ed4408e" + integrity sha512-djYRP/t23DE/1uQBe9LSXy0HZQ5alXWTEGyxKEolWF03FzODaZNIGn27EeUHhWOgyYzXg0KeOyXw438RNJKX+Q== dependencies: bech32 "^1.1.3" - bip32 "^1.0.4" - bip39 "^3.0.1" + bip32 "^2.0.4" + bip39 "^3.0.2" crypto-js "^3.1.9-1" secp256k1 "^3.6.2" @@ -965,6 +973,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.14.tgz#1c1d6e3c75dba466e0326948d56e8bd72a1903d2" integrity sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA== +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + "@types/node@11.11.6": version "11.11.6" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" @@ -2400,19 +2413,20 @@ bindings@^1.3.0, bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bip32@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/bip32/-/bip32-1.0.4.tgz#188ad57a45fb1342c9aabe969d0612c704a987b4" - integrity sha512-8T21eLWylZETolyqCPgia+MNp+kY37zFr7PTFDTPObHeNi9JlfG4qGIh8WzerIJidtwoK+NsWq2I5i66YfHoIw== +bip32@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.4.tgz#b662bd28710d4676fb351ba8a13be45cb4d85d01" + integrity sha512-ioPytarPDIrWckWMuK4RNUtvwhvWEc2fvuhnO0WEwu732k5OLjUXv4rXi2c/KJHw9ZMNQMkYRJrBw81RujShGQ== dependencies: + "@types/node" "10.12.18" bs58check "^2.1.1" create-hash "^1.2.0" create-hmac "^1.1.7" - tiny-secp256k1 "^1.0.0" + tiny-secp256k1 "^1.1.0" typeforce "^1.11.5" wif "^2.0.6" -bip39@^3.0.1: +bip39@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== @@ -2434,7 +2448,12 @@ bluebird@^3.1.1, bluebird@^3.5.1, bluebird@^3.5.5: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.8, bn.js@^4.4.0: +bn.js@4.11.6: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + integrity sha1-UzRK2xRhehP26N0s4okF0cC6MhU= + +bn.js@4.11.8, bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== @@ -2620,6 +2639,11 @@ buffer-indexof@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c" integrity sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g== +buffer-to-arraybuffer@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" + integrity sha1-YGSkD6dutDxyOrqe+PbhIW0QURo= + buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" @@ -3908,6 +3932,13 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + dependencies: + mimic-response "^1.0.0" + deep-eql@0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" @@ -4167,6 +4198,11 @@ dom-serializer@~0.1.0: domelementtype "^1.3.0" entities "^1.1.1" +dom-walk@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" + integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg= + domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" @@ -4648,6 +4684,30 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +eth-lib@0.2.7: + version "0.2.7" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" + integrity sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco= + dependencies: + bn.js "^4.11.6" + elliptic "^6.4.0" + xhr-request-promise "^0.1.2" + +ethereum-bloom-filters@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.6.tgz#9cdebb3ec20de96ec4a434c6bad6ea5a513037aa" + integrity sha512-dE9CGNzgOOsdh7msZirvv8qjHtnHpvBlKe2647kM8v+yeF71IRso55jpojemvHV+jMjr48irPWxMRaHuOWzAFA== + dependencies: + js-sha3 "^0.8.0" + +ethjs-unit@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" + integrity sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk= + dependencies: + bn.js "4.11.6" + number-to-bn "1.7.0" + event-pubsub@4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/event-pubsub/-/event-pubsub-4.3.0.tgz#f68d816bc29f1ec02c539dc58c8dd40ce72cb36e" @@ -5483,6 +5543,14 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" +global@~4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" + integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8= + dependencies: + min-document "^2.19.0" + process "~0.5.1" + globals@^11.0.1, globals@^11.1.0, globals@^11.7.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -6448,6 +6516,11 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-function@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" + integrity sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU= + is-generator-fn@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" @@ -6474,6 +6547,11 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= + is-hexadecimal@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.3.tgz#e8a426a69b6d31470d3a33a47bb825cda02506ee" @@ -7152,6 +7230,11 @@ js-queue@2.0.0: dependencies: easy-stack "^1.0.0" +js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -8051,6 +8134,18 @@ mimic-fn@^2.0.0, mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +min-document@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= + dependencies: + dom-walk "^0.1.0" + mini-css-extract-plugin@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.8.0.tgz#81d41ec4fe58c713a96ad7c723cdb2d0bd4d70e1" @@ -8556,6 +8651,14 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= +number-to-bn@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" + integrity sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA= + dependencies: + bn.js "4.11.6" + strip-hex-prefix "1.0.0" + numeral@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/numeral/-/numeral-2.0.6.tgz#4ad080936d443c2561aed9f2197efffe25f4e506" @@ -8985,6 +9088,11 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" +parse-headers@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.3.tgz#5e8e7512383d140ba02f0c7aa9f49b4399c92515" + integrity sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA== + parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -9748,6 +9856,11 @@ process@^0.11.10: resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= +process@~0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" + integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= + progress@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" @@ -9905,6 +10018,15 @@ query-string@^4.1.0: object-assign "^4.1.0" strict-uri-encode "^1.0.0" +query-string@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -9930,7 +10052,7 @@ ramda@^0.25.0: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.25.0.tgz#8fdf68231cffa90bc2f9460390a0cb74a29b29a9" integrity sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ== -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== @@ -10658,11 +10780,6 @@ serialize-javascript@>=2.1.1, serialize-javascript@^1.4.0, serialize-javascript@ resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.1.tgz#952907a04a3e3a75af7f73d92d15e233862048b2" integrity sha512-MPLPRpD4FNqWq9tTIjYG5LesFouDhdyH0EPY3gVK4DRD5+g4aDqdNSzLIwceulo3Yj+PL1bPh6laE5+H6LTcrQ== -serialize-javascript@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.1.tgz#952907a04a3e3a75af7f73d92d15e233862048b2" - integrity sha512-MPLPRpD4FNqWq9tTIjYG5LesFouDhdyH0EPY3gVK4DRD5+g4aDqdNSzLIwceulo3Yj+PL1bPh6laE5+H6LTcrQ== - serve-index@^1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" @@ -10780,6 +10897,20 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= +simple-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" + integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= + +simple-get@^2.7.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" + integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== + dependencies: + decompress-response "^3.3.0" + once "^1.3.1" + simple-concat "^1.0.0" + simple-swizzle@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" @@ -11298,6 +11429,13 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= + dependencies: + is-hex-prefixed "1.0.0" + strip-indent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" @@ -11650,6 +11788,11 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== +timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= + timers-browserify@^2.0.4: version "2.0.11" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.11.tgz#800b1f3eee272e5bc53ee465a04d0e804c31211f" @@ -11672,7 +11815,7 @@ tiny-emitter@^2.0.0: resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423" integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q== -tiny-secp256k1@^1.0.0: +tiny-secp256k1@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.3.tgz#e93b1e1bf62e9bd1ad3ab24af27ff6127ce0e077" integrity sha512-ZpobrhOtHP98VYEN51IYQH1YcrbFpnxFhI6ceWa3OEbJn7eHvSd8YFjGPxbedGCy7PNYU1v/+BRsdvyr5uRd4g== @@ -11904,6 +12047,11 @@ uglify-js@^3.1.4: commander "~2.20.3" source-map "~0.6.1" +underscore@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" + integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== + unherit@^1.0.4: version "1.1.2" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.2.tgz#14f1f397253ee4ec95cec167762e77df83678449" @@ -12095,6 +12243,11 @@ url-parse@^1.4.3: querystringify "^2.1.1" requires-port "^1.0.0" +url-set-query@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" + integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= + url@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" @@ -12113,6 +12266,11 @@ user-home@^1.1.1: resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA= +utf8@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" + integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== + util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -12394,6 +12552,20 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web3-utils@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.4.tgz#96832a39a66b05bf8862a5b0bdad2799d709d951" + integrity sha512-+S86Ip+jqfIPQWvw2N/xBQq5JNqCO0dyvukGdJm8fEWHZbckT4WxSpHbx+9KLEWY4H4x9pUwnoRkK87pYyHfgQ== + dependencies: + bn.js "4.11.8" + eth-lib "0.2.7" + ethereum-bloom-filters "^1.0.6" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + underscore "1.9.1" + utf8 "3.0.0" + webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -12822,6 +12994,36 @@ x-is-string@^0.1.0: resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" integrity sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI= +xhr-request-promise@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.2.tgz#343c44d1ee7726b8648069682d0f840c83b4261d" + integrity sha1-NDxE0e53JrhkgGloLQ+EDIO0Jh0= + dependencies: + xhr-request "^1.0.1" + +xhr-request@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" + integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== + dependencies: + buffer-to-arraybuffer "^0.0.5" + object-assign "^4.1.1" + query-string "^5.0.1" + simple-get "^2.7.0" + timed-out "^4.0.1" + url-set-query "^1.0.0" + xhr "^2.0.4" + +xhr@^2.0.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.5.0.tgz#bed8d1676d5ca36108667692b74b316c496e49dd" + integrity sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ== + dependencies: + global "~4.3.0" + is-function "^1.0.1" + parse-headers "^2.0.0" + xtend "^4.0.0" + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"