Skip to content

Commit

Permalink
Merge branch 'develop' into fabo/persist-ledger-session-type
Browse files Browse the repository at this point in the history
  • Loading branch information
fedekunze authored Mar 15, 2019
2 parents 9f48f47 + 510ea15 commit 4984770
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 18 deletions.
18 changes: 12 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,28 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.0.0-beta.20] - 2019-03-15

### Fixed

- [\#2273](https://github.com/cosmos/voyager/issues/2273) fixed atoms and uatoms conversion @fedekunze

## [1.0.0-beta.19] - 2019-03-15

### Added

- [\#2263](https://github.com/cosmos/voyager/pull/2263) Added guide on how to connect via a local full node to any network @faboweb

### Fixed

- Fix for inflation on our testnet
- [\#2257](https://github.com/cosmos/voyager/pull/2257) fixed console error on page validator if loading the page from URL @faboweb

### Changed

- [\#1337](https://github.com/cosmos/voyager/issues/1337) refactor unit tests: Page404, ShortBech32 @fedekunze
- [\#2255](https://github.com/cosmos/voyager/pull/2255) removed onboarding tutorial @fedekunze
- [\#2259](https://github.com/cosmos/voyager/issues/2259) removed PagePreferences @fedekunze
- [\#1337](https://github.com/cosmos/voyager/issues/1337) refactor unit tests: Page404, ShortBech32 @fedekunze

### Fixed

- Fix for inflation on our testnet
- [\#2257](https://github.com/cosmos/voyager/pull/2257) fixed console error on page validator if loading the page from URL @faboweb


## [1.0.0-beta.18] - 2019-03-14
Expand Down
7 changes: 6 additions & 1 deletion PENDING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
### Added

- [\#2228](https://github.com/cosmos/voyager/issues/2228) display balances of vesting accounts @faboweb

### Fixed

- Persist session type if signed in with ledger @faboweb
- [\#2257](https://github.com/cosmos/voyager/pull/2257) fixed console
- [\#2269](https://github.com/cosmos/voyager/pull/2269) Persist session type if signed in with ledger @faboweb
- [\#2273](https://github.com/cosmos/voyager/issues/2273) fixed atoms and uatoms conversion @fedekunze
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</div>
<div class="column">
<dl class="info_dl">
<dt>
<dt v-tooltip.top="depositTooltips.max_deposit_period">
Maximum Deposit Period
<i
v-tooltip.top="depositTooltips.max_deposit_period"
Expand Down Expand Up @@ -139,7 +139,7 @@
import { mapGetters } from "vuex"
import { atoms } from "../../scripts/num.js"
export default {
name: `tab-governance-parameters`,
name: `tab-staking-parameters`,
data: () => ({
atoms,
depositTooltips: {
Expand Down
17 changes: 16 additions & 1 deletion app/src/renderer/connectors/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,22 @@ const Client = (axios, remoteLcdURL) => {
}
return req(`GET`, `/auth/accounts/${address}`)()
.then(res => {
return res.value || emptyAccount
// HACK, hope for: https://github.com/cosmos/cosmos-sdk/issues/3885
let account = res.value || emptyAccount
if (res.type === `auth/DelayedVestingAccount`) {
if (!account.BaseVestingAccount) {
console.error(`SDK format of vesting accounts responses has changed`)
return emptyAccount
}
account = Object.assign(
{},
account.BaseVestingAccount.BaseAccount,
account.BaseVestingAccount
)
delete account.BaseAccount
delete account.BaseVestingAccount
}
return account
})
.catch(err => {
// if account not found, return null instead of throwing
Expand Down
2 changes: 1 addition & 1 deletion app/src/renderer/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default [
{
path: `governance-parameters`,
name: `Governance Parameters`,
component: require(`./components/governance/TabGovernanceParameters`).default
component: require(`./components/governance/TabParameters`).default
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cosmos-voyager",
"productName": "Cosmos Voyager",
"version": "1.0.0-beta.19",
"version": "1.0.0-beta.20",
"description": "Voyager is an electron-based user interface for the Cosmos Network.",
"author": "All In Bits, Inc <[email protected]>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -43,7 +43,7 @@
"frontend:fixed-https": "yarn frontend --cert 'server_dev.crt' --key 'server_dev.key'",
"connect": "concurrently -k \"yarn stargate\" \"yarn proxy\"",
"backend:new": "concurrently -k \"yarn connect\" \"yarn nodes 2\"",
"backend": "concurrently -k \"yarn connect\" \"yarn nodes 2 skip-rebuild\"",
"backend": "concurrently -k \"yarn yarn connect\" \"yarn nodes 2 skip-rebuild\"",
"backend:fixed-https": "concurrently -k \"yarn nodes 2 skip-rebuild\" \"yarn stargate --ssl-certfile 'server_dev.crt' --ssl-keyfile 'server_dev.key'\""
},
"devDependencies": {
Expand Down Expand Up @@ -149,4 +149,4 @@
"vuelidate": "0.7.3",
"vuex": "3.0.1"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Vuelidate from "vuelidate"
import setup from "../../../helpers/vuex-setup"
import TabGovernanceParameters from "renderer/components/governance/TabGovernanceParameters"
import TabParameters from "renderer/components/governance/TabParameters"
import lcdClientMock from "renderer/connectors/lcdClientMock.js"

const { governanceParameters, stakingParameters } = lcdClientMock.state

describe(`TabGovernanceParameters`, () => {
describe(`TabParameters`, () => {
let wrapper, store
const { mount, localVue } = setup()
localVue.use(Vuelidate)
Expand All @@ -23,7 +23,7 @@ describe(`TabGovernanceParameters`, () => {
}

beforeEach(() => {
const instance = mount(TabGovernanceParameters, {
const instance = mount(TabParameters, {
localVue,
doBefore: ({ store }) => {
store.commit(`setGovParameters`, governanceParameters)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`TabGovernanceParameters has the expected html structure 1`] = `
exports[`TabParameters has the expected html structure 1`] = `
<div>
<div
class="parameters__details parameters__section"
Expand Down
50 changes: 50 additions & 0 deletions test/unit/specs/connectors/api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,56 @@ describe(`API`, () => {
expect(error.response.data).toBe(`something failed`)
}
})

it(`returns a flat response for vesting account`, async () => {
axios.mockReturnValueOnce(
Promise.resolve({
data: {
type: `auth/DelayedVestingAccount`,
value: {
BaseVestingAccount: {
BaseAccount: {
coins: [{ x: 1 }],
sequence: `1`,
account_number: `213`
},
vestingProp: `Y`
}
}
}
})
)
const res = await client.getAccount(`address`)
expect(res).toEqual({
coins: [{ x: 1 }],
sequence: `1`,
account_number: `213`,
vestingProp: `Y`
})
})

it(`shows an error if vesting format changed`, async () => {
const spy = jest.spyOn(console, `error`).mockImplementationOnce(() => {})
axios.mockReturnValueOnce(
Promise.resolve({
data: {
type: `auth/DelayedVestingAccount`,
value: {
xxx: {
}
}
}
})
)
const res = await client.getAccount(`address`)
expect(res).toEqual({
coins: [],
sequence: `0`,
account_number: `0`
})
expect(spy).toHaveBeenCalled()
console.error.mockReset()
})
})

describe(`Fee Distribution`, () => {
Expand Down

0 comments on commit 4984770

Please sign in to comment.