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

fedekunze/1769 remove hardcoded params #1770

Merged
merged 24 commits into from
Jan 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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
/app/dist/
/app/networks/
/builds/
/tasks/builds/*
/testArtifacts
/test/unit/coverage/
/.vscode/settings.json
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DS_Store
app/dist
builds/*
task/builds/*
task/builds
coverage
node_modules
npm-debug.log
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [\#1724](https://github.com/cosmos/voyager/issues/1724) set tabindex attribute to -1 for readonly denom on ModalProposals. tab navgiation now skips element @enyan94
- [\#1277](https://github.com/cosmos/voyager/issues/1277) change name of VmToolBar to ToolBar, update all snapshots and import statements @coreycosman
- [\#1432](https://github.com/cosmos/voyager/issues/1432) Moved @tendermint/UI components back into the Voyager repository @faboweb
- [\#1769](https://github.com/cosmos/voyager/issues/1769) Removed hardcoded parameters values @fedekunze
- [\#1694](https://github.com/cosmos/voyager/issues/1694) Improved the `README` @faboweb @fedekunze
- [\#1379](https://github.com/cosmos/voyager/issues/1379) Changed some tests so they don't display errors on the console to better identify real errors @faboweb
- [\#1792](https://github.com/cosmos/voyager/pull/1792) removed mocked demo mode @fedekunze
Expand Down
6 changes: 3 additions & 3 deletions app/src/renderer/components/common/TmBalance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<img class="icon" src="~assets/images/cosmos-logo.png" />
</div>
<div class="total-atoms top-section">
<h3>Total {{ bondingDenom }}</h3>
<h3>Total {{ bondDenom }}</h3>
<h2 class="total-atoms__value">{{ num.shortNumber(totalAtoms) }}</h2>
</div>
<div v-if="unbondedAtoms" class="unbonded-atoms top-section">
<h3>Available {{ bondingDenom }}</h3>
<h3>Available {{ bondDenom }}</h3>
<h2>{{ unbondedAtoms }}</h2>
</div>
</div>
Expand Down Expand Up @@ -51,7 +51,7 @@ export default {
}
},
computed: {
...mapGetters([`bondingDenom`, `user`, `totalAtoms`]),
...mapGetters([`user`, `totalAtoms`, `bondDenom`]),
address() {
return this.user.address
},
Expand Down
6 changes: 3 additions & 3 deletions app/src/renderer/components/common/TmOnboarding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default {
name: `tm-onboarding`,
components: { TmBtn, TmBarDiscrete },
computed: {
...mapGetters([`onboarding`, `bondingDenom`]),
...mapGetters([`onboarding`, `bondDenom`]),
activeKey() {
return this.onboarding.state
},
Expand All @@ -62,8 +62,8 @@ export default {
`This is a quick tour of the primary features of Cosmos Voyager.`,
`You can send and receive Cosmos tokens from anyone around the world.`,
`You can delegate your ${
this.bondingDenom
} to Cosmos Validators to earn even more ${this.bondingDenom}.`,
this.bondDenom
} to Cosmos Validators to earn even more ${this.bondDenom}.`,
`Through governance, you can vote on the future of the Cosmos Network.`,
`Start using Voyager to explore the Cosmos Network!`
]
Expand Down
3 changes: 1 addition & 2 deletions app/src/renderer/components/governance/ModalDeposit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<tm-field
v-focus
id="amount"
:max="balance"
:min="0"
:max="balance"
v-model="amount"
type="number"
/>
Expand Down Expand Up @@ -118,7 +118,6 @@ export default {
showPassword: false
}),
computed: {
// TODO: get coin denom from governance params
...mapGetters([`wallet`]),
balance() {
// TODO: refactor to get the selected coin when multicooin deposit is enabled
Expand Down
4 changes: 1 addition & 3 deletions app/src/renderer/components/governance/ModalPropose.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
/>
<tm-field
id="amount"
:max="balance"
:min="0"
:max="balance"
v-model="amount"
type="number"
/>
Expand Down Expand Up @@ -122,7 +122,6 @@ import TmFormMsg from "common/TmFormMsg"

const isValid = type =>
type === `Text` || type === `ParameterChange` || type === `SoftwareUpgrade`

const notBlank = text => !isEmpty(trim(text))
const isInteger = amount => Number.isInteger(amount)

Expand Down Expand Up @@ -157,7 +156,6 @@ export default {
showPassword: false
}),
computed: {
// TODO: get coin denom from governance params
...mapGetters([`wallet`]),
balance() {
// TODO: refactor to get the selected coin when multicoin deposit is enabled
Expand Down
7 changes: 3 additions & 4 deletions app/src/renderer/components/governance/PageGovernance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<modal-propose
v-if="showModalPropose"
:show-modal-propose.sync="showModalPropose"
:denom="bondingDenom"
:denom="depositDenom"
@createProposal="propose"
/>
<router-view />
Expand Down Expand Up @@ -67,8 +67,7 @@ export default {
showModalPropose: false
}),
computed: {
// TODO: get min deposit denom from gov params
...mapGetters([`proposals`, `filters`, `bondingDenom`, `connected`])
...mapGetters([`proposals`, `filters`, `connected`, `depositDenom`])
},
mounted() {
this.ps = new PerfectScrollbar(this.$el.querySelector(`.tm-page-main`))
Expand All @@ -88,7 +87,7 @@ export default {
type,
initial_deposit: [
{
denom: this.bondingDenom,
denom: this.depositDenom,
amount: String(amount)
}
],
Expand Down
8 changes: 3 additions & 5 deletions app/src/renderer/components/governance/PageProposal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
:show-modal-deposit.sync="showModalDeposit"
:proposal-id="proposalId"
:proposal-title="proposal.title"
:denom="bondingDenom"
:denom="depositDenom"
@submitDeposit="deposit"
/>
<modal-vote
Expand Down Expand Up @@ -157,9 +157,8 @@ export default {
lastVote: undefined
}),
computed: {
// TODO: get denom from governance params
...mapGetters([
`bondingDenom`,
`depositDenom`,
`proposals`,
`connected`,
`wallet`,
Expand Down Expand Up @@ -258,11 +257,10 @@ export default {
password
})

// TODO: get min deposit denom from gov params
this.$store.commit(`notify`, {
title: `Successful deposit!`,
body: `You have successfully deposited your ${
this.bondingDenom
this.depositDenom
}s on proposal #${this.proposalId}`
})
} catch ({ message }) {
Expand Down
10 changes: 5 additions & 5 deletions app/src/renderer/components/staking/DelegationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>
<tm-field
id="denom"
:placeholder="bondingDenom"
:placeholder="denom"
type="text"
readonly="readonly"
/>
Expand Down Expand Up @@ -91,7 +91,6 @@
</template>

<script>
import { mapGetters } from "vuex"
import ClickOutside from "vue-click-outside"
import { required, between } from "vuelidate/lib/validators"
import Modal from "common/TmModal"
Expand Down Expand Up @@ -122,6 +121,10 @@ export default {
to: {
type: String,
required: true
},
denom: {
type: String,
required: true
}
},
data: () => ({
Expand All @@ -130,9 +133,6 @@ export default {
password: ``,
showPassword: false
}),
computed: {
...mapGetters([`bondingDenom`])
},
validations() {
return {
amount: {
Expand Down
24 changes: 14 additions & 10 deletions app/src/renderer/components/staking/PageValidator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@
</div>
<div class="row page-profile__header__data">
<dl class="colored_dl">
<dt>Delegated {{ bondingDenom }}</dt>
<dt>Delegated {{ bondDenom }}</dt>
<dd>
{{
/* eslint-disable */
myBond.isLessThan(0.01) && myBond.isGreaterThan(0)
? `< 0.01` // eslint-disable-line
? `< 0.01`
: num.shortNumber(myBond)
/*eslint-enable */
}}
</dd>
</dl>
Expand Down Expand Up @@ -149,11 +151,11 @@
</dd>
</dl>
<dl class="info_dl">
<dt>Self Delegated {{ bondingDenom }}</dt>
<dt>Self Delegated {{ bondDenom }}</dt>
<dd id="page-profile__self-bond">{{ selfBond }} %</dd>
</dl>
<dl v-if="config.devMode" class="info_dl">
<dt>Minimum Self Delegated {{ bondingDenom }}</dt>
<dt>Minimum Self Delegated {{ bondDenom }}</dt>
<dd>0 %</dd>
</dl>
</div>
Expand All @@ -164,21 +166,23 @@
:show-delegation-modal.sync="showDelegationModal"
:from-options="delegationTargetOptions()"
:to="validator.operator_address"
:denom="bondDenom"
@submitDelegation="submitDelegation"
/>
<undelegation-modal
v-if="showUndelegationModal"
:show-undelegation-modal.sync="showUndelegationModal"
:maximum="myBond.toNumber()"
:to="wallet.address"
:denom="bondDenom"
@submitUndelegation="submitUndelegation"
/>
<tm-modal v-if="showCannotModal" :close="closeCannotModal">
<div slot="title">
Cannot {{ action === `delegate` ? `Delegate` : `Undelegate` }}
</div>
<p>
You have no {{ bondingDenom }}s
You have no {{ bondDenom }}s
{{ action === `undelegate` ? ` delegated ` : ` ` }}to
{{ action === `delegate` ? ` delegate.` : ` this validator.` }}
</p>
Expand Down Expand Up @@ -240,7 +244,7 @@ export default {
}),
computed: {
...mapGetters([
`bondingDenom`,
`bondDenom`,
`delegates`,
`delegation`,
`committedDelegations`,
Expand Down Expand Up @@ -386,11 +390,11 @@ export default {

this.$store.commit(`notify`, {
title: `Successful ${txTitle}!`,
body: `You have successfully ${txBody} your ${this.bondingDenom}s`
body: `You have successfully ${txBody} your ${this.bondDenom}s`
})
} catch ({ message }) {
this.$store.commit(`notifyError`, {
title: `Error while ${txAction} ${this.bondingDenom}s`,
title: `Error while ${txAction} ${this.bondDenom}s`,
body: message
})
}
Expand All @@ -412,12 +416,12 @@ export default {
this.$store.commit(`notify`, {
title: `Successful Undelegation!`,
body: `You have successfully undelegated ${amount} ${
this.bondingDenom
this.bondDenom
}s.`
})
} catch ({ message }) {
this.$store.commit(`notifyError`, {
title: `Error while undelegating ${this.bondingDenom}s`,
title: `Error while undelegating ${this.bondDenom}s`,
body: message
})
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/renderer/components/staking/TabMyDelegations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<tm-data-msg v-else-if="yourValidators.length === 0" icon="info_outline">
<div slot="title">No Active Delegations</div>
<div slot="subtitle">
Looks like you haven't delegated any {{ bondingDenom }}s yet. Head over
to the
Looks like you haven't delegated any {{ bondDenom }}s yet. Head over to
the
<router-link :to="{ name: 'Validators' }">validator list</router-link>
to make your first delegation!
</div>
Expand Down Expand Up @@ -43,7 +43,7 @@
<tm-li-stake-transaction
:transaction="transaction"
:validators="yourValidators"
:bonding-denom="bondingDenom"
:bonding-denom="bondDenom"
:key="transaction.hash"
:url="validatorURL"
:unbonding-time="
Expand Down Expand Up @@ -90,7 +90,7 @@ export default {
`delegates`,
`delegation`,
`committedDelegations`,
`bondingDenom`,
`bondDenom`,
`connected`
]),
yourValidators({ committedDelegations, delegates: { delegates } } = this) {
Expand Down
22 changes: 3 additions & 19 deletions app/src/renderer/components/staking/TabParameters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@
<div class="column">
<dl class="info_dl">
<dt>
Loose
{{
stakingParameters.parameters.bond_denom
? stakingParameters.parameters.bond_denom
: bondingDenom
}}
Loose {{ stakingParameters.parameters.bond_denom }}
<i
v-tooltip.top="poolTooltips.loose_tokens"
class="material-icons info-button"
Expand All @@ -43,12 +38,7 @@
<div class="column">
<dl class="info_dl">
<dt>
Delegated
{{
stakingParameters.parameters.bond_denom
? stakingParameters.parameters.bond_denom
: bondingDenom
}}
Delegated {{ stakingParameters.parameters.bond_denom }}
<i
v-tooltip.top="poolTooltips.bonded_tokens"
class="material-icons info-button"
Expand Down Expand Up @@ -153,13 +143,7 @@ export default {
}
}),
computed: {
...mapGetters([
`config`,
`stakingParameters`,
`pool`,
`bondingDenom`,
`connected`
]),
...mapGetters([`config`, `stakingParameters`, `pool`, `connected`]),
unbondingTimeInDays() {
return (
parseInt(this.stakingParameters.parameters.unbonding_time) /
Expand Down
Loading