Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic release created for v1.0.0-beta.43 #2458

Merged
merged 6 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.0.0-beta.43] - 2019-04-16

### Added

- [#2449](https://github.com/cosmos/lunie/pull/2449) added new circle ci badge to readme @jbibla

### Fixed

- [#2431](https://github.com/cosmos/lunie/issues/2431) check for ledger on submit to avoid action modal failures @jbibla
- [#2449](https://github.com/cosmos/lunie/issues/2449) explore mode should not ask for password in action modals @jbibla
- [#0](https://github.com/cosmos/lunie/issues/0) tm connected network still included the word testnet in the language @jbibla
- [#2445](https://github.com/cosmos/lunie/issues/2445) page validator label should be ATOM not uatom @jbibla
- [#2448](https://github.com/cosmos/lunie/issues/2448) proposal description is awkward @jbibla

## [1.0.0-beta.42] - 2019-04-08

### Fixed
Expand Down
5 changes: 1 addition & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Tendermint Basecoin UI
License: Apache2.0

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -189,7 +186,7 @@ License: Apache2.0
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2017 All in Bits, Inc
Copyright 2019 Lunie International Software Systems Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
16 changes: 14 additions & 2 deletions app/src/renderer/components/common/ActionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default {
uatoms
}),
computed: {
...mapGetters([`connected`, `session`, `bondDenom`, `wallet`]),
...mapGetters([`connected`, `session`, `bondDenom`, `wallet`, `ledger`]),
requiresSignIn() {
return !this.session.signedIn
},
Expand Down Expand Up @@ -344,8 +344,13 @@ export default {
}
},
async submit() {
this.submissionError = null
track(`event`, `submit`, this.title, this.selectedSignMethod)

if (!this.ledger.isConnected || !this.ledger.cosmosApp) {
await this.connectLedger()
}

try {
await this.submitFn(
this.gasEstimate,
Expand All @@ -362,7 +367,14 @@ export default {
this.submissionError = null
}, 5000)
}
}
},
async connectLedger() {
try {
await this.$store.dispatch(`connectLedgerApp`)
} catch (error) {
this.submissionError = `${this.submissionErrorPrefix}: ${error}.`
}
},
},
validations() {
return {
Expand Down
2 changes: 1 addition & 1 deletion app/src/renderer/vuex/modules/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default () => {
case `U2F: Timeout`:
throw new Error(`No Ledger found`)
case `Cosmos app does not seem to be open`:
throw new Error(`Cosmos app is not open`)
throw new Error(`Cosmos app is not open on the Ledger`)
case `Unknown error code`: // TODO: create error for screensaver mode
throw new Error(`Ledger's screensaver mode is on`)
case `No errors`:
Expand Down
2 changes: 0 additions & 2 deletions changes/fabo_2435-fix-sending-on-testnet

This file was deleted.

1 change: 0 additions & 1 deletion changes/fabo_fix-signin-state-loading-order

This file was deleted.

5 changes: 0 additions & 5 deletions changes/jordan_2449-password

This file was deleted.

1 change: 0 additions & 1 deletion changes/jordan_cleanup-and-about-page

This file was deleted.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "lunie",
"productName": "lunie",
"version": "1.0.0-beta.42",
"description": "Lunie is a web based user interface for the Cosmos Hub.",
"author": "All In Bits, Inc <hello@tendermint.com>",
"version": "1.0.0-beta.43",
"description": "Lunie is the user interface for the Cosmos Hub.",
"author": "Lunie International Software Systems Inc. <hello@lunie.io>",
"license": "Apache-2.0",
"homepage": "https://lunie.io",
"repository": {
"type": "git",
"url": "git+https://github.com/cosmos/voyager.git"
"url": "git+https://github.com/luniehq/lunie.git"
},
"engines": {
"node": ">=10.13.0"
Expand Down
145 changes: 87 additions & 58 deletions test/unit/specs/components/common/ActionModal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ describe(`ActionModal`, () => {
balances: [
{ denom: `uatom`, amount: `20000000` }
]
},
ledger: {
cosmosApp: {},
isConnected: true
}
}
}
Expand All @@ -45,6 +49,89 @@ describe(`ActionModal`, () => {
wrapper.vm.open()
})

it(`should set the submissionError if the submission is rejected`, async () => {
const submitFn = jest
.fn()
.mockRejectedValue(new Error(`some kind of error message`))
const $store = { dispatch: jest.fn() }
const self = {
$store,
ledger: {
cosmosApp: {},
isConnected: true
},
submitFn,
submissionErrorPrefix: `PREFIX`
}
await ActionModal.methods.submit.call(self)

expect(self.submissionError).toEqual(`PREFIX: some kind of error message.`)
})

it(`should clear the submissionError after a timeout if the function is rejected`, async () => {
jest.useFakeTimers()

const submitFn = jest
.fn()
.mockRejectedValue(new Error(`some kind of error message`))
const $store = { dispatch: jest.fn() }
const self = {
$store,
ledger: {
cosmosApp: {},
isConnected: true
},
submitFn,
submissionErrorPrefix: `PREFIX`
}
await ActionModal.methods.submit.call(self)

jest.runAllTimers()
expect(self.submissionError).toEqual(null)
})

it(`should default to submissionError being null`, () => {
expect(wrapper.vm.submissionError).toBe(null)
})

it(`opens`, () => {
wrapper.vm.track = jest.fn()
wrapper.vm.open()

expect(wrapper.isEmpty()).not.toBe(true)
expect(wrapper.vm.track).toHaveBeenCalled()
})

it(`opens session modal and closes itself`, () => {
const $store = { commit: jest.fn() }
const self = { $store, close: jest.fn() }
ActionModal.methods.goToSession.call(self)
expect(self.close).toHaveBeenCalled()
expect($store.commit).toHaveBeenCalledWith(`setSessionModalView`, `welcome`)
expect($store.commit).toHaveBeenCalledWith(`toggleSessionModal`, true)
})

it(`shows a password input for local signing`, async () => {
wrapper.vm.step = `sign`
expect(wrapper.vm.selectedSignMethod).toBe(`local`)
await wrapper.vm.$nextTick()
expect(wrapper.find(`#password`).exists()).toBe(true)
})

it(`hides password input if signing with Ledger`, async () => {
wrapper.vm.session.sessionType = `ledger`
wrapper.vm.step = `sign`
expect(wrapper.vm.selectedSignMethod).toBe(`ledger`)
expect(wrapper.find(`#password`).exists()).toBe(false)
})

it(`should dispatch connectLedgerApp`, () => {
const $store = { dispatch: jest.fn() }
const self = { $store }
ActionModal.methods.connectLedger.call(self)
expect($store.dispatch).toHaveBeenCalledWith(`connectLedgerApp`)
})

describe(`should show the action modal`, () => {
describe(`when user has logged in`, () => {
describe(`with local keystore`, () => {
Expand Down Expand Up @@ -96,26 +183,6 @@ describe(`ActionModal`, () => {
expect(wrapper.vm.$el).toMatchSnapshot()
})
})
it(`should default to submissionError being null`, () => {
expect(wrapper.vm.submissionError).toBe(null)
})

it(`opens`, () => {
wrapper.vm.track = jest.fn()
wrapper.vm.open()

expect(wrapper.isEmpty()).not.toBe(true)
expect(wrapper.vm.track).toHaveBeenCalled()
})

it(`opens session modal and closes itself`, () => {
const $store = { commit: jest.fn() }
const self = { $store, close: jest.fn() }
ActionModal.methods.goToSession.call(self)
expect(self.close).toHaveBeenCalled()
expect($store.commit).toHaveBeenCalledWith(`setSessionModalView`, `welcome`)
expect($store.commit).toHaveBeenCalledWith(`toggleSessionModal`, true)
})

describe(`close modal`, () => {
it(`closes`, () => {
Expand Down Expand Up @@ -195,7 +262,6 @@ describe(`ActionModal`, () => {
})

describe(`validates password and gas price`, () => {

describe(`success`, () => {
it(`when password is required`, () => {
wrapper.vm.step = `sign`
Expand Down Expand Up @@ -271,29 +337,6 @@ describe(`ActionModal`, () => {
})
})

it(`should set the submissionError if the submission is rejected`, async () => {
const submitFn = jest
.fn()
.mockRejectedValue(new Error(`some kind of error message`))
const self = { submitFn, submissionErrorPrefix: `PREFIX` }
await ActionModal.methods.submit.call(self)

expect(self.submissionError).toEqual(`PREFIX: some kind of error message.`)
})

it(`should clear the submissionError after a timeout if the function is rejected`, async () => {
jest.useFakeTimers()

const submitFn = jest
.fn()
.mockRejectedValue(new Error(`some kind of error message`))
const self = { submitFn, submissionErrorPrefix: `PREFIX` }
await ActionModal.methods.submit.call(self)

jest.runAllTimers()
expect(self.submissionError).toEqual(null)
})

describe(`runs validation and changes step`, () => {
let self, getterValues

Expand Down Expand Up @@ -428,20 +471,6 @@ describe(`ActionModal`, () => {
})
})

it(`shows a password input for local signing`, async () => {
wrapper.vm.step = `sign`
expect(wrapper.vm.selectedSignMethod).toBe(`local`)
await wrapper.vm.$nextTick()
expect(wrapper.find(`#password`).exists()).toBe(true)
})

it(`hides password input if signing with Ledger`, async () => {
wrapper.vm.session.sessionType = `ledger`
wrapper.vm.step = `sign`
expect(wrapper.vm.selectedSignMethod).toBe(`ledger`)
expect(wrapper.find(`#password`).exists()).toBe(false)
})

describe(`selected sign method`, () => {
it(`selects local signed in with account`, () => {
expect(wrapper.vm.selectedSignMethod).toBe(`local`)
Expand Down
Loading