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

Fabo/2435 fix sending on testnet #2439

Merged
merged 5 commits into from
Apr 8, 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
1 change: 1 addition & 0 deletions app/src/renderer/components/wallet/SendModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:submit-fn="submitForm"
:simulate-fn="simulateForm"
:validate="validateForm"
:amount="amount"
title="Send"
submission-error-prefix="Sending tokens failed"
@close="clear"
Expand Down
4 changes: 4 additions & 0 deletions app/src/renderer/vuex/modules/governance/parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default ({ node }) => {
}

const actions = {
signIn({ dispatch }) {
// needed for deposit denom for governance
dispatch(`getGovParameters`)
},
async getGovParameters({ state, commit, rootState }) {
state.loading = true

Expand Down
4 changes: 4 additions & 0 deletions app/src/renderer/vuex/modules/parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export default ({ node }) => {
}

const actions = {
signIn({ dispatch }) {
// needed for bond denom for gas calculation
dispatch(`getStakingParameters`)
},
async getStakingParameters({ state, commit, rootState }) {
state.loading = true

Expand Down
2 changes: 2 additions & 0 deletions changes/fabo_2435-fix-sending-on-testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Fixed] [#2435](https://github.com/cosmos/lunie/issues/2435) Fixed fee display for sending tokens @faboweb
[Fixed] [#2435](https://github.com/cosmos/lunie/issues/2435) Fixed fee denom not being correct and therefor sending not working @faboweb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

exports[`SendModal should display send modal form 1`] = `
<action-modal-stub
amount="0"
denom="STAKE"
id="send-modal"
simulatefn="function () { [native code] }"
Expand Down Expand Up @@ -64,7 +63,7 @@ exports[`SendModal should display send modal form 1`] = `

exports[`SendModal validation should show address required error 1`] = `
<action-modal-stub
amount="0"
amount="2"
denom="STAKE"
id="send-modal"
simulatefn="function () { [native code] }"
Expand Down Expand Up @@ -128,7 +127,7 @@ exports[`SendModal validation should show address required error 1`] = `

exports[`SendModal validation should show bech32 error when address length is too long 1`] = `
<action-modal-stub
amount="0"
amount="2"
denom="STAKE"
id="send-modal"
simulatefn="function () { [native code] }"
Expand Down Expand Up @@ -192,7 +191,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`] = `
<action-modal-stub
amount="0"
amount="2"
denom="STAKE"
id="send-modal"
simulatefn="function () { [native code] }"
Expand Down Expand Up @@ -256,7 +255,6 @@ exports[`SendModal validation should show bech32 error when address length is to

exports[`SendModal validation should show bech32 error when alphanumeric is wrong 1`] = `
<action-modal-stub
amount="0"
denom="STAKE"
id="send-modal"
simulatefn="function () { [native code] }"
Expand Down
7 changes: 7 additions & 0 deletions test/unit/specs/store/governance/parameters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ describe(`Module: Governance Parameters`, () => {
])
})

it(`fetches all governance parameters on sign in`, async () => {
const { actions } = module
const dispatch = jest.fn()
await actions.signIn({ dispatch })
expect(dispatch).toHaveBeenCalledWith(`getGovParameters`)
})

it(`should store an error if failed to load governance deposit parameters`, async () => {
node.getGovDepositParameters = () => Promise.reject(new Error(`Error`))
const { actions, state } = module
Expand Down
7 changes: 7 additions & 0 deletions test/unit/specs/store/parameters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ describe(`Module: Staking Parameters`, () => {
])
})

it(`fetches all staking parameters on sign in`, async () => {
const { actions } = module
const dispatch = jest.fn()
await actions.signIn({ dispatch })
expect(dispatch).toHaveBeenCalledWith(`getStakingParameters`)
})

it(`should add staking parameters to state`, () => {
const { mutations, state } = module
mutations.setStakingParameters(state, stakingParameters.parameters)
Expand Down